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
ae5c990f5795a540e848dc0941b87ca14098cbb9
1,358
asm
Assembly
edk2/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memmove.asm
awwiniot/Aw1689UEFI
968033cea6432cf3121ef933f2e7f073d11363fb
[ "MIT" ]
21
2016-11-20T16:47:01.000Z
2022-03-04T12:10:19.000Z
edk2/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memmove.asm
awwiniot/Aw1689UEFI
968033cea6432cf3121ef933f2e7f073d11363fb
[ "MIT" ]
3
2017-01-07T18:05:32.000Z
2017-06-09T05:47:20.000Z
edk2/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memmove.asm
awwiniot/Aw1689UEFI
968033cea6432cf3121ef933f2e7f073d11363fb
[ "MIT" ]
8
2017-01-09T07:44:28.000Z
2020-05-10T00:09:54.000Z
//------------------------------------------------------------------------------ // // Copyright (c) 2011, ARM Limited. All rights reserved. // // This program and the accompanying materials // are licensed and made available under the terms and conditions of the BSD License // which accompanies this distribution. The full text of the license may be found at // http://opensource.org/licenses/bsd-license.php // // THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, // WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. // //------------------------------------------------------------------------------ EXPORT __aeabi_memmove AREA Memmove, CODE, READONLY ; ;VOID ;EFIAPI ;__aeabi_memmove ( ; IN VOID *Destination, ; IN CONST VOID *Source, ; IN UINT32 Size ; ); ; __aeabi_memmove CMP r2, #0 BXEQ r14 CMP r0, r1 BXEQ r14 BHI memmove_backward BLS memmove_forward memmove_forward LDRB r3, [r1], #1 STRB r3, [r0], #1 SUBS r2, r2, #1 BXEQ r14 B memmove_forward memmove_backward add r0, r2 add r1, r2 memmove_backward_loop LDRB r3, [r1], #-1 STRB r3, [r0], #-1 SUBS r2, r2, #-1 BXEQ r14 B memmove_backward_loop END
24.690909
86
0.544919
f50bb32dafa3dd29ec2ec53b75ccd349bde87150
252
asm
Assembly
programs/oeis/109/A109009.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/109/A109009.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/109/A109009.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A109009: a(n) = gcd(n,5). ; 5,1,1,1,1,5,1,1,1,1,5,1,1,1,1,5,1,1,1,1,5,1,1,1,1,5,1,1,1,1,5,1,1,1,1,5,1,1,1,1,5,1,1,1,1,5,1,1,1,1,5,1,1,1,1,5,1,1,1,1,5,1,1,1,1,5,1,1,1,1,5,1,1,1,1,5,1,1,1,1,5,1,1,1,1,5,1,1,1,1,5,1,1,1,1,5,1,1,1,1,5 gcd $0,5 mov $1,$0
42
203
0.496032
02c9128fa35f90b4deac9ab456a30826506ae857
288
asm
Assembly
libsrc/genmath/norm4.asm
dex4er/deb-z88dk
9ee4f23444fa6f6043462332a1bff7ae20a8504b
[ "ClArtistic" ]
1
2018-09-04T23:07:24.000Z
2018-09-04T23:07:24.000Z
libsrc/genmath/norm4.asm
dex4er/deb-z88dk
9ee4f23444fa6f6043462332a1bff7ae20a8504b
[ "ClArtistic" ]
null
null
null
libsrc/genmath/norm4.asm
dex4er/deb-z88dk
9ee4f23444fa6f6043462332a1bff7ae20a8504b
[ "ClArtistic" ]
null
null
null
; ; Z88dk Generic Floating Point Math Library ; ; Normalise 48bit number in c ix de b ; current exponent in fa+5 ; Result -> fa +5 ; ; $Id: norm4.asm,v 1.1 2002/01/21 20:35:22 dom Exp $: XLIB norm4 XREF fa .NORM4 XOR A .NORM6 LD (FA+5),A RET
15.157895
59
0.569444
600d025924678340bdca14319c36068d0f40345a
272
asm
Assembly
programs/oeis/130/A130658.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/130/A130658.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/130/A130658.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A130658: Period 4: repeat [1, 1, 2, 2]. ; 1,1,2,2,1,1,2,2,1,1,2,2,1,1,2,2,1,1,2,2,1,1,2,2,1,1,2,2,1,1,2,2,1,1,2,2,1,1,2,2,1,1,2,2,1,1,2,2,1,1,2,2,1,1,2,2,1,1,2,2,1,1,2,2,1,1,2,2,1,1,2,2,1,1,2,2,1,1,2,2,1,1,2,2,1,1,2,2,1,1,2,2,1,1,2,2,1,1,2,2 mod $0,4 div $0,2 add $0,1
38.857143
201
0.511029
2c84a7e8d14d0935c3b8e8601f0b82b833888194
278
asm
Assembly
programs/oeis/120/A120324.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/120/A120324.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/120/A120324.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A120324: Periodic sequence 0, 1, 0, 4, 0, 1. ; 0,1,0,4,0,1,0,1,0,4,0,1,0,1,0,4,0,1,0,1,0,4,0,1,0,1,0,4,0,1,0,1,0,4,0,1,0,1,0,4,0,1,0,1,0,4,0,1,0,1,0,4,0,1,0,1,0,4,0,1,0,1,0,4,0,1,0,1,0,4,0,1,0,1,0,4,0,1,0,1,0,4,0,1,0,1,0,4,0,1,0 gcd $0,6 add $0,7 gcd $0,20 sub $0,2 div $0,2
30.888889
183
0.52518
5ac8529bb1e96e31facd3195d452b3c80c7042a1
35,173
asm
Assembly
LibSource/NativeCryptography/iaesx64.asm
ekzyis/CrypTool-2
1af234b4f74486fbfeb3b3c49228cc36533a8c89
[ "Apache-2.0" ]
12
2021-09-29T14:50:06.000Z
2022-03-31T15:01:21.000Z
LibSource/NativeCryptography/iaesx64.asm
ekzyis/CrypTool-2
1af234b4f74486fbfeb3b3c49228cc36533a8c89
[ "Apache-2.0" ]
15
2021-12-24T22:53:49.000Z
2021-12-25T10:03:13.000Z
LibSource/NativeCryptography/iaesx64.asm
ekzyis/CrypTool-2
1af234b4f74486fbfeb3b3c49228cc36533a8c89
[ "Apache-2.0" ]
10
2021-10-17T19:46:51.000Z
2022-03-18T02:57:57.000Z
[BITS 64] [CPU intelnop] ; Copyright (c) 2010, 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. %macro linux_setup 0 %ifdef __linux__ mov rcx, rdi mov rdx, rsi %endif %endmacro %macro inversekey 1 movdqu xmm1,%1 aesimc xmm0,xmm1 movdqu %1,xmm0 %endmacro %macro aesdeclast1 1 aesdeclast xmm0,%1 %endmacro %macro aesenclast1 1 aesenclast xmm0,%1 %endmacro %macro aesdec1 1 aesdec xmm0,%1 %endmacro %macro aesenc1 1 aesenc xmm0,%1 %endmacro %macro aesdeclast1_u 1 movdqu xmm4,%1 aesdeclast xmm0,xmm4 %endmacro %macro aesenclast1_u 1 movdqu xmm4,%1 aesenclast xmm0,xmm4 %endmacro %macro aesdec1_u 1 movdqu xmm4,%1 aesdec xmm0,xmm4 %endmacro %macro aesenc1_u 1 movdqu xmm4,%1 aesenc xmm0,xmm4 %endmacro %macro aesdec4 1 movdqa xmm4,%1 aesdec xmm0,xmm4 aesdec xmm1,xmm4 aesdec xmm2,xmm4 aesdec xmm3,xmm4 %endmacro %macro aesdeclast4 1 movdqa xmm4,%1 aesdeclast xmm0,xmm4 aesdeclast xmm1,xmm4 aesdeclast xmm2,xmm4 aesdeclast xmm3,xmm4 %endmacro %macro aesenc4 1 movdqa xmm4,%1 aesenc xmm0,xmm4 aesenc xmm1,xmm4 aesenc xmm2,xmm4 aesenc xmm3,xmm4 %endmacro %macro aesenclast4 1 movdqa xmm4,%1 aesenclast xmm0,xmm4 aesenclast xmm1,xmm4 aesenclast xmm2,xmm4 aesenclast xmm3,xmm4 %endmacro %macro load_and_inc4 1 movdqa xmm4,%1 movdqa xmm0,xmm5 movdqa xmm1,xmm5 paddq xmm1,[counter_add_one wrt rip] movdqa xmm2,xmm5 paddq xmm2,[counter_add_two wrt rip] movdqa xmm3,xmm5 paddq xmm3,[counter_add_three wrt rip] pxor xmm0,xmm4 paddq xmm5,[counter_add_four wrt rip] pxor xmm1,xmm4 pxor xmm2,xmm4 pxor xmm3,xmm4 %endmacro %macro xor_with_input4 1 movdqu xmm4,[%1] pxor xmm0,xmm4 movdqu xmm4,[%1+16] pxor xmm1,xmm4 movdqu xmm4,[%1+32] pxor xmm2,xmm4 movdqu xmm4,[%1+48] pxor xmm3,xmm4 %endmacro %macro load_and_xor4 2 movdqa xmm4,%2 movdqu xmm0,[%1 + 0*16] pxor xmm0,xmm4 movdqu xmm1,[%1 + 1*16] pxor xmm1,xmm4 movdqu xmm2,[%1 + 2*16] pxor xmm2,xmm4 movdqu xmm3,[%1 + 3*16] pxor xmm3,xmm4 %endmacro %macro store4 1 movdqu [%1 + 0*16],xmm0 movdqu [%1 + 1*16],xmm1 movdqu [%1 + 2*16],xmm2 movdqu [%1 + 3*16],xmm3 %endmacro %macro copy_round_keys 3 movdqu xmm4,[%2 + ((%3)*16)] movdqa [%1 + ((%3)*16)],xmm4 %endmacro %macro key_expansion_1_192 1 ;; Assumes the xmm3 includes all zeros at this point. pshufd xmm2, xmm2, 11111111b shufps xmm3, xmm1, 00010000b pxor xmm1, xmm3 shufps xmm3, xmm1, 10001100b pxor xmm1, xmm3 pxor xmm1, xmm2 movdqu [rdx+%1], xmm1 %endmacro ; Calculate w10 and w11 using calculated w9 and known w4-w5 %macro key_expansion_2_192 1 movdqa xmm5, xmm4 pslldq xmm5, 4 shufps xmm6, xmm1, 11110000b pxor xmm6, xmm5 pxor xmm4, xmm6 pshufd xmm7, xmm4, 00001110b movdqu [rdx+%1], xmm7 %endmacro section .data align 16 shuffle_mask: DD 0FFFFFFFFh DD 03020100h DD 07060504h DD 0B0A0908h align 16 counter_add_one: DD 1 DD 0 DD 0 DD 0 counter_add_two: DD 2 DD 0 DD 0 DD 0 counter_add_three: DD 3 DD 0 DD 0 DD 0 counter_add_four: DD 4 DD 0 DD 0 DD 0 section .text align 16 key_expansion256: pshufd xmm2, xmm2, 011111111b movdqa xmm4, xmm1 pshufb xmm4, xmm5 pxor xmm1, xmm4 pshufb xmm4, xmm5 pxor xmm1, xmm4 pshufb xmm4, xmm5 pxor xmm1, xmm4 pxor xmm1, xmm2 movdqu [rdx], xmm1 add rdx, 0x10 aeskeygenassist xmm4, xmm1, 0 pshufd xmm2, xmm4, 010101010b movdqa xmm4, xmm3 pshufb xmm4, xmm5 pxor xmm3, xmm4 pshufb xmm4, xmm5 pxor xmm3, xmm4 pshufb xmm4, xmm5 pxor xmm3, xmm4 pxor xmm3, xmm2 movdqu [rdx], xmm3 add rdx, 0x10 ret align 16 key_expansion128: pshufd xmm2, xmm2, 0xFF; movdqa xmm3, xmm1 pshufb xmm3, xmm5 pxor xmm1, xmm3 pshufb xmm3, xmm5 pxor xmm1, xmm3 pshufb xmm3, xmm5 pxor xmm1, xmm3 pxor xmm1, xmm2 ; storing the result in the key schedule array movdqu [rdx], xmm1 add rdx, 0x10 ret align 16 global iEncExpandKey128 iEncExpandKey128: linux_setup movdqu xmm1, [rcx] ; loading the key movdqu [rdx], xmm1 movdqa xmm5, [shuffle_mask wrt rip] add rdx,16 aeskeygenassist xmm2, xmm1, 0x1 ; Generating round key 1 call key_expansion128 aeskeygenassist xmm2, xmm1, 0x2 ; Generating round key 2 call key_expansion128 aeskeygenassist xmm2, xmm1, 0x4 ; Generating round key 3 call key_expansion128 aeskeygenassist xmm2, xmm1, 0x8 ; Generating round key 4 call key_expansion128 aeskeygenassist xmm2, xmm1, 0x10 ; Generating round key 5 call key_expansion128 aeskeygenassist xmm2, xmm1, 0x20 ; Generating round key 6 call key_expansion128 aeskeygenassist xmm2, xmm1, 0x40 ; Generating round key 7 call key_expansion128 aeskeygenassist xmm2, xmm1, 0x80 ; Generating round key 8 call key_expansion128 aeskeygenassist xmm2, xmm1, 0x1b ; Generating round key 9 call key_expansion128 aeskeygenassist xmm2, xmm1, 0x36 ; Generating round key 10 call key_expansion128 ret align 16 global iEncExpandKey192 iEncExpandKey192: linux_setup sub rsp,64+8 movdqa [rsp],xmm6 movdqa [rsp+16],xmm7 movq xmm7, [rcx+16] ; loading the AES key movq [rdx+16], xmm7 ; Storing key in memory where all key expansion pshufd xmm4, xmm7, 01001111b movdqu xmm1, [rcx] ; loading the AES key movdqu [rdx], xmm1 ; Storing key in memory where all key expansion pxor xmm3, xmm3 ; Set xmm3 to be all zeros. Required for the key_expansion. pxor xmm6, xmm6 ; Set xmm3 to be all zeros. Required for the key_expansion. aeskeygenassist xmm2, xmm4, 0x1 ; Complete round key 1 and generate round key 2 key_expansion_1_192 24 key_expansion_2_192 40 aeskeygenassist xmm2, xmm4, 0x2 ; Generate round key 3 and part of round key 4 key_expansion_1_192 48 key_expansion_2_192 64 aeskeygenassist xmm2, xmm4, 0x4 ; Complete round key 4 and generate round key 5 key_expansion_1_192 72 key_expansion_2_192 88 aeskeygenassist xmm2, xmm4, 0x8 ; Generate round key 6 and part of round key 7 key_expansion_1_192 96 key_expansion_2_192 112 aeskeygenassist xmm2, xmm4, 0x10 ; Complete round key 7 and generate round key 8 key_expansion_1_192 120 key_expansion_2_192 136 aeskeygenassist xmm2, xmm4, 0x20 ; Generate round key 9 and part of round key 10 key_expansion_1_192 144 key_expansion_2_192 160 aeskeygenassist xmm2, xmm4, 0x40 ; Complete round key 10 and generate round key 11 key_expansion_1_192 168 key_expansion_2_192 184 aeskeygenassist xmm2, xmm4, 0x80 ; Generate round key 12 key_expansion_1_192 192 movdqa xmm6,[rsp] movdqa xmm7,[rsp+16] add rsp,64+8 ret align 16 global iDecExpandKey128 iDecExpandKey128: linux_setup push rcx push rdx sub rsp,16+8 call iEncExpandKey128 add rsp,16+8 pop rdx pop rcx inversekey [rdx + 1*16] inversekey [rdx + 2*16] inversekey [rdx + 3*16] inversekey [rdx + 4*16] inversekey [rdx + 5*16] inversekey [rdx + 6*16] inversekey [rdx + 7*16] inversekey [rdx + 8*16] inversekey [rdx + 9*16] ret align 16 global iDecExpandKey192 iDecExpandKey192: linux_setup push rcx push rdx sub rsp,16+8 call iEncExpandKey192 add rsp,16+8 pop rdx pop rcx inversekey [rdx + 1*16] inversekey [rdx + 2*16] inversekey [rdx + 3*16] inversekey [rdx + 4*16] inversekey [rdx + 5*16] inversekey [rdx + 6*16] inversekey [rdx + 7*16] inversekey [rdx + 8*16] inversekey [rdx + 9*16] inversekey [rdx + 10*16] inversekey [rdx + 11*16] ret align 16 global iDecExpandKey256 iDecExpandKey256: linux_setup push rcx push rdx sub rsp,16+8 call iEncExpandKey256 add rsp,16+8 pop rdx pop rcx inversekey [rdx + 1*16] inversekey [rdx + 2*16] inversekey [rdx + 3*16] inversekey [rdx + 4*16] inversekey [rdx + 5*16] inversekey [rdx + 6*16] inversekey [rdx + 7*16] inversekey [rdx + 8*16] inversekey [rdx + 9*16] inversekey [rdx + 10*16] inversekey [rdx + 11*16] inversekey [rdx + 12*16] inversekey [rdx + 13*16] ret align 16 global iEncExpandKey256 iEncExpandKey256: linux_setup movdqu xmm1, [rcx] ; loading the key movdqu xmm3, [rcx+16] movdqu [rdx], xmm1 ; Storing key in memory where all key schedule will be stored movdqu [rdx+16], xmm3 add rdx,32 movdqa xmm5, [shuffle_mask wrt rip] ; this mask is used by key_expansion aeskeygenassist xmm2, xmm3, 0x1 ; call key_expansion256 aeskeygenassist xmm2, xmm3, 0x2 ; call key_expansion256 aeskeygenassist xmm2, xmm3, 0x4 ; call key_expansion256 aeskeygenassist xmm2, xmm3, 0x8 ; call key_expansion256 aeskeygenassist xmm2, xmm3, 0x10 ; call key_expansion256 aeskeygenassist xmm2, xmm3, 0x20 ; call key_expansion256 aeskeygenassist xmm2, xmm3, 0x40 ; ; call key_expansion256 pshufd xmm2, xmm2, 011111111b movdqa xmm4, xmm1 pshufb xmm4, xmm5 pxor xmm1, xmm4 pshufb xmm4, xmm5 pxor xmm1, xmm4 pshufb xmm4, xmm5 pxor xmm1, xmm4 pxor xmm1, xmm2 movdqu [rdx], xmm1 ret align 16 global iDec128 iDec128: linux_setup sub rsp,16*16+8 mov eax,[rcx+32] ; numblocks mov rdx,[rcx] mov r8,[rcx+8] mov rcx,[rcx+16] sub r8,rdx test eax,eax jz end_dec128 cmp eax,4 jl lp128decsingle test rcx,0xf jz lp128decfour copy_round_keys rsp,rcx,0 copy_round_keys rsp,rcx,1 copy_round_keys rsp,rcx,2 copy_round_keys rsp,rcx,3 copy_round_keys rsp,rcx,4 copy_round_keys rsp,rcx,5 copy_round_keys rsp,rcx,6 copy_round_keys rsp,rcx,7 copy_round_keys rsp,rcx,8 copy_round_keys rsp,rcx,9 copy_round_keys rsp,rcx,10 mov rcx,rsp align 16 lp128decfour: test eax,eax jz end_dec128 cmp eax,4 jl lp128decsingle load_and_xor4 rdx, [rcx+10*16] add rdx,16*4 aesdec4 [rcx+9*16] aesdec4 [rcx+8*16] aesdec4 [rcx+7*16] aesdec4 [rcx+6*16] aesdec4 [rcx+5*16] aesdec4 [rcx+4*16] aesdec4 [rcx+3*16] aesdec4 [rcx+2*16] aesdec4 [rcx+1*16] aesdeclast4 [rcx+0*16] sub eax,4 store4 r8+rdx-(16*4) jmp lp128decfour align 16 lp128decsingle: movdqu xmm0, [rdx] movdqu xmm4,[rcx+10*16] pxor xmm0, xmm4 aesdec1_u [rcx+9*16] aesdec1_u [rcx+8*16] aesdec1_u [rcx+7*16] aesdec1_u [rcx+6*16] aesdec1_u [rcx+5*16] aesdec1_u [rcx+4*16] aesdec1_u [rcx+3*16] aesdec1_u [rcx+2*16] aesdec1_u [rcx+1*16] aesdeclast1_u [rcx+0*16] add rdx, 16 movdqu [r8 + rdx - 16], xmm0 dec eax jnz lp128decsingle end_dec128: add rsp,16*16+8 ret align 16 global iDec128_CBC iDec128_CBC: linux_setup sub rsp,16*16+8 mov r9,rcx mov rax,[rcx+24] movdqu xmm5,[rax] mov eax,[rcx+32] ; numblocks mov rdx,[rcx] mov r8,[rcx+8] mov rcx,[rcx+16] sub r8,rdx test eax,eax jz end_dec128_CBC cmp eax,4 jl lp128decsingle_CBC test rcx,0xf jz lp128decfour_CBC copy_round_keys rsp,rcx,0 copy_round_keys rsp,rcx,1 copy_round_keys rsp,rcx,2 copy_round_keys rsp,rcx,3 copy_round_keys rsp,rcx,4 copy_round_keys rsp,rcx,5 copy_round_keys rsp,rcx,6 copy_round_keys rsp,rcx,7 copy_round_keys rsp,rcx,8 copy_round_keys rsp,rcx,9 copy_round_keys rsp,rcx,10 mov rcx,rsp align 16 lp128decfour_CBC: test eax,eax jz end_dec128_CBC cmp eax,4 jl lp128decsingle_CBC load_and_xor4 rdx, [rcx+10*16] add rdx,16*4 aesdec4 [rcx+9*16] aesdec4 [rcx+8*16] aesdec4 [rcx+7*16] aesdec4 [rcx+6*16] aesdec4 [rcx+5*16] aesdec4 [rcx+4*16] aesdec4 [rcx+3*16] aesdec4 [rcx+2*16] aesdec4 [rcx+1*16] aesdeclast4 [rcx+0*16] pxor xmm0,xmm5 movdqu xmm4,[rdx - 16*4 + 0*16] pxor xmm1,xmm4 movdqu xmm4,[rdx - 16*4 + 1*16] pxor xmm2,xmm4 movdqu xmm4,[rdx - 16*4 + 2*16] pxor xmm3,xmm4 movdqu xmm5,[rdx - 16*4 + 3*16] sub eax,4 store4 r8+rdx-(16*4) jmp lp128decfour_CBC align 16 lp128decsingle_CBC: movdqu xmm0, [rdx] movdqa xmm1,xmm0 movdqu xmm4,[rcx+10*16] pxor xmm0, xmm4 aesdec1_u [rcx+9*16] aesdec1_u [rcx+8*16] aesdec1_u [rcx+7*16] aesdec1_u [rcx+6*16] aesdec1_u [rcx+5*16] aesdec1_u [rcx+4*16] aesdec1_u [rcx+3*16] aesdec1_u [rcx+2*16] aesdec1_u [rcx+1*16] aesdeclast1_u [rcx+0*16] pxor xmm0,xmm5 movdqa xmm5,xmm1 add rdx, 16 movdqu [r8 + rdx - 16], xmm0 dec eax jnz lp128decsingle_CBC end_dec128_CBC: mov r9,[r9+24] movdqu [r9],xmm5 add rsp,16*16+8 ret align 16 global iDec192_CBC iDec192_CBC: linux_setup sub rsp,16*16+8 mov r9,rcx mov rax,[rcx+24] movdqu xmm5,[rax] mov eax,[rcx+32] ; numblocks mov rdx,[rcx] mov r8,[rcx+8] mov rcx,[rcx+16] sub r8,rdx test eax,eax jz end_dec192_CBC cmp eax,4 jl lp192decsingle_CBC test rcx,0xf jz lp192decfour_CBC copy_round_keys rsp,rcx,0 copy_round_keys rsp,rcx,1 copy_round_keys rsp,rcx,2 copy_round_keys rsp,rcx,3 copy_round_keys rsp,rcx,4 copy_round_keys rsp,rcx,5 copy_round_keys rsp,rcx,6 copy_round_keys rsp,rcx,7 copy_round_keys rsp,rcx,8 copy_round_keys rsp,rcx,9 copy_round_keys rsp,rcx,10 copy_round_keys rsp,rcx,11 copy_round_keys rsp,rcx,12 mov rcx,rsp align 16 lp192decfour_CBC: test eax,eax jz end_dec192_CBC cmp eax,4 jl lp192decsingle_CBC load_and_xor4 rdx, [rcx+12*16] add rdx,16*4 aesdec4 [rcx+11*16] aesdec4 [rcx+10*16] aesdec4 [rcx+9*16] aesdec4 [rcx+8*16] aesdec4 [rcx+7*16] aesdec4 [rcx+6*16] aesdec4 [rcx+5*16] aesdec4 [rcx+4*16] aesdec4 [rcx+3*16] aesdec4 [rcx+2*16] aesdec4 [rcx+1*16] aesdeclast4 [rcx+0*16] pxor xmm0,xmm5 movdqu xmm4,[rdx - 16*4 + 0*16] pxor xmm1,xmm4 movdqu xmm4,[rdx - 16*4 + 1*16] pxor xmm2,xmm4 movdqu xmm4,[rdx - 16*4 + 2*16] pxor xmm3,xmm4 movdqu xmm5,[rdx - 16*4 + 3*16] sub eax,4 store4 r8+rdx-(16*4) jmp lp192decfour_CBC align 16 lp192decsingle_CBC: movdqu xmm0, [rdx] movdqu xmm4,[rcx+12*16] movdqa xmm1,xmm0 pxor xmm0, xmm4 aesdec1_u [rcx+11*16] aesdec1_u [rcx+10*16] aesdec1_u [rcx+9*16] aesdec1_u [rcx+8*16] aesdec1_u [rcx+7*16] aesdec1_u [rcx+6*16] aesdec1_u [rcx+5*16] aesdec1_u [rcx+4*16] aesdec1_u [rcx+3*16] aesdec1_u [rcx+2*16] aesdec1_u [rcx+1*16] aesdeclast1_u [rcx+0*16] pxor xmm0,xmm5 movdqa xmm5,xmm1 add rdx, 16 movdqu [r8 + rdx - 16], xmm0 dec eax jnz lp192decsingle_CBC end_dec192_CBC: mov r9,[r9+24] movdqu [r9],xmm5 add rsp,16*16+8 ret align 16 global iDec256_CBC iDec256_CBC: linux_setup sub rsp,16*16+8 mov r9,rcx mov rax,[rcx+24] movdqu xmm5,[rax] mov eax,[rcx+32] ; numblocks mov rdx,[rcx] mov r8,[rcx+8] mov rcx,[rcx+16] sub r8,rdx test eax,eax jz end_dec256_CBC cmp eax,4 jl lp256decsingle_CBC test rcx,0xf jz lp256decfour_CBC copy_round_keys rsp,rcx,0 copy_round_keys rsp,rcx,1 copy_round_keys rsp,rcx,2 copy_round_keys rsp,rcx,3 copy_round_keys rsp,rcx,4 copy_round_keys rsp,rcx,5 copy_round_keys rsp,rcx,6 copy_round_keys rsp,rcx,7 copy_round_keys rsp,rcx,8 copy_round_keys rsp,rcx,9 copy_round_keys rsp,rcx,10 copy_round_keys rsp,rcx,11 copy_round_keys rsp,rcx,12 copy_round_keys rsp,rcx,13 copy_round_keys rsp,rcx,14 mov rcx,rsp align 16 lp256decfour_CBC: test eax,eax jz end_dec256_CBC cmp eax,4 jl lp256decsingle_CBC load_and_xor4 rdx, [rcx+14*16] add rdx,16*4 aesdec4 [rcx+13*16] aesdec4 [rcx+12*16] aesdec4 [rcx+11*16] aesdec4 [rcx+10*16] aesdec4 [rcx+9*16] aesdec4 [rcx+8*16] aesdec4 [rcx+7*16] aesdec4 [rcx+6*16] aesdec4 [rcx+5*16] aesdec4 [rcx+4*16] aesdec4 [rcx+3*16] aesdec4 [rcx+2*16] aesdec4 [rcx+1*16] aesdeclast4 [rcx+0*16] pxor xmm0,xmm5 movdqu xmm4,[rdx - 16*4 + 0*16] pxor xmm1,xmm4 movdqu xmm4,[rdx - 16*4 + 1*16] pxor xmm2,xmm4 movdqu xmm4,[rdx - 16*4 + 2*16] pxor xmm3,xmm4 movdqu xmm5,[rdx - 16*4 + 3*16] sub eax,4 store4 r8+rdx-(16*4) jmp lp256decfour_CBC align 16 lp256decsingle_CBC: movdqu xmm0, [rdx] movdqu xmm4,[rcx+14*16] movdqa xmm1,xmm0 pxor xmm0, xmm4 aesdec1_u [rcx+13*16] aesdec1_u [rcx+12*16] aesdec1_u [rcx+11*16] aesdec1_u [rcx+10*16] aesdec1_u [rcx+9*16] aesdec1_u [rcx+8*16] aesdec1_u [rcx+7*16] aesdec1_u [rcx+6*16] aesdec1_u [rcx+5*16] aesdec1_u [rcx+4*16] aesdec1_u [rcx+3*16] aesdec1_u [rcx+2*16] aesdec1_u [rcx+1*16] aesdeclast1_u [rcx+0*16] pxor xmm0,xmm5 movdqa xmm5,xmm1 add rdx, 16 movdqu [r8 + rdx - 16], xmm0 dec eax jnz lp256decsingle_CBC end_dec256_CBC: mov r9,[r9+24] movdqu [r9],xmm5 add rsp,16*16+8 ret align 16 global iDec192 iDec192: linux_setup sub rsp,16*16+8 mov eax,[rcx+32] ; numblocks mov rdx,[rcx] mov r8,[rcx+8] mov rcx,[rcx+16] sub r8,rdx test eax,eax jz end_dec192 cmp eax,4 jl lp192decsingle test rcx,0xf jz lp192decfour copy_round_keys rsp,rcx,0 copy_round_keys rsp,rcx,1 copy_round_keys rsp,rcx,2 copy_round_keys rsp,rcx,3 copy_round_keys rsp,rcx,4 copy_round_keys rsp,rcx,5 copy_round_keys rsp,rcx,6 copy_round_keys rsp,rcx,7 copy_round_keys rsp,rcx,8 copy_round_keys rsp,rcx,9 copy_round_keys rsp,rcx,10 copy_round_keys rsp,rcx,11 copy_round_keys rsp,rcx,12 mov rcx,rsp align 16 lp192decfour: test eax,eax jz end_dec192 cmp eax,4 jl lp192decsingle load_and_xor4 rdx, [rcx+12*16] add rdx,16*4 aesdec4 [rcx+11*16] aesdec4 [rcx+10*16] aesdec4 [rcx+9*16] aesdec4 [rcx+8*16] aesdec4 [rcx+7*16] aesdec4 [rcx+6*16] aesdec4 [rcx+5*16] aesdec4 [rcx+4*16] aesdec4 [rcx+3*16] aesdec4 [rcx+2*16] aesdec4 [rcx+1*16] aesdeclast4 [rcx+0*16] sub eax,4 store4 r8+rdx-(16*4) jmp lp192decfour align 16 lp192decsingle: movdqu xmm0, [rdx] movdqu xmm4,[rcx+12*16] pxor xmm0, xmm4 aesdec1_u [rcx+11*16] aesdec1_u [rcx+10*16] aesdec1_u [rcx+9*16] aesdec1_u [rcx+8*16] aesdec1_u [rcx+7*16] aesdec1_u [rcx+6*16] aesdec1_u [rcx+5*16] aesdec1_u [rcx+4*16] aesdec1_u [rcx+3*16] aesdec1_u [rcx+2*16] aesdec1_u [rcx+1*16] aesdeclast1_u [rcx+0*16] add rdx, 16 movdqu [r8 + rdx - 16], xmm0 dec eax jnz lp192decsingle end_dec192: add rsp,16*16+8 ret align 16 global iDec256 iDec256: linux_setup sub rsp,16*16+8 mov eax,[rcx+32] ; numblocks mov rdx,[rcx] mov r8,[rcx+8] mov rcx,[rcx+16] sub r8,rdx test eax,eax jz end_dec256 cmp eax,4 jl lp256dec test rcx,0xf jz lp256dec4 copy_round_keys rsp,rcx,0 copy_round_keys rsp,rcx,1 copy_round_keys rsp,rcx,2 copy_round_keys rsp,rcx,3 copy_round_keys rsp,rcx,4 copy_round_keys rsp,rcx,5 copy_round_keys rsp,rcx,6 copy_round_keys rsp,rcx,7 copy_round_keys rsp,rcx,8 copy_round_keys rsp,rcx,9 copy_round_keys rsp,rcx,10 copy_round_keys rsp,rcx,11 copy_round_keys rsp,rcx,12 copy_round_keys rsp,rcx,13 copy_round_keys rsp,rcx,14 mov rcx,rsp align 16 lp256dec4: test eax,eax jz end_dec256 cmp eax,4 jl lp256dec load_and_xor4 rdx,[rcx+14*16] add rdx, 4*16 aesdec4 [rcx+13*16] aesdec4 [rcx+12*16] aesdec4 [rcx+11*16] aesdec4 [rcx+10*16] aesdec4 [rcx+9*16] aesdec4 [rcx+8*16] aesdec4 [rcx+7*16] aesdec4 [rcx+6*16] aesdec4 [rcx+5*16] aesdec4 [rcx+4*16] aesdec4 [rcx+3*16] aesdec4 [rcx+2*16] aesdec4 [rcx+1*16] aesdeclast4 [rcx+0*16] store4 r8+rdx-16*4 sub eax,4 jmp lp256dec4 align 16 lp256dec: movdqu xmm0, [rdx] movdqu xmm4,[rcx+14*16] add rdx, 16 pxor xmm0, xmm4 ; Round 0 (only xor) aesdec1_u [rcx+13*16] aesdec1_u [rcx+12*16] aesdec1_u [rcx+11*16] aesdec1_u [rcx+10*16] aesdec1_u [rcx+9*16] aesdec1_u [rcx+8*16] aesdec1_u [rcx+7*16] aesdec1_u [rcx+6*16] aesdec1_u [rcx+5*16] aesdec1_u [rcx+4*16] aesdec1_u [rcx+3*16] aesdec1_u [rcx+2*16] aesdec1_u [rcx+1*16] aesdeclast1_u [rcx+0*16] ; Store output encrypted data into CIPHERTEXT array movdqu [r8+rdx-16], xmm0 dec eax jnz lp256dec end_dec256: add rsp,16*16+8 ret align 16 global iEnc128 iEnc128: linux_setup sub rsp,16*16+8 mov eax,[rcx+32] ; numblocks mov rdx,[rcx] mov r8,[rcx+8] mov rcx,[rcx+16] sub r8,rdx test eax,eax jz end_enc128 cmp eax,4 jl lp128encsingle test rcx,0xf jz lpenc128four copy_round_keys rsp,rcx,0 copy_round_keys rsp,rcx,1 copy_round_keys rsp,rcx,2 copy_round_keys rsp,rcx,3 copy_round_keys rsp,rcx,4 copy_round_keys rsp,rcx,5 copy_round_keys rsp,rcx,6 copy_round_keys rsp,rcx,7 copy_round_keys rsp,rcx,8 copy_round_keys rsp,rcx,9 copy_round_keys rsp,rcx,10 mov rcx,rsp align 16 lpenc128four: test eax,eax jz end_enc128 cmp eax,4 jl lp128encsingle load_and_xor4 rdx,[rcx+0*16] add rdx,4*16 aesenc4 [rcx+1*16] aesenc4 [rcx+2*16] aesenc4 [rcx+3*16] aesenc4 [rcx+4*16] aesenc4 [rcx+5*16] aesenc4 [rcx+6*16] aesenc4 [rcx+7*16] aesenc4 [rcx+8*16] aesenc4 [rcx+9*16] aesenclast4 [rcx+10*16] store4 r8+rdx-16*4 sub eax,4 jmp lpenc128four align 16 lp128encsingle: movdqu xmm0, [rdx] movdqu xmm4,[rcx+0*16] add rdx, 16 pxor xmm0, xmm4 aesenc1_u [rcx+1*16] aesenc1_u [rcx+2*16] aesenc1_u [rcx+3*16] aesenc1_u [rcx+4*16] aesenc1_u [rcx+5*16] aesenc1_u [rcx+6*16] aesenc1_u [rcx+7*16] aesenc1_u [rcx+8*16] aesenc1_u [rcx+9*16] aesenclast1_u [rcx+10*16] ; Store output encrypted data into CIPHERTEXT array movdqu [r8+rdx-16], xmm0 dec eax jnz lp128encsingle end_enc128: add rsp,16*16+8 ret align 16 global iEnc128_CTR iEnc128_CTR: linux_setup mov r9,rcx mov rax,[rcx+24] movdqu xmm5,[rax] sub rsp,16*16+8 mov eax,[rcx+32] ; numblocks mov rdx,[rcx] mov r8,[rcx+8] mov rcx,[rcx+16] sub r8,rdx test eax,eax jz end_encctr128 cmp eax,4 jl lp128encctrsingle test rcx,0xf jz lpencctr128four copy_round_keys rsp,rcx,0 copy_round_keys rsp,rcx,1 copy_round_keys rsp,rcx,2 copy_round_keys rsp,rcx,3 copy_round_keys rsp,rcx,4 copy_round_keys rsp,rcx,5 copy_round_keys rsp,rcx,6 copy_round_keys rsp,rcx,7 copy_round_keys rsp,rcx,8 copy_round_keys rsp,rcx,9 copy_round_keys rsp,rcx,10 mov rcx,rsp align 16 lpencctr128four: test eax,eax jz end_encctr128 cmp eax,4 jl lp128encctrsingle load_and_inc4 [rcx+0*16] add rdx,4*16 aesenc4 [rcx+1*16] aesenc4 [rcx+2*16] aesenc4 [rcx+3*16] aesenc4 [rcx+4*16] aesenc4 [rcx+5*16] aesenc4 [rcx+6*16] aesenc4 [rcx+7*16] aesenc4 [rcx+8*16] aesenc4 [rcx+9*16] aesenclast4 [rcx+10*16] xor_with_input4 rdx-(4*16) store4 r8+rdx-16*4 sub eax,4 jmp lpencctr128four align 16 lp128encctrsingle: movdqa xmm0,xmm5 paddq xmm5,[counter_add_one wrt rip] add rdx, 16 movdqu xmm4,[rcx+0*16] pxor xmm0, xmm4 aesenc1_u [rcx+1*16] aesenc1_u [rcx+2*16] aesenc1_u [rcx+3*16] aesenc1_u [rcx+4*16] aesenc1_u [rcx+5*16] aesenc1_u [rcx+6*16] aesenc1_u [rcx+7*16] aesenc1_u [rcx+8*16] aesenc1_u [rcx+9*16] aesenclast1_u [rcx+10*16] movdqu xmm4, [rdx-16] pxor xmm0,xmm4 ; Store output encrypted data into CIPHERTEXT array movdqu [r8+rdx-16], xmm0 dec eax jnz lp128encctrsingle end_encctr128: mov r9,[r9+24] movdqu [r9],xmm5 add rsp,16*16+8 ret align 16 global iEnc192_CTR iEnc192_CTR: linux_setup mov r9,rcx mov rax,[rcx+24] movdqu xmm5,[rax] sub rsp,16*16+8 mov eax,[rcx+32] ; numblocks mov rdx,[rcx] mov r8,[rcx+8] mov rcx,[rcx+16] sub r8,rdx test eax,eax jz end_encctr192 cmp eax,4 jl lp192encctrsingle test rcx,0xf jz lpencctr192four copy_round_keys rsp,rcx,0 copy_round_keys rsp,rcx,1 copy_round_keys rsp,rcx,2 copy_round_keys rsp,rcx,3 copy_round_keys rsp,rcx,4 copy_round_keys rsp,rcx,5 copy_round_keys rsp,rcx,6 copy_round_keys rsp,rcx,7 copy_round_keys rsp,rcx,8 copy_round_keys rsp,rcx,9 copy_round_keys rsp,rcx,10 copy_round_keys rsp,rcx,11 copy_round_keys rsp,rcx,12 mov rcx,rsp align 16 lpencctr192four: test eax,eax jz end_encctr192 cmp eax,4 jl lp192encctrsingle load_and_inc4 [rcx+0*16] add rdx,4*16 aesenc4 [rcx+1*16] aesenc4 [rcx+2*16] aesenc4 [rcx+3*16] aesenc4 [rcx+4*16] aesenc4 [rcx+5*16] aesenc4 [rcx+6*16] aesenc4 [rcx+7*16] aesenc4 [rcx+8*16] aesenc4 [rcx+9*16] aesenc4 [rcx+10*16] aesenc4 [rcx+11*16] aesenclast4 [rcx+12*16] xor_with_input4 rdx-(4*16) store4 r8+rdx-16*4 sub eax,4 jmp lpencctr192four align 16 lp192encctrsingle: movdqa xmm5,xmm0 movdqu xmm4,[rcx+0*16] paddq xmm5,[counter_add_one wrt rip] add rdx, 16 pxor xmm0, xmm4 aesenc1_u [rcx+1*16] aesenc1_u [rcx+2*16] aesenc1_u [rcx+3*16] aesenc1_u [rcx+4*16] aesenc1_u [rcx+5*16] aesenc1_u [rcx+6*16] aesenc1_u [rcx+7*16] aesenc1_u [rcx+8*16] aesenc1_u [rcx+9*16] aesenc1_u [rcx+10*16] aesenc1_u [rcx+11*16] aesenclast1_u [rcx+12*16] movdqu xmm4, [rdx] pxor xmm0,xmm4 ; Store output encrypted data into CIPHERTEXT array movdqu [r8+rdx-16], xmm0 dec eax jnz lp192encctrsingle end_encctr192: mov r9,[r9+24] movdqu [r9],xmm5 add rsp,16*16+8 ret align 16 global iEnc256_CTR iEnc256_CTR: linux_setup mov r9,rcx mov rax,[rcx+24] movdqu xmm5,[rax] sub rsp,16*16+8 mov eax,[rcx+32] ; numblocks mov rdx,[rcx] mov r8,[rcx+8] mov rcx,[rcx+16] sub r8,rdx test eax,eax jz end_encctr256 cmp eax,4 jl lp256encctrsingle test rcx,0xf jz lpencctr256four copy_round_keys rsp,rcx,0 copy_round_keys rsp,rcx,1 copy_round_keys rsp,rcx,2 copy_round_keys rsp,rcx,3 copy_round_keys rsp,rcx,4 copy_round_keys rsp,rcx,5 copy_round_keys rsp,rcx,6 copy_round_keys rsp,rcx,7 copy_round_keys rsp,rcx,8 copy_round_keys rsp,rcx,9 copy_round_keys rsp,rcx,10 copy_round_keys rsp,rcx,11 copy_round_keys rsp,rcx,12 copy_round_keys rsp,rcx,13 copy_round_keys rsp,rcx,14 mov rcx,rsp align 16 lpencctr256four: test eax,eax jz end_encctr256 cmp eax,4 jl lp256encctrsingle load_and_inc4 [rcx+0*16] add rdx,4*16 aesenc4 [rcx+1*16] aesenc4 [rcx+2*16] aesenc4 [rcx+3*16] aesenc4 [rcx+4*16] aesenc4 [rcx+5*16] aesenc4 [rcx+6*16] aesenc4 [rcx+7*16] aesenc4 [rcx+8*16] aesenc4 [rcx+9*16] aesenc4 [rcx+10*16] aesenc4 [rcx+11*16] aesenc4 [rcx+12*16] aesenc4 [rcx+13*16] aesenclast4 [rcx+14*16] xor_with_input4 rdx-(4*16) store4 r8+rdx-16*4 sub eax,4 jmp lpencctr256four align 16 lp256encctrsingle: movdqa xmm5,xmm0 movdqu xmm4,[rcx+0*16] paddq xmm5,[counter_add_one wrt rip] add rdx, 16 pxor xmm0, xmm4 aesenc1_u [rcx+1*16] aesenc1_u [rcx+2*16] aesenc1_u [rcx+3*16] aesenc1_u [rcx+4*16] aesenc1_u [rcx+5*16] aesenc1_u [rcx+6*16] aesenc1_u [rcx+7*16] aesenc1_u [rcx+8*16] aesenc1_u [rcx+9*16] aesenc1_u [rcx+10*16] aesenc1_u [rcx+11*16] aesenc1_u [rcx+12*16] aesenc1_u [rcx+13*16] aesenclast1_u [rcx+14*16] movdqu xmm4, [rdx] pxor xmm0,xmm4 ; Store output encrypted data into CIPHERTEXT array movdqu [r8+rdx-16], xmm0 dec eax jnz lp256encctrsingle end_encctr256: mov r9,[r9+24] movdqu [r9],xmm5 add rsp,16*16+8 ret align 16 global iEnc128_CBC iEnc128_CBC: linux_setup sub rsp,16*16+8 mov r9,rcx mov rax,[rcx+24] movdqu xmm1,[rax] mov eax,[rcx+32] ; numblocks mov rdx,[rcx] mov r8,[rcx+8] mov rcx,[rcx+16] sub r8,rdx test rcx,0xf jz lp128encsingle_CBC copy_round_keys rsp,rcx,0 copy_round_keys rsp,rcx,1 copy_round_keys rsp,rcx,2 copy_round_keys rsp,rcx,3 copy_round_keys rsp,rcx,4 copy_round_keys rsp,rcx,5 copy_round_keys rsp,rcx,6 copy_round_keys rsp,rcx,7 copy_round_keys rsp,rcx,8 copy_round_keys rsp,rcx,9 copy_round_keys rsp,rcx,10 mov rcx,rsp align 16 lp128encsingle_CBC: movdqu xmm0, [rdx] movdqu xmm4,[rcx+0*16] add rdx, 16 pxor xmm0, xmm1 pxor xmm0, xmm4 aesenc1 [rcx+1*16] aesenc1 [rcx+2*16] aesenc1 [rcx+3*16] aesenc1 [rcx+4*16] aesenc1 [rcx+5*16] aesenc1 [rcx+6*16] aesenc1 [rcx+7*16] aesenc1 [rcx+8*16] aesenc1 [rcx+9*16] aesenclast1 [rcx+10*16] movdqa xmm1,xmm0 ; Store output encrypted data into CIPHERTEXT array movdqu [r8+rdx-16], xmm0 dec eax jnz lp128encsingle_CBC mov r9,[r9+24] movdqu [r9],xmm1 add rsp,16*16+8 ret align 16 global iEnc192_CBC iEnc192_CBC: linux_setup sub rsp,16*16+8 mov r9,rcx mov rax,[rcx+24] movdqu xmm1,[rax] mov eax,[rcx+32] ; numblocks mov rdx,[rcx] mov r8,[rcx+8] mov rcx,[rcx+16] sub r8,rdx test rcx,0xf jz lp192encsingle_CBC copy_round_keys rsp,rcx,0 copy_round_keys rsp,rcx,1 copy_round_keys rsp,rcx,2 copy_round_keys rsp,rcx,3 copy_round_keys rsp,rcx,4 copy_round_keys rsp,rcx,5 copy_round_keys rsp,rcx,6 copy_round_keys rsp,rcx,7 copy_round_keys rsp,rcx,8 copy_round_keys rsp,rcx,9 copy_round_keys rsp,rcx,10 copy_round_keys rsp,rcx,11 copy_round_keys rsp,rcx,12 mov rcx,rsp align 16 lp192encsingle_CBC: movdqu xmm0, [rdx] movdqu xmm4, [rcx+0*16] add rdx, 16 pxor xmm0, xmm1 pxor xmm0, xmm4 aesenc1 [rcx+1*16] aesenc1 [rcx+2*16] aesenc1 [rcx+3*16] aesenc1 [rcx+4*16] aesenc1 [rcx+5*16] aesenc1 [rcx+6*16] aesenc1 [rcx+7*16] aesenc1 [rcx+8*16] aesenc1 [rcx+9*16] aesenc1 [rcx+10*16] aesenc1 [rcx+11*16] aesenclast1 [rcx+12*16] movdqa xmm1,xmm0 ; Store output encrypted data into CIPHERTEXT array movdqu [r8+rdx-16], xmm0 dec eax jnz lp192encsingle_CBC mov r9,[r9+24] movdqu [r9],xmm1 add rsp,16*16+8 ret align 16 global iEnc256_CBC iEnc256_CBC: linux_setup sub rsp,16*16+8 mov r9,rcx mov rax,[rcx+24] movdqu xmm1,[rax] mov eax,[rcx+32] ; numblocks mov rdx,[rcx] mov r8,[rcx+8] mov rcx,[rcx+16] sub r8,rdx test rcx,0xf jz lp256encsingle_CBC copy_round_keys rsp,rcx,0 copy_round_keys rsp,rcx,1 copy_round_keys rsp,rcx,2 copy_round_keys rsp,rcx,3 copy_round_keys rsp,rcx,4 copy_round_keys rsp,rcx,5 copy_round_keys rsp,rcx,6 copy_round_keys rsp,rcx,7 copy_round_keys rsp,rcx,8 copy_round_keys rsp,rcx,9 copy_round_keys rsp,rcx,10 copy_round_keys rsp,rcx,11 copy_round_keys rsp,rcx,12 copy_round_keys rsp,rcx,13 copy_round_keys rsp,rcx,14 mov rcx,rsp align 16 lp256encsingle_CBC: movdqu xmm0, [rdx] movdqu xmm4, [rcx+0*16] add rdx, 16 pxor xmm0, xmm1 pxor xmm0, xmm4 aesenc1 [rcx+1*16] aesenc1 [rcx+2*16] aesenc1 [rcx+3*16] aesenc1 [rcx+4*16] aesenc1 [rcx+5*16] aesenc1 [rcx+6*16] aesenc1 [rcx+7*16] aesenc1 [rcx+8*16] aesenc1 [rcx+9*16] aesenc1 [rcx+10*16] aesenc1 [rcx+11*16] aesenc1 [rcx+12*16] aesenc1 [rcx+13*16] aesenclast1 [rcx+14*16] movdqa xmm1,xmm0 ; Store output encrypted data into CIPHERTEXT array movdqu [r8+rdx-16], xmm0 dec eax jnz lp256encsingle_CBC mov r9,[r9+24] movdqu [r9],xmm1 add rsp,16*16+8 ret align 16 global iEnc192 iEnc192: linux_setup sub rsp,16*16+8 mov eax,[rcx+32] ; numblocks mov rdx,[rcx] mov r8,[rcx+8] mov rcx,[rcx+16] sub r8,rdx test eax,eax jz end_enc192 cmp eax,4 jl lp192encsingle test rcx,0xf jz lpenc192four copy_round_keys rsp,rcx,0 copy_round_keys rsp,rcx,1 copy_round_keys rsp,rcx,2 copy_round_keys rsp,rcx,3 copy_round_keys rsp,rcx,4 copy_round_keys rsp,rcx,5 copy_round_keys rsp,rcx,6 copy_round_keys rsp,rcx,7 copy_round_keys rsp,rcx,8 copy_round_keys rsp,rcx,9 copy_round_keys rsp,rcx,10 copy_round_keys rsp,rcx,11 copy_round_keys rsp,rcx,12 mov rcx,rsp align 16 lpenc192four: test eax,eax jz end_enc192 cmp eax,4 jl lp192encsingle load_and_xor4 rdx,[rcx+0*16] add rdx,4*16 aesenc4 [rcx+1*16] aesenc4 [rcx+2*16] aesenc4 [rcx+3*16] aesenc4 [rcx+4*16] aesenc4 [rcx+5*16] aesenc4 [rcx+6*16] aesenc4 [rcx+7*16] aesenc4 [rcx+8*16] aesenc4 [rcx+9*16] aesenc4 [rcx+10*16] aesenc4 [rcx+11*16] aesenclast4 [rcx+12*16] store4 r8+rdx-16*4 sub eax,4 jmp lpenc192four align 16 lp192encsingle: movdqu xmm0, [rdx] movdqu xmm4, [rcx+0*16] add rdx, 16 pxor xmm0, xmm4 aesenc1_u [rcx+1*16] aesenc1_u [rcx+2*16] aesenc1_u [rcx+3*16] aesenc1_u [rcx+4*16] aesenc1_u [rcx+5*16] aesenc1_u [rcx+6*16] aesenc1_u [rcx+7*16] aesenc1_u [rcx+8*16] aesenc1_u [rcx+9*16] aesenc1_u [rcx+10*16] aesenc1_u [rcx+11*16] aesenclast1_u [rcx+12*16] ; Store output encrypted data into CIPHERTEXT array movdqu [r8+rdx-16], xmm0 dec eax jnz lp192encsingle end_enc192: add rsp,16*16+8 ret align 16 global iEnc256 iEnc256: linux_setup sub rsp,16*16+8 mov eax,[rcx+32] ; numblocks mov rdx,[rcx] mov r8,[rcx+8] mov rcx,[rcx+16] sub r8,rdx test eax,eax jz end_enc256 cmp eax,4 jl lp256enc test rcx,0xf jz lp256enc4 copy_round_keys rsp,rcx,0 copy_round_keys rsp,rcx,1 copy_round_keys rsp,rcx,2 copy_round_keys rsp,rcx,3 copy_round_keys rsp,rcx,4 copy_round_keys rsp,rcx,5 copy_round_keys rsp,rcx,6 copy_round_keys rsp,rcx,7 copy_round_keys rsp,rcx,8 copy_round_keys rsp,rcx,9 copy_round_keys rsp,rcx,10 copy_round_keys rsp,rcx,11 copy_round_keys rsp,rcx,12 copy_round_keys rsp,rcx,13 copy_round_keys rsp,rcx,14 mov rcx,rsp align 16 lp256enc4: test eax,eax jz end_enc256 cmp eax,4 jl lp256enc load_and_xor4 rdx,[rcx+0*16] add rdx, 16*4 aesenc4 [rcx+1*16] aesenc4 [rcx+2*16] aesenc4 [rcx+3*16] aesenc4 [rcx+4*16] aesenc4 [rcx+5*16] aesenc4 [rcx+6*16] aesenc4 [rcx+7*16] aesenc4 [rcx+8*16] aesenc4 [rcx+9*16] aesenc4 [rcx+10*16] aesenc4 [rcx+11*16] aesenc4 [rcx+12*16] aesenc4 [rcx+13*16] aesenclast4 [rcx+14*16] store4 r8+rdx-16*4 sub eax,4 jmp lp256enc4 align 16 lp256enc: movdqu xmm0, [rdx] movdqu xmm4, [rcx+0*16] add rdx, 16 pxor xmm0, xmm4 aesenc1_u [rcx+1*16] aesenc1_u [rcx+2*16] aesenc1_u [rcx+3*16] aesenc1_u [rcx+4*16] aesenc1_u [rcx+5*16] aesenc1_u [rcx+6*16] aesenc1_u [rcx+7*16] aesenc1_u [rcx+8*16] aesenc1_u [rcx+9*16] aesenc1_u [rcx+10*16] aesenc1_u [rcx+11*16] aesenc1_u [rcx+12*16] aesenc1_u [rcx+13*16] aesenclast1_u [rcx+14*16] ; Store output encrypted data into CIPHERTEXT array movdqu [r8+rdx-16], xmm0 dec eax jnz lp256enc end_enc256: add rsp,16*16+8 ret
17.124148
94
0.702897
58806270c2e8979e079c24a4751e76b9e66be3fb
17,089
asm
Assembly
src/00/memory.asm
Willem3141/kernel
c7b72f75b78a9b23e66432801f8d8df1727637ed
[ "MIT" ]
null
null
null
src/00/memory.asm
Willem3141/kernel
c7b72f75b78a9b23e66432801f8d8df1727637ed
[ "MIT" ]
null
null
null
src/00/memory.asm
Willem3141/kernel
c7b72f75b78a9b23e66432801f8d8df1727637ed
[ "MIT" ]
null
null
null
; formatMem [System] ; Formats memory in preparation for memory allocation. ; Notes: ; This function will deallocate **all allocated memory**. formatMem: ld a, 0xFF ld (userMemory), a ld hl, (0x10000 - userMemory) - 5 ; Total RAM - Kernel RAM Size - Formatting Overhead + 1 ld (userMemory + 1), hl ld hl, userMemory ld (0xFFFE), hl ret ;; allocScreenBuffer [Display] ;; Allocates a 768-byte screen buffer. ;; Outputs: ;; IY: Screen buffer allocScreenBuffer: push bc push ix ld bc, 768 call malloc push ix \ pop iy pop ix pop bc ret ;; freeScreenBuffer [Display] ;; Deallocates a screen buffer allocated with [[allocScreenBuffer]] ;; Inputs: ;; IY: Screen buffer freeScreenBuffer: push ix push iy \ pop ix call free pop ix ret ;; reassignMemory [System] ;; Reassigns a given block of memory to the specified thread ID. ;; Inputs: ;; IX: Pointer to any location within the target block. ;; A: Thread ID for new owner reassignMemory: push ix ; TODO: Check if thread exists call memSeekToStart ld (ix + -3), a pop ix ret ;; calloc [System] ;; Allocates memory for a given number of elements ;; of a given size (that is, BC * A bytes total), ;; then fills it with zeros. ;; Inputs: ;; BC: Number of elements ;; A: Size of element ;; Outputs: ;; Z: Set on success, reset on failure ;; A: Error code (on failure) ;; IX: First byte of allocated and zeroed memory (on success) calloc: push af push bc push de push hl push af \ push bc \ pop de call mul16By8 push hl \ pop bc \ pop af call malloc jr nz, .fail xor a call memset pop hl pop de pop bc pop af cp a ret .fail: pop hl pop de pop bc inc sp \ inc sp ;pop af ret ;; memset [System] ;; Sets the value of an entire allocated section of memory. ;; Inputs: ;; A: Value to set ;; IX: Pointer to anywhere in allocated section memset: push ix push bc push hl push de call memSeekToStart push ix \ pop hl \ push ix \ pop de inc de ld (hl), a ld c, (IX + -2) \ ld b, (IX + -1) dec bc ldir pop de pop hl pop bc pop ix ret ;; memSeekToStart [System] ;; Move IX to the beginning of the memory section it points to. ;; Inputs: ;; IX: Pointer to anywhere in a section of allocated memory ;; Outputs: ;; IX: Pointer to first byte of section memSeekToStart: push hl push bc push de push ix \ pop de ld hl, userMemory .loop: inc hl ld c, (hl) inc hl ld b, (hl) inc hl add hl, bc jr c, _ call cpHLDE jr nc, ++_ inc hl \ inc hl jr .loop _: ld ix, 0 ; Error jr ++_ _: sbc hl, bc push hl \ pop ix _: pop de pop bc pop hl ret ;; memSeekToEnd [System] ;; Move IX to the end of the memory section it points to. ;; Inputs: ;; IX: Pointer to anywhere in a section of allocated memory ;; Outputs: ;; IX: Pointer to last byte of section memSeekToEnd: call memSeekToStart push hl push bc push ix \ pop hl dec hl \ ld b, (hl) dec hl \ ld c, (hl) inc hl \ add hl, bc push hl \ pop ix pop bc pop hl ret ;; memcheck [System] ;; Walks over memory and makes sure nothing has corrupted the allocation list. ;; Outputs: ;; Z: Set if OK, reset if broken ;; Notes: ;; A reboot is probably required if this returns NZ. memcheck: push af ld a, i push af di push hl push bc push de ld hl, userMemory .loop: push hl inc hl \ ld c, (hl) ; Size of this block into BC inc hl \ ld b, (hl) inc hl add hl, bc ; Move HL to block footer pop bc ld e, (hl) \ inc hl ld d, (hl) \ inc hl call cpBCDE jr nz, .fail ld a, h cp 0 jr nz, _ ld a, l cp 0 jr z, .done _: cp 0x80 jr c, .fail jr .loop .done: pop de pop bc pop hl pop af jp po, _ ei _: pop af cp a ret .fail: pop de pop bc pop hl pop af jp po, _ ei _: pop af or 1 ret ;; memoryAvailable [System] ;; Finds the amount of memory available for use. ;; Outputs: ;; BC: Total memory available ;; DE: Largest allocatable sum memoryAvailable: #define total_mem kernelGarbage #define max_alloc kernelGarbage + 2 push hl push af ld a, i push af di ld hl, 0 ld (total_mem), hl ld (max_alloc), hl ld hl, userMemory .loop: ld a, (hl) \ inc hl ; Owner ID to A ld c, (hl) \ inc hl ld b, (hl) \ inc hl ; Size to BC add hl, bc inc hl \ inc hl ; Move to next block cp 0xFF jr nz, .loop ; Free block push hl ld hl, (total_mem) add hl, bc ld (total_mem), hl ld hl, (max_alloc) or a ; reset c sbc hl, bc jr nc, _ ld h, b \ ld l, c ld (max_alloc), hl _: pop hl xor a cp h jr nz, .loop pop af jp po, _ ei _: pop af ld hl, (total_mem) ld b, h \ ld c, l ld hl, (max_alloc) ex de, hl pop hl ret #undefine total_mem #undefine max_alloc ;; malloc [System] ;; Allocates the specified amount of memory. ;; Inputs: ;; BC: Length of requested section, in bytes ;; Outputs: ;; Z: Set on success, reset on failure ;; A: Error code (on failure) ;; IX: First byte of allocated memory (on success) malloc: ; KnightOS uses a simple linked list for memory allocation. Memory starts of as one complete ; block of memory allocated to thread 0xFF (i.e. free), and each allocation divides this into ; more and more blocks. A block looks something like this: ; ; OO SSSS .... AAAA ; Where OO is the owner of this block, SSSS is the size of the block, and AAAA is the address ; of the header (starting at OO). push af ld a, i push af di push hl push de push bc ld d, b \ ld e, c ; Save desired size in DE ld hl, userMemory .identify_loop: ; Identify a block to use ld a, (hl) \ inc hl ld c, (hl) \ inc hl ld b, (hl) \ inc hl ; A: Block owner ; BC: Block length ; *HL: First byte of block ; .. ; Check if free cp 0xFF jr nz, .continue_loop ; Check if acceptable size call cpBCDE jr z, .allocate_this ; If exactly the right size jr c, .continue_loop ; If too small .allocate_this: dec hl \ dec hl \ dec hl jr .do_allocate .continue_loop: ; Continue to next block add hl, bc inc hl \ inc hl ; Check to see if HL rolled over xor a \ cp h jr nz, .identify_loop jp .out_of_memory .do_allocate: ; *HL: Header of block to use ; DE: Size of block to allocate call getCurrentThreadID ld (hl), a \ inc hl ; Set new owner ; Get the old size and write the new size ld c, (hl) \ ld (hl), e \ inc hl ld b, (hl) \ ld (hl), d \ inc hl call .pad_if_needed push hl \ pop ix ; IX to malloc return value push hl push de push de \ push bc \ pop hl \ pop bc or a ; Reset carry sbc hl, bc jr z, .exact_fit ld bc, 5 ; Overhead sbc hl, bc ld b, h \ ld c, l ; BC: Size of new free block pop de pop hl add hl, de ; HL to footer of new block push ix \ pop de dec de \ dec de \ dec de ; DE to header ld (hl), e \ inc hl ld (hl), d \ inc hl ; Fill in pointer to previous block push hl ld a, 0xFF ld (hl), a \ inc hl ; Mark next one as free ld (hl), c \ inc hl ld (hl), b \ inc hl ; Size of block add hl, bc ; Move to footer pop de ld (hl), e \ inc hl ld (hl), d ; Pointer to footer .finish: ; Note: Don't change this unless you also change realloc pop bc pop de pop hl pop af jp po, _ ei _: pop af cp a ret .exact_fit: ; We don't need to do anything else in this case pop de pop hl jr .finish .pad_if_needed: push bc push de ex de, hl push bc \ push hl \ pop bc \ pop hl sbc hl, bc jr z, .no_pad_exact ld bc, 5 sbc hl, bc jr z, .do_pad jr c, .do_pad .no_pad_exact: ex de, hl pop de pop bc ret .do_pad: ex de, hl pop de pop bc \ ld d, b \ ld e, c dec hl \ ld (hl), d \ dec hl \ ld (hl), e inc hl \ inc hl ret .out_of_memory: pop bc pop de pop hl pop af jp po, _ ei _: pop af or 1 ld a, errOutOfMem ret ;; free [System] ;; Frees a previously allocated section of memory ;; Inputs: ;; IX: Pointer to first byte of section free: ; Procedure: ; 1. Assign block to 0xFF ; 2. Check if next block is free - if so, merge ; 3. Check if previous block is free - if so, merge push af ld a, i push af di push bc push hl push de push ix .free_block: ld a, 0xFF ld (ix + -3), a ; Free block ld c, (ix + -2) ld b, (ix + -1) ; Size of block in BC .check_next_block: pop hl \ push hl ; IX into HL add hl, bc ; Note: We can check if HL == -2 here and if so, we can't merge forward (last block) inc hl \ inc hl ; HL to next block ld a, 0xFF cp (hl) jp z, .merge_forward_block .check_previous_block: pop hl \ push hl ; IX into HL dec hl \ dec hl \ dec hl ; Move to header ld bc, userMemory call cpHLBC ; If this is the first block, we can't merge backwards, so don't bother jr z, .cannot_merge_previous dec hl \ ld d, (hl) dec hl \ ld e, (hl) ex de, hl ld a, 0xFF cp (hl) jr nz, .cannot_merge_previous .merge_previous_block: ld c, (ix + -2) ld b, (ix + -1) ; Size of current block in BC inc hl \ ld e, (hl) inc hl \ ld d, (hl) ex de, hl add hl, bc ld bc, 5 add hl, bc ex de, hl ; Size of combined blocks in DE ld (hl), d \ dec hl ld (hl), e \ dec hl ; Update header ; Skip to footer ld b, h \ ld c, l ex de, hl add hl, bc inc hl \ inc hl \ inc hl ld (hl), e \ inc hl ; Write header address here ld (hl), d .cannot_merge_previous: pop ix pop de pop hl pop bc pop af jp po, _ ei _: pop af ret .merge_forward_block: ; Assumes IX is address of freed block ; Assumes HL points to forward block header ; Assumes BC is size of freed block inc hl \ ld e, (hl) inc hl \ ld d, (hl) ; DE is size of this block ex de, hl add hl, bc ld bc, 5 add hl, bc ex de, hl ; DE is combined size, update freed block ld (ix + -1), d ld (ix + -2), e pop hl \ push hl add hl, de ; Update footer to point to new header pop de \ push de ; Grab IX dec de \ dec de \ dec de ld (hl), e \ inc hl ld (hl), d ; Forward merge complete! jr .check_previous_block ;; realloc [System] ;; Reallocates a block of memory at a different size and returns a new pointer. ;; Inputs: ;; IX: Block to resize ;; BC: New size ;; Outputs: ;; IX: New memory ;; Z: Reset on failure, set on success ;; A: Preserved if success, error code if failure ;; Notes: ;; This function may have to move the memory that you've allocated. Consider the old pointer invalid and use ;; the one returned from realloc instead. realloc: push af ld a, i push af di push hl push de push bc xor a \ cp b \ jr nz, _ cp c \ jp z, .just_free_it ; Free if zero _: ld l, (ix + -2) ld h, (ix + -1) ; Check for what case we're handling or a sbc hl, bc jr z, .dont_resize jr c, .resize_grow .resize_shrink: ; BC is the leftover amount after we make it smaller ; If it's less than 5, don't bother because we'll get a dead spot xor a \ cp b jr nz, _ ld a, 5 \ cp c jr z, .dont_resize ; Okay, we're fine. Continue. push ix add ix, bc pop hl \ push hl dec hl \ dec hl \ dec hl ld (ix), l ld (ix + 1), h ld a, 0xFE ld (ix + 2), a ; Create to-be-freed block dec bc \ dec bc \ dec bc \ dec bc \ dec bc ld (ix + 3), c ; Size of free block ld (ix + 4), b ; Write free block footer push ix \ pop hl inc hl \ inc hl add ix, bc ; IX is now at footer-5 ld (ix + 5), l ld (ix + 6), h push hl \ pop ix ld bc, 3 \ add ix, bc ; Join newly created free block with adjacent blocks if possible ; NOTE: This calls free while the state of memory is _invalid_! call free pop ix pop bc ld (ix + -2), c ld (ix + -1), b ; Write new size of original block jr _ .dont_resize: ; Note: Don't change this unless you also change malloc pop bc _: pop de pop hl pop af jp po, _ ei _: pop af ret .just_free_it: pop bc pop de pop hl pop af jp po, _ ei _: pop af jp free .resize_grow: #define prev_block_ptr kernelGarbage #define next_block_ptr kernelGarbage + 2 ; First, we check to see if we can fit it by expanding into a free block ; to the left of this one, and potentially including the block to the right ; If so, we do just that. If not, we just malloc it elsewhere and copy it ; over, then free the original block. ld (prev_block_ptr), ix ld (next_block_ptr), ix ; In case can can't use them ld c, (ix + -2) ld b, (ix + -1) ; Set BC to current size call .add_next_block call .add_prev_block pop de \ push de ; BC is now the maximum potential size, DE is the desired size, see if it'll fit call cpBCDE jr c, .manual_realloc ; We can expand! ; The procedure is to use the previous block as the new one ; We'll change its size to the desired one, and move the contents of memory over ; But we'll leave it marked as "free" and then hand it over to malloc, and that's it! ld c, (ix + -2) ld b, (ix + -1) ; Set BC to current size push de ld hl, (prev_block_ptr) ex de, hl push ix \ pop hl call cpHLDE jr z, _ ; Skip memory move if we can't move backwards ldir jr ++_ _: pop de _: ld hl, (prev_block_ptr) jp do_allocate@malloc ; Hand it over to malloc to finish the job .manual_realloc: ; We can't expand into neighboring sections so we have to do a manual realloc/copy/free push ix \ pop hl ld c, (ix + -2) ld b, (ix + -1) ; Set BC to current size push ix push bc ld b, d \ ld c, e call malloc pop bc ldir push ix \ pop de pop ix call free push de \ pop ix jp .dont_resize ; (we're done) .add_next_block: push ix \ pop hl add hl, bc inc hl \ inc hl ld a, 0x80 cp h ret nc ; We went past the end of memory ld (next_block_ptr), hl ld a, (hl) cp 0xFF ret nz ; Not free inc hl ; HL points to size of next block ld e, (hl) \ inc hl ld d, (hl) \ ex de, hl add hl, bc ld b, h \ ld c, l inc bc \ inc bc \ inc bc \ inc bc \ inc bc ; Factor in removed headers ret .add_prev_block: push ix \ pop hl dec hl \ ld d, (hl) dec hl \ ld e, (hl) ; DE points to header of previous block ld a, 0x80 cp d ret nc ; We went past the start of memory ex de, hl ld (prev_block_ptr), hl ld a, (hl) cp 0xFF ret nz ; Not free inc hl ld e, (hl) \ inc hl ld d, (hl) \ ex de, hl add hl, de ld c, h \ ld b, l inc bc \ inc bc \ inc bc \ inc bc \ inc bc ; Factor in removed headers ret #undefine prev_block_ptr #undefine next_block_ptr
24.911079
109
0.531219
c04aab334af2d63a04602ccdc3053458be2df437
333
asm
Assembly
oeis/228/A228947.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/228/A228947.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/228/A228947.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A228947: a(n) = sigma(n) - phi(n) - n. ; Submitted by Jamie Morken(s2) ; -1,0,-1,1,-3,4,-5,3,-2,4,-9,12,-11,4,1,7,-15,15,-17,14,-1,4,-21,28,-14,4,-5,16,-27,34,-29,15,-5,4,-11,43,-35,4,-7,34,-39,42,-41,20,9,4,-45,60,-34,23,-11,22,-51,48,-23,40,-13,4,-57,92,-59 mov $2,$0 seq $0,51612 ; a(n) = sigma(n) - phi(n). add $2,1 sub $0,$2
37
188
0.531532
6be0794b194854ecae1628ca912dcc01fe3452b0
348
asm
Assembly
data/moves/assist_exception_moves.asm
AtmaBuster/pokeplat-gen2
fa83b2e75575949b8f72cb2c48f7a1042e97f70f
[ "blessing" ]
6
2021-06-19T06:41:19.000Z
2022-02-15T17:12:33.000Z
data/moves/assist_exception_moves.asm
AtmaBuster/pokeplat-gen2-old
01e42c55db5408d72d89133dc84a46c699d849ad
[ "blessing" ]
null
null
null
data/moves/assist_exception_moves.asm
AtmaBuster/pokeplat-gen2-old
01e42c55db5408d72d89133dc84a46c699d849ad
[ "blessing" ]
3
2021-01-15T18:45:40.000Z
2021-10-16T03:35:27.000Z
AssistExceptionMoves: dw ASSIST dw CHATTER dw COPYCAT dw COUNTER dw COVET dw DESTINY_BOND dw DETECT dw ENDURE dw FEINT dw FOCUS_PUNCH dw FOLLOW_ME dw HELPING_HAND dw ME_FIRST dw METRONOME dw MIMIC dw MIRROR_COAT dw MIRROR_MOVE dw PROTECT dw SKETCH dw SLEEP_TALK dw SNATCH dw STRUGGLE dw SWITCHEROO dw THIEF dw TRICK dw -1
12.428571
21
0.767241
ae004da47c26aa29f989db774993b4c65a9845f9
8,963
asm
Assembly
Manuals/HowToCode_source/startup.asm
jonathanbennett73/amiga-pjz-planet-disco-balls
1890f797ec7e8061ce4bfb9a8e6844f2ce9f6e1b
[ "MIT" ]
21
2021-04-04T06:00:44.000Z
2022-01-19T19:12:24.000Z
Manuals/HowToCode_source/startup.asm
jonathanbennett73/amiga-pjz-planet-disco-balls
1890f797ec7e8061ce4bfb9a8e6844f2ce9f6e1b
[ "MIT" ]
null
null
null
Manuals/HowToCode_source/startup.asm
jonathanbennett73/amiga-pjz-planet-disco-balls
1890f797ec7e8061ce4bfb9a8e6844f2ce9f6e1b
[ "MIT" ]
null
null
null
* Startup.asm - A working tested version of startup from Howtocode7 * * Written by CJ of SAE... Freeware. Share and Enjoy! * * This code sets up one of two copperlists (one for PAL and one for NTSC) * machines. It shows something to celebrate 3(?) years since the Berlin * wall came down :-) Press left mouse button to return to normality. * Tested on Amiga 3000 (ECS/V39 Kickstart) and Amiga 1200 (AGA/V39) * * $VER: startup.asm V7.tested (17.4.92) * Valid on day of purchase only. No re-admission. No rain-checks. * Now less bugs and more likely to work. * * Tested with Hisoft Devpac V3 and Argasm V1.09d * * Now added OS legal code to switch sprite resolutions. Ok, big deal * this 'demo' doesn't use any sprites. But that's the sort of effort I * go to on your behalf! - CJ opt l-,CHKIMM ; auto link, optimise on section mycode,code ; need not be in chipram incdir "include:" include "exec/types.i" include "exec/funcdef.i" ; keep code simple and include "exec/exec.i" ; the includes! include "libraries/dosextens.i" include "graphics/gfxbase.i" include "intuition/screens.i" include "graphics/videocontrol.i" include "howtocode:source/include/graphics_lib.i" ; Well done CBM! include "howtocode:source/include/exec_lib.i" ; They keep on include "howtocode:source/include/intuition_lib.i" ; forgetting these! include "howtocode:source/include/iconstartup.i" ; Allows startup from icon move.l 4.w,a6 sub.l a1,a1 ; Zero - Find current task jsr _LVOFindTask(a6) move.l d0,a1 moveq #127,d0 ; task priority to very high... jsr _LVOSetTaskPri(a6) move.l 4.w,a6 ; get ExecBase lea intname(pc),a1 ; moveq #39,d0 ; Kickstart 3.0 or higher jsr _LVOOpenLibrary(a6) move.l d0,_IntuitionBase ; store intuitionbase ; Note! if this fails then kickstart is <V39. move.l 4.w,a6 ; get ExecBase lea gfxname(pc),a1 ; graphics name moveq #33,d0 ; Kickstart 1.2 or higher jsr _LVOOpenLibrary(a6) tst.l d0 beq End ; failed to open? Then quit move.l d0,_GfxBase move.l d0,a6 move.l gb_ActiView(a6),wbview ; store current view address tst.l _IntuitionBase ; Intuition open? (V39 or higher) beq.s .skip bsr FixSpritesSetup ; fix V39 sprite bug... move.l _GfxBase,a6 .skip sub.l a1,a1 ; clear a1 jsr _LVOLoadView(a6) ; Flush View to nothing jsr _LVOWaitTOF(a6) ; Wait once jsr _LVOWaitTOF(a6) ; Wait again. ; Note: Something could come along inbetween the LoadView and ; your copper setup. But only if you decide to run something ; else after you start loading the demo. That's far to stupid ; to bother testing for in my opininon!!! If you want ; to stop this, then a Forbid() won't work (WaitTOF() disables ; Forbid state) so you'll have to do Forbid() *and* write your ; own WaitTOF() replacement. No thanks... I'll stick to running ; one demo at a time :-) move.l 4.w,a6 cmp.w #36,LIB_VERSION(a6) ; check for Kickstart 2 blt.s .oldks ; nope... ; kickstart 2 or higher.. We can check for NTSC properly... move.l _GfxBase,a6 btst #2,gb_DisplayFlags(a6) ; Check for PAL bne.s .pal bra.s .ntsc .oldks ; you really should upgrade! Check for V1.x kickstart move.l 4.w,a6 ; execbase cmp.b #50,VBlankFrequency(a6) ; Am I *running* PAL? bne.s .ntsc .pal move.l #mycopper,$dff080.L ; bang it straight in. bra.s .lp .ntsc move.l #mycopperntsc,$dff080.L .lp btst #6,$bfe001 ; ok.. I'll do an input bne.s .lp ; handler next time. CloseDown: tst.l _IntuitionBase ; Intuiton open? beq.s .sk ; if not, skip... bsr ReturnSpritesToNormal .sk move.l wbview(pc),a1 move.l _GfxBase,a6 jsr _LVOLoadView(a6) ; Fix view jsr _LVOWaitTOF(a6) jsr _LVOWaitTOF(a6) ; wait for LoadView() move.l gb_copinit(a6),$dff080.L ; Kick it into life move.l _IntuitionBase,a6 jsr _LVORethinkDisplay(a6) ; and rethink.... move.l _GfxBase,a1 move.l 4.w,a6 jsr _LVOCloseLibrary(a6) ; close graphics.library move.l _IntuitionBase,d0 beq.s End ; if not open, don't close! move.l d0,a1 jsr _LVOCloseLibrary(a6) End: moveq #0,d0 ; clear d0 for exit rts ; back to workbench/cli ; ; This bit fixes problems with sprites in V39 kickstart ; it is only called if intuition.library opens, which in this ; case is only if V39 or higher kickstart is installed. If you ; require intuition.library you will need to change the ; openlibrary code to open V33+ Intuition and add a V39 test before ; calling this code (which is only required for V39+ Kickstart) ; FixSpritesSetup: move.l _IntuitionBase,a6 ; open intuition.library first! lea wbname,a0 jsr _LVOLockPubScreen(a6) tst.l d0 ; Could I lock Workbench? beq.s .error ; if not, error move.l d0,wbscreen move.l d0,a0 move.l sc_ViewPort+vp_ColorMap(a0),a0 lea taglist,a1 move.l _GfxBase,a6 ; open graphics.library first! jsr _LVOVideoControl(a6) ; move.l resolution,oldres ; store old resolution move.l #SPRITERESN_140NS,resolution move.l #VTAG_SPRITERESN_SET,taglist move.l wbscreen,a0 move.l sc_ViewPort+vp_ColorMap(a0),a0 lea taglist,a1 jsr _LVOVideoControl(a6) ; set sprites to lores move.l wbscreen,a0 move.l _IntuitionBase,a6 jsr _LVOMakeScreen(a6) jsr _LVORethinkDisplay(a6) ; and rebuild system copperlists ; Sprites are now set back to 140ns in a system friendly manner! .error rts ReturnSpritesToNormal: ; If you mess with sprite resolution you must return resolution ; back to workbench standard on return! This code will do that... move.l wbscreen,d0 beq.s .error move.l d0,a0 move.l oldres,resolution ; change taglist lea taglist,a1 move.l sc_ViewPort+vp_ColorMap(a0),a0 move.l _GfxBase,a6 jsr _LVOVideoControl(a6) ; return sprites to normal. move.l _IntuitionBase,a6 move.l wbscreen,a0 jsr _LVOMakeScreen(a6) ; and rebuild screen move.l wbscreen,a1 sub.l a0,a0 jsr _LVOUnlockPubScreen(a6) .error rts wbview dc.l 0 _GfxBase dc.l 0 _IntuitionBase dc.l 0 oldres dc.l 0 wbscreen dc.l 0 taglist dc.l VTAG_SPRITERESN_GET resolution dc.l SPRITERESN_ECS dc.l TAG_DONE,0 wbname dc.b "Workbench",0 gfxname dc.b "graphics.library",0 intname dc.b "intuition.library",0 section mydata,data_c ; keep data & code seperate! mycopper dc.w $100,$0200 ; otherwise no display! dc.w $180,$00 dc.w $8107,$fffe ; wait for $8107,$fffe dc.w $180 co dc.w $f0f ; background red dc.w $d607,$fffe ; wait for $d607,$fffe dc.w $180,$ff0 ; background yellow dc.w $ffff,$fffe dc.w $ffff,$fffe mycopperntsc dc.w $100,$0200 ; otherwise no display! dc.w $180,$00 dc.w $6e07,$fffe ; wait for $6e07,$fffe dc.w $180,$f00 ; background red dc.w $b007,$fffe ; wait for $b007,$fffe dc.w $180,$ff0 ; background yellow dc.w $ffff,$fffe dc.w $ffff,$fffe end
35.011719
88
0.536204
992d19898d0ff583929d2caf3d81691ce4863db2
4,943
asm
Assembly
Transynther/x86/_processed/AVXALIGN/_ht_zr_/i9-9900K_12_0xca_notsx.log_21829_667.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/AVXALIGN/_ht_zr_/i9-9900K_12_0xca_notsx.log_21829_667.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/AVXALIGN/_ht_zr_/i9-9900K_12_0xca_notsx.log_21829_667.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r12 push %r14 push %r15 push %r9 push %rbx push %rdx push %rsi lea addresses_A_ht+0x15fa0, %rsi nop cmp %r12, %r12 vmovups (%rsi), %ymm3 vextracti128 $1, %ymm3, %xmm3 vpextrq $0, %xmm3, %r14 nop nop nop nop xor %rdx, %rdx lea addresses_D_ht+0x140a0, %r15 xor %rbx, %rbx mov $0x6162636465666768, %rdx movq %rdx, %xmm3 movups %xmm3, (%r15) xor %rsi, %rsi lea addresses_WC_ht+0xb710, %r12 nop nop nop nop nop dec %r9 mov (%r12), %r14w nop nop nop and $59246, %r9 lea addresses_WT_ht+0x1c720, %r12 nop cmp %rbx, %rbx mov $0x6162636465666768, %rdx movq %rdx, %xmm2 movups %xmm2, (%r12) sub %rbx, %rbx pop %rsi pop %rdx pop %rbx pop %r9 pop %r15 pop %r14 pop %r12 ret .global s_faulty_load s_faulty_load: push %r10 push %rax push %rbp push %rbx push %rdx push %rsi // Faulty Load mov $0x70cf5a00000006a0, %r10 nop nop nop nop nop sub $50879, %rsi vmovntdqa (%r10), %ymm7 vextracti128 $1, %ymm7, %xmm7 vpextrq $1, %xmm7, %rdx lea oracles, %rax and $0xff, %rdx shlq $12, %rdx mov (%rax,%rdx,1), %rdx pop %rsi pop %rdx pop %rbx pop %rbp pop %rax pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_NC', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_NC', 'NT': True, 'AVXalign': False, 'size': 32, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 4}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 7}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 4}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 7}} {'00': 6399, '45': 15430} 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 00 45 45 45 45 45 45 45 45 45 45 45 45 45 00 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 45 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 00 00 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 00 00 00 00 00 00 00 00 00 00 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 00 00 00 00 45 45 45 45 45 45 45 45 45 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 45 00 00 00 00 00 00 00 00 00 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 00 00 00 00 00 00 00 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 45 00 00 00 00 00 00 00 00 00 00 00 00 00 45 45 45 45 45 00 00 00 00 00 00 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 00 00 00 00 00 00 00 45 45 45 45 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 45 45 45 45 45 45 45 45 45 45 45 45 */
48.940594
2,999
0.660125
df7c805e3680d56fabf2b41edca917001d553311
5,875
asm
Assembly
Transynther/x86/_processed/AVXALIGN/_st_/i7-7700_9_0xca.log_21829_607.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/AVXALIGN/_st_/i7-7700_9_0xca.log_21829_607.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/AVXALIGN/_st_/i7-7700_9_0xca.log_21829_607.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r13 push %r15 push %r8 push %rbx push %rcx push %rdi push %rsi lea addresses_WC_ht+0x1de21, %rsi lea addresses_WT_ht+0x65f, %rdi inc %r15 mov $122, %rcx rep movsl dec %r8 lea addresses_A_ht+0xe1a9, %rbx nop nop nop nop nop xor $15784, %r15 movups (%rbx), %xmm1 vpextrq $0, %xmm1, %rdi cmp $50904, %rsi lea addresses_A_ht+0xf039, %rdi nop nop nop nop xor %r13, %r13 mov (%rdi), %cx nop add %rsi, %rsi pop %rsi pop %rdi pop %rcx pop %rbx pop %r8 pop %r15 pop %r13 ret .global s_faulty_load s_faulty_load: push %r10 push %r8 push %rax push %rbp push %rbx push %rdx push %rsi // Store lea addresses_US+0x1b539, %rbx nop sub $39811, %rsi mov $0x5152535455565758, %r10 movq %r10, %xmm3 movups %xmm3, (%rbx) and %rbp, %rbp // Store mov $0x19b9b0000000039, %rbp nop and $16427, %r8 movl $0x51525354, (%rbp) nop nop nop nop nop sub $17207, %rbp // Store lea addresses_A+0x8339, %r10 nop nop nop add $64537, %rsi movw $0x5152, (%r10) nop nop nop nop cmp $54440, %r10 // Store lea addresses_PSE+0x2879, %rdx nop nop and $33235, %rax movl $0x51525354, (%rdx) nop nop nop nop nop xor $10878, %rbx // Store lea addresses_US+0xa737, %rbp nop nop nop nop xor $36949, %rbx movb $0x51, (%rbp) // Exception!!! nop nop nop mov (0), %rbp nop nop nop nop nop inc %rsi // Faulty Load lea addresses_normal+0xc39, %r10 nop nop sub $48560, %rbx mov (%r10), %ax lea oracles, %rdx and $0xff, %rax shlq $12, %rax mov (%rdx,%rax,1), %rax pop %rsi pop %rdx pop %rbx pop %rbp pop %rax pop %r8 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_normal'}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'congruent': 7, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_US'}} {'OP': 'STOR', 'dst': {'congruent': 10, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_NC'}} {'OP': 'STOR', 'dst': {'congruent': 8, 'AVXalign': True, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_A'}} {'OP': 'STOR', 'dst': {'congruent': 2, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_PSE'}} {'OP': 'STOR', 'dst': {'congruent': 1, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_US'}} [Faulty Load] {'src': {'congruent': 0, 'AVXalign': True, 'same': True, 'size': 2, 'NT': False, 'type': 'addresses_normal'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'congruent': 0, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 0, 'same': False, 'type': 'addresses_WT_ht'}} {'src': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 9, 'AVXalign': False, 'same': False, 'size': 2, 'NT': True, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'} {'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 */
36.949686
2,999
0.654298
5f86655cab1e6ac1d9a9d928cf346c83140d7d6e
3,966
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca.log_5_565.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_5_565.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_5_565.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 %r15 push %r8 push %r9 push %rcx push %rdi push %rdx push %rsi lea addresses_WT_ht+0xc3cd, %r12 nop nop inc %r9 mov $0x6162636465666768, %r8 movq %r8, (%r12) nop nop dec %r11 lea addresses_WC_ht+0xa21, %r12 nop nop nop nop sub %rdi, %rdi mov $0x6162636465666768, %r9 movq %r9, (%r12) nop and $21476, %r11 lea addresses_UC_ht+0x14071, %rdx clflush (%rdx) nop and $17236, %r15 mov $0x6162636465666768, %r12 movq %r12, %xmm3 movups %xmm3, (%rdx) and $48250, %r12 lea addresses_A_ht+0x131, %rsi lea addresses_normal_ht+0x16511, %rdi nop nop nop xor $39154, %r11 mov $71, %rcx rep movsw nop nop nop inc %rcx lea addresses_normal_ht+0x89e9, %rdx xor %rsi, %rsi movl $0x61626364, (%rdx) nop nop nop nop nop cmp %rsi, %rsi lea addresses_WT_ht+0xb8b9, %rcx nop nop nop and %r12, %r12 movb $0x61, (%rcx) nop nop cmp %r8, %r8 lea addresses_UC_ht+0x1a6c1, %rsi nop nop nop nop and $58964, %r9 movb $0x61, (%rsi) nop nop nop nop nop add %rsi, %rsi lea addresses_normal_ht+0x17531, %rsi lea addresses_A_ht+0xe1f1, %rdi clflush (%rdi) cmp %r11, %r11 mov $40, %rcx rep movsw nop nop nop nop and %rdx, %rdx lea addresses_WT_ht+0x1ee8b, %rdx nop and %rsi, %rsi movw $0x6162, (%rdx) nop add %r8, %r8 pop %rsi pop %rdx pop %rdi pop %rcx pop %r9 pop %r8 pop %r15 pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r14 push %r15 push %r8 push %rbp push %rbx push %rcx push %rsi // Store lea addresses_US+0x188d1, %rbp lfence mov $0x5152535455565758, %rsi movq %rsi, %xmm2 vmovups %ymm2, (%rbp) and $40438, %r8 // Store mov $0xdb1, %rcx add %r15, %r15 movw $0x5152, (%rcx) nop nop nop nop dec %rbp // Store lea addresses_WT+0xcd15, %rcx and %r8, %r8 mov $0x5152535455565758, %r14 movq %r14, %xmm4 and $0xffffffffffffffc0, %rcx vmovntdq %ymm4, (%rcx) nop nop nop nop nop sub $23089, %rbp // Faulty Load lea addresses_D+0x1aa71, %rcx nop nop nop add %rsi, %rsi mov (%rcx), %r15 lea oracles, %rbx and $0xff, %r15 shlq $12, %r15 mov (%rbx,%r15,1), %r15 pop %rsi pop %rcx pop %rbx pop %rbp pop %r8 pop %r15 pop %r14 ret /* <gen_faulty_load> [REF] {'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 16, 'NT': True, 'type': 'addresses_D'}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_US'}} {'OP': 'STOR', 'dst': {'congruent': 6, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_P'}} {'OP': 'STOR', 'dst': {'congruent': 2, 'AVXalign': False, 'same': False, 'size': 32, 'NT': True, 'type': 'addresses_WT'}} [Faulty Load] {'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 8, 'NT': False, 'type': 'addresses_D'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_WT_ht'}} {'OP': 'STOR', 'dst': {'congruent': 4, 'AVXalign': True, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_WC_ht'}} {'OP': 'STOR', 'dst': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_UC_ht'}} {'src': {'congruent': 6, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'congruent': 4, 'same': False, 'type': 'addresses_normal_ht'}} {'OP': 'STOR', 'dst': {'congruent': 2, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_normal_ht'}} {'OP': 'STOR', 'dst': {'congruent': 3, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_WT_ht'}} {'OP': 'STOR', 'dst': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_UC_ht'}} {'src': {'congruent': 6, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'congruent': 6, 'same': False, 'type': 'addresses_A_ht'}} {'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_WT_ht'}} {'36': 5} 36 36 36 36 36 */
20.443299
151
0.648008
451b5b01ef40cd436e3081df7c45a7c7b0746ccb
1,104
asm
Assembly
programs/oeis/180/A180033.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/180/A180033.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/180/A180033.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A180033: Eight white queens and one red queen on a 3 X 3 chessboard. G.f.: (1 + x)/(1 - 5*x - 5*x^2). ; 1,6,35,205,1200,7025,41125,240750,1409375,8250625,48300000,282753125,1655265625,9690093750,56726796875,332084453125,1944056250000,11380703515625,66623798828125,390022511718750,2283231552734375,13366270322265625,78247509375000000,458068898486328125,2681582039306640625,15698254688964843750,91899183641357421875,537987191651611328125,3149431876464843750000,18437095340582275390625,107932636085235595703125,631848657129089355468750,3698906466071624755859375,21653775616003570556640625,126763410410375976562500000,742085930131897735595703125,4344246702711368560791015625,25431663164216331481933593750,148879549334638500213623046875,871556062494274158477783203125,5102178059144563293457031250000,29868670608194187259674072265625,174854243336693752765655517578125,1023614569724439700126647949218750,5992344065305667264461517333984375,35079793175150534822940826416015625,205360686202281010437011718750000000 add $0,2 seq $0,106565 ; Let M={{0, 5}, {1, 5}}, v[n]=M.v[n-1]; then a(n) =v[n][[1]]. div $0,25
157.714286
902
0.870471
c08d583c9bbbffc8bd53d9636b820052c05d785f
251
asm
Assembly
libsrc/_DEVELOPMENT/adt/b_array/c/sdcc_iy/b_array_resize_callee.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/_DEVELOPMENT/adt/b_array/c/sdcc_iy/b_array_resize_callee.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/_DEVELOPMENT/adt/b_array/c/sdcc_iy/b_array_resize_callee.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
; int b_array_resize_callee(b_array_t *a, size_t n) SECTION code_clib SECTION code_adt_b_array PUBLIC _b_array_resize_callee EXTERN asm_b_array_resize _b_array_resize_callee: pop af pop hl pop de push af jp asm_b_array_resize
13.210526
51
0.776892
1ba5f3f466d15c54bbac135d1d95d050ad627078
7,981
asm
Assembly
src/mathlib.asm
secworks/prince_6502
d071838963cdd3891bcde1f96b692810ad26703d
[ "BSD-2-Clause" ]
null
null
null
src/mathlib.asm
secworks/prince_6502
d071838963cdd3891bcde1f96b692810ad26703d
[ "BSD-2-Clause" ]
null
null
null
src/mathlib.asm
secworks/prince_6502
d071838963cdd3891bcde1f96b692810ad26703d
[ "BSD-2-Clause" ]
null
null
null
//====================================================================== // // mathlib.asm // ----------- // Library providing 32- and 64-bit integer operations as needed // by PRINCE, SipHash etc. // // // Copyright (c) 2020, Assured AB // All rights reserved. // // Redistribution and use in source and binary forms, with or // without modification, are permitted provided that the following // conditions are met: // // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in // the documentation and/or other materials provided with the // distribution. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE // COPYRIGHT 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. // //====================================================================== #importonce //------------------------------------------------------------------ // rol64bits(addr, bits) // // Macro to rotate 64 bit word, bits number of steps. // //------------------------------------------------------------------ .macro rol64bits(addr, bits) { ldy #bits rol64_1: lda addr rol rol addr + 7 rol addr + 6 rol addr + 5 rol addr + 4 rol addr + 3 rol addr + 2 rol addr + 1 rol addr dey bne rol64_1 } //------------------------------------------------------------------ // ror64bits(addr, bits) // // Macro to rotate a 64 bit word, bits number of steps right. //------------------------------------------------------------------ .macro ror64bits(addr, bits) { ldy #bits ror64_1: lda addr + 7 ror ror addr ror addr + 1 ror addr + 2 ror addr + 3 ror addr + 4 ror addr + 5 ror addr + 6 ror addr + 7 dey bne ror64_1 } //------------------------------------------------------------------ // rol13(addr) // // Macro to rotate a 64 bit word, 13 bits left. // We do this by moving 16 bits left and then 3 bits right. // TODO: Implement. //------------------------------------------------------------------ .macro rol13(addr) { :rol16(addr) :ror64bits(addr, 3) } //------------------------------------------------------------------ // rol16(addr) // // Macro to rotate a 64 bit word, 16 bits left. // We do this by moving the bytes two steps. //------------------------------------------------------------------ .macro rol16(addr) { lda addr sta tmp lda addr + 1 sta tmp + 1 ldx #$00 rol16_1: lda addr + 2, x sta addr, x inx cpx #$07 bne rol16_1 lda tmp sta addr + 6 lda tmp + 1 sta addr + 7 } //------------------------------------------------------------------ // rol17(addr) // // Macro to rotate a 64 bit word, 17 bits left. // We do this by moving 2 bytes left and then rotating 1 bit left. //------------------------------------------------------------------ .macro rol17(addr) { :rol16(addr) :rol64bits(addr, 1) } //------------------------------------------------------------------ // rol21(addr) // // Macro to rotate a 64 bit word, 21 bits left. // We do this by moving 3 bytes left and rotating 3 bits right. //------------------------------------------------------------------ .macro rol21(addr) { // Move three bytes left. // Using tmp ldx #$02 rol21_1: lda addr, x sta tmp, x dex bpl rol21_1 ldx #$00 rol21_2: lda addr + 3, x sta addr,x inx cpx #$07 bne rol21_2 ldx #$02 rol21_3: lda tmp, x sta addr + 5, x dex bpl rol21_3 :ror64bits(addr, 3) } //------------------------------------------------------------------ // rol32(addr) // // Macro to rotate a 64 bit word, 32 bits left. // We do this by moving 32 bits left via the temp bytes. //------------------------------------------------------------------ .macro rol32(addr) { ldx #$03 rol32_1: lda addr, x sta tmp, x lda addr+4, x sta addr, x lda tmp, x sta addr + 4, x dex bpl rol32_1 } //------------------------------------------------------------------ // xor64(addr0, addr1) // // Macro to rotate 64 bit word bits number of steps. //------------------------------------------------------------------ .macro xor64(addr0, addr1) { ldx #$07 xor64_1: lda addr0, x eor addr1, x sta addr0, x dex bpl xor64_1 } //------------------------------------------------------------------ // add64(addr0, addr1) // // Macro to add two 64 bit words. Results in addr0. //------------------------------------------------------------------ .macro add64(addr0, addr1) { ldx #$07 clc add64_1: lda addr0, x adc addr1, x sta addr0, x dex bpl add64_1 } //------------------------------------------------------------------ // mov64(addr0, addr1) // // Macro to move 64 bit word in addr1 into addr0 //------------------------------------------------------------------ .macro mov64(addr0, addr1) { ldx #$07 clc mov64_1: lda addr1, x sta addr0, x dex bpl mov64_1 } //====================================================================== // EOF mathlib.asm //======================================================================
33.675105
73
0.348578
004cf631175eed0d9bbf393e3a95fbf85cba6bfa
2,932
asm
Assembly
original/19 - Tutorial Nineteen.asm
rodoherty1/6502-Examples
86db5035a324ef161327f28452ba625d43668924
[ "MIT" ]
null
null
null
original/19 - Tutorial Nineteen.asm
rodoherty1/6502-Examples
86db5035a324ef161327f28452ba625d43668924
[ "MIT" ]
null
null
null
original/19 - Tutorial Nineteen.asm
rodoherty1/6502-Examples
86db5035a324ef161327f28452ba625d43668924
[ "MIT" ]
null
null
null
;******************************************************************************* ;* Tutorial Nineteen Output to a device using Kernel Jump Vectors * ;* * ;* Written By John C. Dale * ;* Tutorial #19 * ;* Date : 22nd Aug, 2017 * ;* * ;******************************************************************************* ;* * ;******************************************************************************* ;******************************************************************************* ;* Kernel Vector Constants * ;******************************************************************************* CHROUT = $FFD2 CHKOUT = $FFC9 OPEN = $FFC0 SETLFS = $FFBA SETNAM = $FFBD CLRCHN = $FFCC CLOSE = $FFC3 PRINTSTRING = $AB1E *=$9000 ;jmp PRINTTODEFAULT ;jmp PRINTTOPRINTER ;jmp PRINTTOTAPE ;jmp PRINTTODISK TESTFILENAME TEXT "johntest" BRK TESTFILENAMEDISK TEXT "johntest,seq,write" BRK TESTTEXT TEXT "this is to test the output jump vectors" BRK PRINTTODEFAULT ldx #$00 lda #<TESTTEXT ldy #>TESTTEXT jsr PRINTSTRING rts PRINTTOPRINTER lda #4 ; Logical File Number tax ; Device Number (Printer Device #4) ldy #255 ; Secondary Address jsr SETLFS lda #0 ldx #255 ldy #255 jsr SETNAM jsr OPEN ldx #4 ; Logical File Number jsr CHKOUT jsr PRINTTODEFAULT ;ldx #$00 ;lda #<TESTTEXT ;ldy #>TESTTEXT ;jsr PRINTSTRING jsr CLRCHN lda #4 ; Logical File Number jsr CLOSE rts PRINTTOTAPE lda #1 ; Logical File Number tax ; Device Number (Tape Device #1) ldy #255 ; Secondary Address jsr SETLFS lda #8 ldx #<TESTFILENAME ldy #>TESTFILENAME jsr SETNAM jsr OPEN ldx #1 ; Logical File Number jsr CHKOUT jsr PRINTTODEFAULT ;ldx #$00 ;lda #<TESTTEXT ;ldy #>TESTTEXT ;jsr PRINTSTRING jsr CLRCHN lda #1 ; Logical File Number jsr CLOSE RTS PRINTTODISK lda #8 ; Logical File Number tax ; Device Number (Disk Drive 8) ldy #2 ; Secondary Address jsr SETLFS lda #18 ldx #<TESTFILENAMEDISK ldy #>TESTFILENAMEDISK jsr SETNAM jsr OPEN ldx #8 ; Logical File Number jsr CHKOUT jsr PRINTTODEFAULT ;ldx #$00 ;lda #<TESTTEXT ;ldy #>TESTTEXT ;jsr PRINTSTRING jsr CLRCHN lda #8 ; Logical File Number jsr CLOSE RTS
25.275862
80
0.420873
0070a39dfe883e54fc7a6934661a13e9c6b4b519
588
asm
Assembly
oeis/102/A102147.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/102/A102147.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/102/A102147.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A102147: Second Eulerian transform of 1, 2, 3, 4, 5, ... (A000027). ; Submitted by Jamie Morken(s3) ; 1,1,5,35,315,3465,45045,675675,11486475,218243025,4583103525,105411381075,2635284526875,71152682225625,2063427784543125,63966261320836875,2110886623587616875,73881031825566590625 lpb $0 mov $0,$2 seq $0,10225 ; Continued fraction for sqrt(183). seq $0,203016 ; Numbers congruent to {1, 2, 3, 4} mod 6, multiplied by 3. div $0,3 sub $0,1 mul $0,2 lpe add $0,1 seq $0,1147 ; Double factorial of odd numbers: a(n) = (2*n-1)!! = 1*3*5*...*(2*n-1). div $0,6 mul $0,2 add $0,1
32.666667
180
0.692177
c74ff85335a2c354a7d074d090062cbb7f92c670
4,592
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_1_1666.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_1_1666.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_1_1666.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r13 push %r14 push %rax push %rbx push %rcx push %rdi push %rsi lea addresses_D_ht+0x1961e, %rax nop sub %r13, %r13 mov $0x6162636465666768, %r14 movq %r14, %xmm1 vmovups %ymm1, (%rax) nop nop nop nop cmp $22428, %rbx lea addresses_UC_ht+0x8e1e, %rbx nop nop nop nop xor $49539, %r11 movb (%rbx), %r10b sub %r10, %r10 lea addresses_D_ht+0x1491e, %r14 nop sub %r11, %r11 vmovups (%r14), %ymm4 vextracti128 $0, %ymm4, %xmm4 vpextrq $0, %xmm4, %rdi nop nop nop inc %r13 lea addresses_WC_ht+0x88ee, %rbx nop nop sub %rax, %rax mov $0x6162636465666768, %r13 movq %r13, %xmm7 and $0xffffffffffffffc0, %rbx movntdq %xmm7, (%rbx) add $24751, %r10 lea addresses_WC_ht+0x1131e, %r11 nop nop nop nop nop inc %rax mov (%r11), %r10w nop nop nop xor %r11, %r11 lea addresses_UC_ht+0x1cc1e, %rbx nop nop sub %r10, %r10 mov $0x6162636465666768, %r14 movq %r14, (%rbx) cmp $25729, %rax lea addresses_D_ht+0xb26, %rsi lea addresses_D_ht+0x45fe, %rdi clflush (%rsi) nop nop nop nop nop sub $61378, %r10 mov $9, %rcx rep movsl nop nop nop and $40216, %r14 lea addresses_UC_ht+0xda1e, %rsi lea addresses_A_ht+0x1f1e, %rdi nop nop nop nop and $43181, %rbx mov $5, %rcx rep movsq nop nop nop nop sub $51086, %rsi lea addresses_D_ht+0x1383e, %r14 nop nop nop nop dec %rsi mov $0x6162636465666768, %r10 movq %r10, %xmm0 vmovups %ymm0, (%r14) nop nop nop nop inc %rsi lea addresses_WC_ht+0xd61e, %rbx nop nop nop nop nop xor $63598, %r13 movb $0x61, (%rbx) nop nop and %rbx, %rbx lea addresses_normal_ht+0x640e, %r10 nop nop inc %rdi vmovups (%r10), %ymm1 vextracti128 $0, %ymm1, %xmm1 vpextrq $0, %xmm1, %r13 nop nop nop nop xor %rbx, %rbx lea addresses_A_ht+0x8b7a, %rax nop nop add %rdi, %rdi mov $0x6162636465666768, %r13 movq %r13, %xmm5 vmovups %ymm5, (%rax) nop nop and %r10, %r10 lea addresses_UC_ht+0x167de, %r13 nop nop nop nop inc %rax movb $0x61, (%r13) nop nop nop nop add $52293, %r13 pop %rsi pop %rdi pop %rcx pop %rbx pop %rax pop %r14 pop %r13 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %r14 push %r8 push %r9 push %rax push %rdi push %rsi // Store mov $0x41e, %rax clflush (%rax) nop nop nop nop add %rdi, %rdi movl $0x51525354, (%rax) nop sub $45308, %r14 // Faulty Load lea addresses_RW+0xe1e, %r11 add $37342, %r8 mov (%r11), %di lea oracles, %r11 and $0xff, %rdi shlq $12, %rdi mov (%r11,%rdi,1), %rdi pop %rsi pop %rdi pop %rax pop %r9 pop %r8 pop %r14 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_P', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 16, 'AVXalign': False, 'NT': True, 'congruent': 4, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 2, 'same': True}, 'dst': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 7, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}} {'32': 1} 32 */
19.878788
147
0.650044
06ada009b74db7aa3589ebf052e42f509872ea38
284
asm
Assembly
libsrc/_DEVELOPMENT/math/float/math48/c/sccz80/cm48_sccz80_isgreaterequal.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/_DEVELOPMENT/math/float/math48/c/sccz80/cm48_sccz80_isgreaterequal.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/_DEVELOPMENT/math/float/math48/c/sccz80/cm48_sccz80_isgreaterequal.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
; int isgreaterequal(double x, double y) SECTION code_clib SECTION code_fp_math48 PUBLIC cm48_sccz80_isgreaterequal EXTERN am48_isgreaterequal, cm48_sccz80p_dread2 cm48_sccz80_isgreaterequal: call cm48_sccz80p_dread2 ; AC'= y ; AC = x jp am48_isgreaterequal
14.947368
47
0.774648
dde6353055b6e94da742c1ff39b26e59f0196c3b
172
asm
Assembly
MPI/Lab-3/indirect_register_5_problem.asm
vishwas1101/Misc
cf660dfbacc674cd262eb4abd0e9dd07479a90ae
[ "MIT" ]
null
null
null
MPI/Lab-3/indirect_register_5_problem.asm
vishwas1101/Misc
cf660dfbacc674cd262eb4abd0e9dd07479a90ae
[ "MIT" ]
null
null
null
MPI/Lab-3/indirect_register_5_problem.asm
vishwas1101/Misc
cf660dfbacc674cd262eb4abd0e9dd07479a90ae
[ "MIT" ]
null
null
null
org 100h ; Register indexed addressing mode MOV AX, 3000H MOV DS, AX MOV AH, 78H MOV BX, 1234H MOV [BX + 0012H], AH ; address = 30000H + 1246H contains 78H ret
8.190476
39
0.668605
cd16486b0d23c5d66dba1fd80e9734e36a90ac36
864
asm
Assembly
oeis/293/A293579.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/293/A293579.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/293/A293579.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A293579: Number of compositions of n where each part i is marked with a word of length i over a binary alphabet whose letters appear in alphabetical order and both letters occur at least once in the composition. ; Submitted by Jamie Morken(s2) ; 3,16,66,248,892,3136,10888,37536,128880,441472,1510176,5161856,17635264,60233728,205697152,702386688,2398283520,8188622848,27958448640,95457597440,325915589632,1112751357952,3799182641152,12971244625920,44286646775808,151204164960256,516243500507136,1762565940543488,6017777298030592,20545978384777216,70148361090531328,239501491887538176,817709253959024640,2791834049240891392,9531917723405254656,32544002863858712576,111112176146063294464,379360699131413659648,1295218444783283863552 add $0,2 lpb $0 sub $0,1 mul $1,2 mul $2,2 add $1,$2 add $3,1 add $2,$3 add $3,$2 lpe add $1,$2 mov $0,$1 div $0,2
48
487
0.815972
cb422b1f8d2d94c7820c559615ba4fff6d89bdec
1,418
asm
Assembly
programs/oeis/241/A241748.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/241/A241748.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/241/A241748.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A241748: a(n) = n^2 + 12. ; 12,13,16,21,28,37,48,61,76,93,112,133,156,181,208,237,268,301,336,373,412,453,496,541,588,637,688,741,796,853,912,973,1036,1101,1168,1237,1308,1381,1456,1533,1612,1693,1776,1861,1948,2037,2128,2221,2316,2413,2512,2613,2716,2821,2928,3037,3148,3261,3376,3493,3612,3733,3856,3981,4108,4237,4368,4501,4636,4773,4912,5053,5196,5341,5488,5637,5788,5941,6096,6253,6412,6573,6736,6901,7068,7237,7408,7581,7756,7933,8112,8293,8476,8661,8848,9037,9228,9421,9616,9813,10012,10213,10416,10621,10828,11037,11248,11461,11676,11893,12112,12333,12556,12781,13008,13237,13468,13701,13936,14173,14412,14653,14896,15141,15388,15637,15888,16141,16396,16653,16912,17173,17436,17701,17968,18237,18508,18781,19056,19333,19612,19893,20176,20461,20748,21037,21328,21621,21916,22213,22512,22813,23116,23421,23728,24037,24348,24661,24976,25293,25612,25933,26256,26581,26908,27237,27568,27901,28236,28573,28912,29253,29596,29941,30288,30637,30988,31341,31696,32053,32412,32773,33136,33501,33868,34237,34608,34981,35356,35733,36112,36493,36876,37261,37648,38037,38428,38821,39216,39613,40012,40413,40816,41221,41628,42037,42448,42861,43276,43693,44112,44533,44956,45381,45808,46237,46668,47101,47536,47973,48412,48853,49296,49741,50188,50637,51088,51541,51996,52453,52912,53373,53836,54301,54768,55237,55708,56181,56656,57133,57612,58093,58576,59061,59548,60037,60528,61021,61516,62013 mov $1,$0 pow $1,2 add $1,12
202.571429
1,359
0.801834
7f2ebbcb5e52a0f9ad974d44184f2cb828d5c716
56
asm
Assembly
make/ddk_build/cpprtl_test.sys.project/ntke_cpprtl.syslib/AMD64/eh_execute_handler.x64.asm
133a/project_ntke_cpprtl
f2d3fd36a2c44f968f7b10c344abe7e0b7aa2e4c
[ "MIT" ]
12
2016-08-02T19:22:26.000Z
2022-02-28T21:20:18.000Z
make/ddk_build/cpprtl_test.sys.project/ntke_cpprtl.syslib/AMD64/eh_execute_handler.x64.asm
133a/project_ntke_cpprtl
f2d3fd36a2c44f968f7b10c344abe7e0b7aa2e4c
[ "MIT" ]
null
null
null
make/ddk_build/cpprtl_test.sys.project/ntke_cpprtl.syslib/AMD64/eh_execute_handler.x64.asm
133a/project_ntke_cpprtl
f2d3fd36a2c44f968f7b10c344abe7e0b7aa2e4c
[ "MIT" ]
6
2018-04-15T16:51:40.000Z
2021-04-23T19:32:34.000Z
include eh/table_based/_x64/eh_execute_handler.x64.asm
28
55
0.857143
d88bfcb44220f8336a16510bbd96e3aa249653f8
410
asm
Assembly
programs/oeis/118/A118586.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/118/A118586.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/118/A118586.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A118586: Numbers whose binary expansion contains group of at least two 1's followed by a nonempty group of 0's. ; 6,12,14,24,28,30,48,56,60,62,96,112,120,124,126,192,224,240,248,252,254,384,448,480,496,504,508,510,768,896,960,992,1008,1016,1020,1022,1536,1792,1920,1984,2016,2032,2040,2044,2046,3072,3584,3840,3968,4032 cal $0,175332 ; Numbers whose binary expansion is of the form 11+0* mov $1,$0 mul $1,2
58.571429
207
0.746341
81ad88194b252abcf1ccc79010fc457e99fb5d8f
259
asm
Assembly
programs/oeis/070/A070403.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/070/A070403.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/070/A070403.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A070403: a(n) = 7^n mod 9. ; 1,7,4,1,7,4,1,7,4,1,7,4,1,7,4,1,7,4,1,7,4,1,7,4,1,7,4,1,7,4,1,7,4,1,7,4,1,7,4,1,7,4,1,7,4,1,7,4,1,7,4,1,7,4,1,7,4,1,7,4,1,7,4,1,7,4,1,7,4,1,7,4,1,7,4,1,7,4,1,7,4,1,7,4,1,7,4,1,7,4,1,7,4,1,7,4,1,7,4,1 mul $0,6 mod $0,9 add $0,1
37
201
0.501931
2bf641f04d7dfdad0f7d6fc1d38c5b743d7062cc
345
asm
Assembly
data/wildPokemon/route9.asm
etdv-thevoid/pokemon-rgb-enhanced
5b244c1cf46aab98b9c820d1b7888814eb7fa53f
[ "MIT" ]
1
2022-01-09T05:28:52.000Z
2022-01-09T05:28:52.000Z
data/wildPokemon/route9.asm
ETDV-TheVoid/pokemon-rgb-enhanced
5b244c1cf46aab98b9c820d1b7888814eb7fa53f
[ "MIT" ]
null
null
null
data/wildPokemon/route9.asm
ETDV-TheVoid/pokemon-rgb-enhanced
5b244c1cf46aab98b9c820d1b7888814eb7fa53f
[ "MIT" ]
null
null
null
Route9Mons: db $0F IF DEF(_RED) db 16,SPEAROW db 16,MANKEY db 14,SPEAROW db 11,EKANS db 13,MANKEY db 15,EKANS db 17,SPEAROW db 17,MANKEY db 13,EKANS db 17,EKANS ELSE db 16,SPEAROW db 16,MANKEY db 14,SPEAROW db 11,SANDSHREW db 13,MANKEY db 15,SANDSHREW db 17,SPEAROW db 17,MANKEY db 13,SANDSHREW db 17,SANDSHREW ENDC db $00
12.777778
16
0.721739
ba84f1da7b4dfee12198166cef68607557212cb1
11,152
asm
Assembly
iod/pipe/io.asm
olifink/smsqe
c546d882b26566a46d71820d1539bed9ea8af108
[ "BSD-2-Clause" ]
null
null
null
iod/pipe/io.asm
olifink/smsqe
c546d882b26566a46d71820d1539bed9ea8af108
[ "BSD-2-Clause" ]
null
null
null
iod/pipe/io.asm
olifink/smsqe
c546d882b26566a46d71820d1539bed9ea8af108
[ "BSD-2-Clause" ]
null
null
null
; Prototpe PIPE driver V2.01  Tony Tebby section pipe xdef pipe_io xref pipe_name include 'dev8_keys_qu' include 'dev8_keys_qdos_io' include 'dev8_keys_err' include 'dev8_keys_k' include 'dev8_iod_pipe_data' include 'dev8_mac_assert' ;+++ ; PIPE IO routine ; ; NOTE that this routine uses IO BUFFER definitions for the Queue pointers ; rather than the QU definitions. ; ; d0 cr IO key / status ; d1 cr IO parameter ; d2 c IO parameter (could be extended or set to 15) ; d3 s ; a1 cr IO parameter ; a2 r pointer to pointers to IO queues ; a3/a4 scratch ; a6 c p pointer to sysvar ; ; status returns standard ; ;--- pipe_io tst.b pic_dirf(a0) ; directory? bmi.l pio_dir cmp.b #iob.smul,d0 ; simple byte io? bhi.s pio_fs ; ... no, try filing system add.w d0,d0 move.w pio_btab(pc,d0.w),d0 jmp pio_btab(pc,d0.w) pio_btab dc.w pio_tbyt-pio_btab dc.w pio_fbyt-pio_btab dc.w pio_flin-pio_btab dc.w pio_fmul-pio_btab dc.w pio_ipar-pio_btab dc.w pio_sbyt-pio_btab dc.w pio_smul-pio_btab dc.w pio_smul-pio_btab pio_fs sub.b #iof.shdr,d0 ; set header beq.s pio_shdr subq.b #iof.rhdr-iof.shdr,d0 ; read header beq.s pio_rhdr subq.b #iof.load-iof.rhdr,d0 ; load file beq.l pio_load subq.b #iof.save-iof.load,d0 ; save file beq.l pio_save pio_ipar moveq #err.ipar,d0 pio_rts rts pio_rhdr ; read header moveq #15,d2 ; read fifteen bytes tst.w d1 ; any read yet bne.l pio_load ; ... yes, fetch multiple bsr.s pio_tbyt ; test for $ff bne.s pio_rts addq.b #1,d1 ; was it $ff bne.s pio_ipar ; ... no, not header bsr.s pio_gbyt ; ... yes, fetch byte (and ignore it) moveq #1,d1 ; one read bra.l pio_gmul ; get the rest pio_shdr ; set header moveq #15,d2 ; send 15 bytes tst.w d1 ; any sent yet? bne.l pio_save ; ... yes, carry on st d1 bsr.s pio_sbyt ; send flag byte sf d1 bne.s pio_rts moveq #1,d1 ; one byte gone now bra.l pio_pmul ; send the rest pio_tbyt ; test byte move.l pic_qin(a0),d0 ; queue pointer beq.s pio_ipar ; ... none move.l d0,a2 move.l qu_nexto(a2),a3 ; next to get cmp.l qu_nexti(a2),a3 beq.s pio_cnc ; nothing to come cmp.l qu_endq(a2),a3 ; off end? blt.s pio_tqu ; ... no lea qu_strtq(a2),a3 ; ... yes, start again pio_tqu move.b (a3)+,d1 ; get byte out moveq #0,d0 rts pio_fbyt ; fetch byte move.l pic_qin(a0),d0 ; queue pointer beq.s pio_ipar ; ... none move.l d0,a2 pio_gbyt move.l qu_nexto(a2),a3 ; next get cmp.l qu_nexti(a2),a3 beq.s pio_cnc ; nothing to come cmp.l qu_endq(a2),a3 ; off end? blt.s pio_gqu ; ... no lea qu_strtq(a2),a3 ; ... yes, start again pio_gqu move.b (a3)+,d1 ; get byte out move.l a3,qu_nexto(a2) pio_ok moveq #0,d0 rts pio_ncn add.l a1,d1 ; set quantity transferred pio_cnc move.b qu_eoff(a2),d0 ; nothing more, is it end of file? bmi.s pio_eof pio_nc moveq #err.nc,d0 rts pio_eof moveq #err.eof,d0 rts pio_sbyt ; send byte move.l pic_qout(a0),d0 ; queue pointer beq.l pio_ipar ; ... none move.l d0,a2 pio_pbyt move.l qu_nexti(a2),a3 ; next place to put cmp.l qu_endq(a2),a3 ; off end? blt.s pio_pqu ; ... no lea qu_strtq(a2),a3 ; ... yes, start again cmp.l qu_nexto(a2),a3 ; buffer full? beq.s pio_nc ; ... yes pio_pqu move.b d1,(a3)+ ; put byte in cmp.l qu_nexto(a2),a3 beq.s pio_nc move.l a3,qu_nexti(a2) ; OK, update pointer moveq #0,d0 rts pio_flin ; fetch line ext.l d2 move.l pic_qin(a0),d0 ; queue pointer beq.l pio_ipar ; ... none move.l d0,a2 pio_glin sub.l d1,d2 ; amount to come sub.l a1,d1 ; prepare count move.l d2,d3 ble.s pio_bfn ; ... none moveq #k.nl,d6 ; newline check move.l qu_nexto(a2),a3 ; next to get move.l qu_nexti(a2),d7 ; total bytes in middle sub.l a3,d7 beq.s pio_ncn ; nothing to come bgt.s pio_gl3 ; ... case 3, no wrap possible move.l qu_endq(a2),d7 ; end sub.l a3,d7 ; bytes to end beq.s pio_gl2 ; nothing from this bit cmp.l d3,d7 ; more than a buffer full? blt.s pio_gl1 ; ... no move.l d3,d7 ; ... yes, limit to buffer pio_gl1 sub.l d7,d3 ; amount left to fill buffer subq.w #1,d7 pio_gl1l move.b (a3)+,(a1) cmp.b (a1)+,d6 ; end of line? dbeq d7,pio_gl1l beq.s pio_oko move.l a3,qu_nexto(a2) ; update output byte pointer tst.w d3 ; any more to fetch? ble.s pio_bfn ; ... no pio_gl2 lea qu_strtq(a2),a3 ; second bit move.l qu_nexti(a2),d7 sub.l a3,d7 ; bytes in second bit ble.l pio_ncn pio_gl3 cmp.l d3,d7 ; more than buffer full? blt.s pio_gl2s ; ... no move.l d3,d7 ; ... yes, limit ble.s pio_bfn ; ... none pio_gl2s ; case 2, start of queue sub.l d7,d3 ; remaining buffer not fillable subq.w #1,d7 pio_gl2l move.b (a3)+,(a1) cmp.b (a1)+,d6 ; end of line? dbeq d7,pio_gl2l beq.s pio_oko move.l a3,qu_nexto(a2) ; update output byte pointer tst.l d3 ; any more buffer left? bne.l pio_ncn ; ... yes pio_bfn add.l a1,d1 moveq #err.bffl,d0 rts pio_oko move.l a3,qu_nexto(a2) ; update output byte pointer add.l a1,d1 ; set count moveq #0,d0 rts pio_fmul ; fetch multiple / load ext.l d2 pio_load move.l pic_qin(a0),d0 ; queue pointer beq.l pio_ipar ; ... none move.l d0,a2 pio_gmul moveq #0,d6 ; no second bit to get move.l d2,d3 ; amount to get sub.l d1,d3 ; less amount already fetched ble.l pio_ok move.l qu_nexto(a2),a3 ; next to get move.l qu_nexti(a2),d7 ; total bytes in middle sub.l a3,d7 beq.l pio_cnc ; nothing to come bgt.s pio_gm3 ; ... case 3, no wrap possible move.l qu_endq(a2),d7 ; end sub.l a3,d7 ; bytes to end cmp.l d3,d7 ; more than a buffer full? bge.s pio_gm1 ; ... yes, no wrap required lea qu_strtq(a2),a4 ; second bit move.l qu_nexti(a2),d6 sub.l a4,d6 ; bytes in second bit sub.l d7,d3 ; amount required from this bit cmp.l d3,d6 ; enough bge.s pio_gm2 ; ... yes, case 2, copy all bra.s pio_gm pio_gm3 ; case 3, no wrap possible cmp.l d3,d7 ; enough room bge.s pio_gm1 ; ... yes, this becomes case 1 bra.s pio_gm pio_gm2 ; case 2 move.l d3,d6 ; all from first, this much from second bra.s pio_gm pio_gmr move.l a4,a3 ; do second bit moveq #0,d6 ; ... and not again bra.s pio_gm pio_gm1 ; case 1, all one bit move.l d3,d7 ; get just this much from second bit pio_gm add.l d7,d1 ; copy first bit move.l a3,d3 ; check for odd address move.l a1,d4 or.l d3,d4 lsr.b #1,d4 bcs.s pio_gm1e ; ... odd, byte at a time moveq #32,d3 moveq #$1c,d4 ; mask of long words in 16 bytes and.w d7,d4 sub.l d4,d7 ; gives n*32 + 0..3 neg.w d4 asr.w #1,d4 ; +0, 4, 8 .... bytes jmp pio_gmxe(pc,d4.w) pio_gmxl move.l (a3)+,(a1)+ ; 32 bytes at a time move.l (a3)+,(a1)+ move.l (a3)+,(a1)+ move.l (a3)+,(a1)+ move.l (a3)+,(a1)+ move.l (a3)+,(a1)+ move.l (a3)+,(a1)+ move.l (a3)+,(a1)+ pio_gmxe sub.l d3,d7 ; 32 more? bge.s pio_gmxl ; ... yes add.l d3,d7 ; ... no not that many bra.s pio_gm1e pio_gm1l move.b (a3)+,(a1)+ pio_gm1e subq.l #1,d7 bge.s pio_gm1l move.l d6,d7 ; second section bgt pio_gmr ; ... yes, repeat move.l a3,qu_nexto(a2) ; ... no, update pointer cmp.l d1,d2 ; all gone? bne.l pio_cnc moveq #0,d0 ; ... ok rts ; d0 set pio_smul ; send multiple / save ext.l d2 pio_save move.l pic_qout(a0),d0 ; queue pointer beq.l pio_ipar ; ... none move.l d0,a2 pio_pmul moveq #0,d6 ; no second bit to put move.l d2,d3 ; amount to put sub.l d1,d3 ; less amount already sent move.l qu_nexti(a2),a3 ; next to put move.l qu_nexto(a2),d7 ; total room in middle sub.l a3,d7 subq.l #1,d7 ; less the one spare bge.s pio_pm3 ; ... case 3, no wrap possible move.l qu_endq(a2),d7 ; end sub.l a3,d7 ; room to end cmp.l d3,d7 ; enough? bge.s pio_pm1 ; ... case 1, no wrap necessary lea qu_strtq(a2),a4 ; second bit move.l qu_nexto(a2),d6 sub.l a4,d6 subq.l #1,d6 ; ... room at start sub.l d7,d3 ; amount required from this bit cmp.l d3,d6 ; enough bge.s pio_pm2 ; ... yes, case 2, copy all bra.s pio_pnr ; ... no enough room pio_pm3 ; case 3, no wrap possible cmp.l d3,d7 ; enough room bge.s pio_pm1 ; ... yes, this becomes case 1 pio_pnr moveq #err.nc,d0 ; ... will be NC in any case tst.l pin_nin-pin_qu(a2) ; named (shared) pipe? beq.s pio_pm ; ... no we can put a bit rts pio_pm2 ; case 2 move.l d3,d6 ; all from first, this much from second bra.s pio_pm0 pio_pmr move.l a4,a3 ; do second bit moveq #0,d6 ; ... and not again bra.s pio_pm pio_pm1 ; case 1, all one bit move.l d3,d7 ; get just this much from second bit pio_pm0 moveq #0,d0 ; it will be ok pio_pm add.l d7,d1 ; copy first bit move.l a3,d3 ; check for odd address move.l a1,d4 or.l d3,d4 lsr.b #1,d4 bcs.s pio_pm1e ; ... odd, byte at a time moveq #32,d3 moveq #$1c,d4 ; mask of long words in 16 bytes and.w d7,d4 sub.l d4,d7 ; gives n*32 + 0..3 neg.w d4 asr.w #1,d4 ; +0, 4, 8 .... bytes jmp pio_pmxe(pc,d4.w) pio_pmxl move.l (a1)+,(a3)+ ; 32 bytes at a time move.l (a1)+,(a3)+ move.l (a1)+,(a3)+ move.l (a1)+,(a3)+ move.l (a1)+,(a3)+ move.l (a1)+,(a3)+ move.l (a1)+,(a3)+ move.l (a1)+,(a3)+ pio_pmxe sub.l d3,d7 ; 32 more? bge.s pio_pmxl ; ... yes add.l d3,d7 ; ... no not that many bra.s pio_pm1e pio_pm1l move.b (a1)+,(a3)+ pio_pm1e subq.l #1,d7 bge.s pio_pm1l move.l d6,d7 ; second section bgt pio_pmr ; ... yes, repeat move.l a3,qu_nexti(a2) ; ... no, update pointer rts ; d0 set ; ****** DIRECTORY entries pio_dir cmp.b #iob.fmul,d0 ; simple fetch multiple bytes io? bne.s pid_fs ; ... no, try filing system cmp.w #$40,d2 ; 40 byte entries only bne pio_ipar move.l pic_ptnm(a0),a2 ; pointer move.l (a2)+,d4 beq pio_eof ; end of list move.l a2,pic_ptnm(a0) ; save it lea pil_list(a3),a2 pid_look assert pin_link,0 move.l (a2),d0 ; next name beq.s pid_empty move.l d0,a2 cmp.l d0,d4 ; the name we want? bne.s pid_look moveq #$40-pin_qu-qu_strtq,d0 ; 'file length' adjust add.l pin_qu+qu_endq(a2),d0 sub.l a2,d0 move.l d0,(a1)+ clr.w (a1)+ clr.l (a1)+ clr.l (a1)+ lea pin_name(a2),a4 moveq #(pin.name+2-1)/4,d3 pid_cname move.l (a4)+,(a1)+ dbra d3,pid_cname moveq #($40-pin.name-2-14)/2,d3 pid_eret moveq #$40,d1 ; return moveq #0,d0 pid_clear move.w d0,(a1)+ ; clear the rest dbra d3,pid_clear rts pid_empty moveq #($40-2)/2,d3 ; empty return bra.s pid_eret ; DIR fs calls pid_fs sub.b #iof.rhdr,d0 ; read header beq.s pid_rhdr sub.b #iof.minf-iof.rhdr,d0 ; medium info bne pio_ipar ; DIR medium info move.l pic_nrnm+2(a0),d1 move.w pic_nrnm+2(a0),d1 lea pipe_name,a4 move.l (a4)+,(a1)+ move.l (a4)+,(a1)+ move.w (a4)+,(a1)+ moveq #0,d0 rts ; DIR read header pid_rhdr move.l pic_nrnm(a0),d1 ; number of items lsl.l #6,d1 ; length of list move.l d1,(a1)+ ; file length move.w #$00ff,(a1)+ ; directory clr.l (a1)+ clr.l (a1)+ moveq #14,d1 ; return moveq #0,d0 rts end
21.612403
74
0.633429
60b8ab13893db8260f99145806a14907e13d23f3
16,475
asm
Assembly
base/remoteboot/bootfloppy/src/loader/loader.asm
npocmaka/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
17
2020-11-13T13:42:52.000Z
2021-09-16T09:13:13.000Z
base/remoteboot/bootfloppy/src/loader/loader.asm
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
2
2020-10-19T08:02:06.000Z
2020-10-19T08:23:18.000Z
base/remoteboot/bootfloppy/src/loader/loader.asm
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
14
2020-11-14T09:43:20.000Z
2021-08-28T08:59:57.000Z
;---------------------------------------------------------------------------- ; loader.asm ; ; Loader code for Goliath. This code is based (a lot) on Microsoft's ; NTLDR as it is loaded by their NT boot sector. ; ;$History: LOADER.ASM $ ; ; ***************** Version 4 ***************** ; User: Paul Cowan Date: 10/08/98 Time: 4:28p ; Updated in $/Client Boot/Goliath/Loader ; Removed startup banner. ; ; ***************** Version 3 ***************** ; User: Paul Cowan Date: 27/07/98 Time: 4:41p ; Updated in $/Client Boot/Goliath/Loader ; Changed displayed version number. ; ;---------------------------------------------------------------------------- ideal _IDEAL_ = 1 Segment Code para public use16 Assume cs:code, ds:code include "loader.inc" Struc NICInfo VendorID dw ? DeviceID dw ? Offset dd ? DataSize dw ? ends Struc UNDIHdr dw ? ID dd ? Size dw ? Ver dw ? Patches db ?, ?, ?, ? dw ? SizeHdr dw ? SizeCode dw ? SizeData dw ? SizeBSS dw ? LanOption db ? ends FATSEG = 5000h DIRSEG = 1000h P386 ;START_CODE ;========================================================================== ; LoaderEntry ; ; The first 512 bytes are loaded by the boot sector. The boot sector ; jumps to the start of this code. Throughout this code, DS remains ; the boot sector segment to use the BPB and disk read functions in ; the boot sector. ; ; Parameters (passed from boot sector): ; ax = ; bx = starting cluster ; cx = ; dx = ; si = pointer to BPB ; di = pointer to jump table ; ds = 07C0h (boot sector segment) ; es = 2000h ; ; The directory from the disk is in memory at 1000:0, this code has been ; loaded into 2000:0. ; ; Returns: ; never does ;========================================================================== Proc Start push si ; save BPB pointer push di ; save jump table pointer push bx ; save file starting cluster ; push si ; save si ; mov si, offset Banner ; call PrintCS ; display program banner ; pop si ; restore si ;------------------------------------------------------------ ; Read the FAT from the floppy into 5000:0h. ;------------------------------------------------------------ push FATSEG pop es ; es = FAT segment xor bx, bx ; load offset = 0 mov cx, [si+3] ; get "reserved sectors" from BPB mov [di+8], cx ; update starting sector to read mov [word ptr di+10], 0 mov ax, [si+0Bh] ; get "FAT sectors" from BPB call [dword ptr di+4] ; call boot sector read function mov ax, 0E2Eh int 10h ; print first "." pop dx ; restore file starting cluster mov ax, 2000h mov es, ax ; load segment is 2000h call LoadFile ; load the remainder of this file pop di ; restore jump table pointer pop si ; restore BPB pointer jmp Startup ; contine with remainder of loader endp ;-------------------------------------------------------------------- ; LoadFile ; ; Reads an entire file into memory by walking the FAT on the disk. ; ; Parameters: ; si = pointer to BPB ; di = pointer to jump table ; dx = starting cluster ; es = destination segment ;-------------------------------------------------------------------- Proc LoadFile xor bx, bx ; load offset = 0 ; Two counters are used, al and ah. ah is the total number of ; clusters we can read, it starts at 128 which is 64K of data. ; al is the number of clusters we want to read. mov ah, 128 ; ah = number of clusters we can read readLoop: push dx ; save cluster number mov al, [si+2] ; get "sectors per cluster" sub ah, [si+2] ; subtract from total cmp dx, 0FFFFh ; last cluster? jne more ; no - more to load pop dx ; clean stack jmp fileLoaded ; we are done - start the file ; Scan the FAT for the file. If consecutive clusters are found ; they are done with a single read call. more: mov cx, dx ; cx = current cluster call ReadFAT ; get next cluster from FAT inc cx cmp dx, cx ; consecutive cluster? jne doRead ; no cmp ah, 0 ; can we read more at this time? jne loc_4 ; sure mov ah, 128 ; restore ah = 128 jmp doRead loc_4: add al, [si+2] ; add "sectors per cluster" sub ah, [si+2] ; decrease sectors we can read jmp more ; check next cluster doRead: pop cx ; get current cluster push dx ; save next cluster value mov dx, cx ; dx = current cluster mov cx, 10 ; retry count readRetry: push bx push ax ; save cluster count push dx ; save cluster number push cx ; save retry counter call [dword ptr di] ; read disk clusters jnc readOK ; jump if no error ; there was an error reading the disk xor ax, ax int 13h ; reset disk xor ax, ax ; ax =0 int 13h ; reset disk xor ax, ax ; ax = 0 delay: dec ax jnz delay pop cx pop dx pop ax pop bx dec cx ; decrease retry count jnz readRetry ; jump if retries not up mov si, offset error ; pointer to message call PrintCS ; print error message jmp $ ; hang readOK: mov ax, 0E2Eh int 10h ; print second "." pop cx pop dx pop ax pop bx pop dx mov cl, al ; cl = cluster read count xor ch, ch ; ch = 0 shl cx, 9 ; divide cluster count by 512 add bx, cx ; update load offset jz changeSeg ; jump if over segment jmp readLoop ; continue loading file changeSeg: mov ax, es ; get current segment add ax, 1000h ; change segment mov es, ax mov ah, 80h jmp readLoop ; continue loading file fileLoaded: ret endp ;-------------------------------------------------------------------- ; ReadFAT ; ; Reads a value from the FAT in memory. ; ; Parameters: ; dx = current cluster ;-------------------------------------------------------------------- Proc ReadFAT push bx ; save bx push ds ; save ds push FATSEG pop ds ; set ds to FAT segment ; current cluster * 1.5 mov bx, dx ; bx = current cluster shr dx, 1 ; divide cluster by 2 pushf ; save flags add bx, dx ; mov dx, [bx] ; get next link popf ; restore flags jc loc_12 ; Jump if carry Set and dx, 0FFFh ; keep lower 3 nibbles jmp loc_13 loc_12: shr dx, 4 ; keep upper 3 nibbles loc_13: cmp dx, 0FF8h ; "end of file" found? jb readFatExit ; no mov dx, 0FFFFh ; return "end of file" readFatExit: pop ds ; restore ds pop bx ; restore bx ret endp ;-------------------------------------------------------------------- ; PrintCS ; ; Prints a string from the code segment. ; ; Parameters: ; cs:si - pointer to string ; ; Returns: ; nothing ;-------------------------------------------------------------------- Proc PrintCS mov al, [cs:si] ; get character inc si or al, al ; found NULL? jz printDone ; found end of message mov ah, 0Eh mov bx, 7 int 10h ; print character jmp printCS ; do next character printDone: ret endp ;Banner db 'BootWare Goliath Beta 2', 0 Error db 13, 10 db 'Goliath: I/O error reading disk', 13, 10 db ' Please insert another disk', 13, 10, 0 org 510 dw offset DataTable ; pointer to data table ;-------------------------------------------------------------------- ; Startup ; ; Entry function after entire file has been loaded into memory. ; ; Parameters: ; si = pointer to BPB ; di = pointer to jump table ; ds = bootsector segment ;-------------------------------------------------------------------- Proc Startup mov ax, 0E2Ah int 10h ; print "*" call LoadLanguage ; load the language file push cs pop ds ; ds = cs jnc noLang ; jump if no language was loaded mov [Info.LangSeg], es ; save language segment noLang: call CheckPCI ; check for a PCI adapter call CheckISA mov si, offset CRLF call Print mov si, offset NoAdapter call Print ; display "No adapter found" jmp $ ; hang the PC endp ;-------------------------------------------------------------------- ; LoadLanguage ; ; Parameters: ; si = pointer to BPB ; di = pointer to jump table ; ds = bootsector segment ; ; Returns: ; carry set if file loaded ; es = language segment ;-------------------------------------------------------------------- Proc LoadLanguage xor bx, bx ; bx = 0 ; Zero register mov cx, [si+6] ; get max root directory entries push DIRSEG pop es ; set es to directory segment push ds ; save ds push cs pop ds ; ds = current segment push si push di scanDirLoop: mov di, bx ; directory entry offet into di push cx ; save cx mov cx, 11 ; file name size mov si, offset LangFile repe cmpsb ; look for file name pop cx ; restore cx jz foundEntry ; jump if found add bx, 20h ; next directory offset loop scanDirLoop ; check next entry foundEntry: pop di pop si pop ds ; restore original ds jcxz noEntry ; exit if entry not found ; Calc the segment needed to locate the language file ; at the very top of memory. push es ; save current es push 0 pop es ; es = 0 mov dx, [es:413h] ; get current memory size sub dx, 4 ; keep 4K shl dx, 6 ; convert to segment pop es ; restore es mov ax, [es:bx+1Ah] ; get file starting cluster push ax ; save it mov eax, [es:bx+1Ch] ; get file size mov cx, 16 div cl ; divide into paragraphs inc al xor ah, ah sub dx, ax ; subtract size from top segment mov es, dx ; es = new segment pop dx ; restore starting cluster call LoadFile cmp [word ptr es:60], 'CP' ; check ID string jne noEntry stc ; return carry set - file loaded ret noEntry: ; mov si, offset NoLangFile ; call PrintCS ; print "Warning: Language file not.." clc ; return carry clear - no file loaded ret endp ;-------------------------------------------------------------------- ; CheckISA ; ; Parameters: ; none ; ; Returns: ; only if no adapter is found ;-------------------------------------------------------------------- include "5x9.asm" Proc CheckISA call Detect5X9 jnc noISA mov ebx, [Offset5X9] ; source offset mov cx, [Size5X9] ; file size jmp RelocateUNDI noISA: ret endp ;-------------------------------------------------------------------- ; CheckPCI ; ; Parameters: ; none ; ; Returns: ; only if no adapter is found ;-------------------------------------------------------------------- Proc CheckPCI mov ax, 0b101h int 1ah ; are we running on a PCI PC? cmp edx, ' ICP' ; did we get PCI? je isPCI ; we have PCI! ret isPCI: mov di, offset NICs call FindPCINIC ; check UNDI table jnc notFound ; not found mov [Info.PCIBusDevFunc], bx mov [Info.VendorID], dx mov [Info.DeviceID], cx mov ebx, [(NICInfo di).Offset]; source offset mov cx, [(NICInfo di).DataSize]; cx = file size jmp RelocateUNDI notFound: ret ; return - no adapter found endp ;-------------------------------------------------------------------- ; FindPCINIC ; ; Look for a PCI adapter in the PCI based on a table of supported ; vendor and device IDs. ; ; Parameters: ; di - pointer to NIC table ; ; Returns: ; bx - PCI Bus/Device/Function numbers ; cx - device ID ; dx - vendor ID ; di - pointer to entry in NIC table ; carry set if adapter found ;-------------------------------------------------------------------- Proc FindPCINIC findLoop: mov dx, [(NICInfo di).VendorID]; get vendor ID from table cmp dx, 0 je endLoop mov cx, [(NICInfo di).DeviceID]; get device ID from table mov si, 0 ; Device Index (0-n). mov ax, 0B102h ; find PCI device int 1Ah ; try and find PCI device jnc found ; found a device add di, size NICInfo jmp findLoop ; do next device endLoop: clc ; clear carry - not found ret found: stc ; set carry - adapter found ret endp ;-------------------------------------------------------------------- ; RelocateUNDI ; ; Relocates an UNDI to top of memory. The UNDI has a header attached ; to the beginning of it. ; ; Parameters: ; ebx - UNDI offset in file ; cx - UNDI size ;-------------------------------------------------------------------- Proc RelocateUNDI shr ebx, 4 mov ax, cs add bx, ax mov es, bx ; set es to UNDI segment cmp [(UNDIHdr es:0).ID], 'IDNU'; check identifer je gotUNDI mov si, offset _noUNDI call Print jmp $ ; hang gotUNDI: push cx ; save UNDI size mov bx, [Info.LangSeg] ; get segment of language module cmp bx, 0 ; do we have an language module? jne notTop ; yes ; no language module was loaded so determine our segment from ; top of memory push es push 0 pop es ; es = 0 mov bx, [es:413h] ; get current memory size sub bx, 4 ; keep 4K shl bx, 6 ; convert to segment pop es notTop: ; get the size of the UNDI code and data segment from the header mov ax, [(UNDIHdr es:0).SizeCode]; get UNDI code size mov [Info.UNDICode], ax ; save it to pass to BootWare mov cx, [(UNDIHdr es:0).SizeData] add cx, [(UNDIHdr es:0).SizeBSS] mov [Info.UNDIData], cx ; save total data size add ax, cx ; add UNDI data size to code size shr ax, 4 ; divide size into paragraphs inc al ; plus one for remainder sub bx, ax ; subtract from top segment mov [Info.UNDISeg], bx ; save UNDI segment pop cx ; get UNDI size push ds ; save ds push es ; save es push es pop ds ; ds = UNDI current segment mov es, bx ; es = new segment ; copy UNDI to new segment xor di, di ; destination offset mov si, [(UNDIHdr ds:0).SizeHdr] rep movsb ; relocate the UNDI ;------------------------------------------------------------ ; Copy adapter ID string into the BootWare module. ;------------------------------------------------------------ lea si, [(UNDIHdr ds:0).LanOption] push cs pop es ; es = our segment mov di, [cs:BWOffset] add di, 4 copyID: lodsb stosb cmp al, 0 ; end of string? jne copyID ; no pop es ; restore es pop ds ; restore ds ;------------------------------------------------------------ ; Now relocate the BootWare module below the UNDI. ;------------------------------------------------------------ mov si, [BWOffset] mov ax, [si+2] ; get size from module shr ax, 4 ; divide by 16 sub bx, ax ; subtract from UNDI segment mov es, bx ; es is new segment mov cx, [BWSize] ; get our code size mov si, [BWOffset] xor di, di rep movsb ; relocate our code mov si, offset Info ; get address of LoaderInfo structure push es ; setup continuation address on stack push 0 retf ; jump to relocated BootWare endp _noUNDI db "UNDI not found.", 0 ;-------------------------------------------------------------------- ; Print ; ; Prints a string from the code segment. ; ; Parameters: ; cs:si - pointer to string ; ; Returns: ; nothing ;-------------------------------------------------------------------- Proc Print push es ; save ds push bx ; save bx cmp [Info.LangSeg], 0 ; did we load a language? je notLang ; no mov bx, [Info.LangSeg] mov es, bx ; set es to language segment cmp si, offset NoAdapter jne notLang mov bx, [es:66] ; get address from language module cmp bx, 0 ; did we get a pointer? je notLang ; no mov si, bx ; set new pointer jmp printLoop notLang: push ds pop es ; set es to our segment printLoop: mov al, [es:si] inc si or al, al ; found NULL? jz done ; found end of message mov ah, 0Eh mov bx, 7 int 10h ; print character jmp printLoop ; do next character done: pop bx ; restore bx pop es ; restore ds ret endp ;==================================================================== LangFile db 'GOLIATH DAT' CRLF db 7, 13, 10, 0 ;NoLangFile db 7, 13, 10, "Warning: Language file not found.", 0 NoAdapter db "Error: No supported adapter found!", 0 Info LoaderInfo <?> align 16 DataTable: BWSize dw 0 ; size of common BootWare module BWOffset dw 0 ; starting offset of BootWare Size5X9 dw 0 Offset5X9 dd 0 ; VendorID, DeviceID, Offset, Size NICs NICInfo <> db 0 org 2047 db 0 ends end Start
22.354138
78
0.548467
c3da7aefe8b71f09ba6bf67df677dd45305e5821
382
asm
Assembly
programs/oeis/025/A025685.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/025/A025685.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/025/A025685.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A025685: Exponent of 10 (value of j) in n-th number of form 3^i*10^j. ; 0,0,0,1,0,1,0,1,2,0,1,2,0,1,2,3,0,1,2,3,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,6,0,1,2,3,4,5,6,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,8,0,1,2,3,4,5,6,7,8,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7 mov $1,$0 lpb $0 sub $0,1 add $3,1 trn $1,$3 mov $2,$0 mov $0,$1 mov $1,$2 lpe
29.384615
217
0.520942
ee08cb0c23c46b402c76e5c95eae980b070dc0a7
1,267
asm
Assembly
libsrc/target/micro8085/stdio/getk.asm
UnivEngineer/z88dk
9047beba62595b1d88991bc934da75c0e2030d07
[ "ClArtistic" ]
4
2021-12-23T15:34:05.000Z
2021-12-23T15:36:16.000Z
libsrc/target/micro8085/stdio/getk.asm
UnivEngineer/z88dk
9047beba62595b1d88991bc934da75c0e2030d07
[ "ClArtistic" ]
2
2022-03-20T22:17:35.000Z
2022-03-24T16:10:00.000Z
libsrc/target/micro8085/stdio/getk.asm
jorgegv/z88dk
127130cf11f9ff268ba53e308138b12d2b9be90a
[ "ClArtistic" ]
null
null
null
;------------------------------------------------------------------------- ; Native terminal i/o functionality for micro8085_cilb (stdio interface) SECTION code_clib EXTERN _urxbuf EXTERN _getidx PUBLIC getk PUBLIC _getk ;------------------------------------------------------------------------- ; Function checks if buffer has data, if so it pulls one char from buffer ; Assumes buffer len is 256 bytes and that it's aligned to a 256 boundary getk: _getk: lhld _getidx ;read both get(l) and put(h) ld a,l ;compare them cp h ;if same no data jp nz,getk1 ;else read from buf ld hl,0 ;ret zero when no data ret ;with z-flag also set getk1: ld h,_urxbuf/256 ;msb of buffer address ld a,(hl) ;pull from buffer ld h,a ;char temp to h ld a,l ;buffer index to a inc a ;bump index ld (_getidx),a ;store index or l ;clear z-fag ld l,h ;char to l ld h,0 ;return in hl ret
38.393939
74
0.41989
83adc197455b436d5350c43214794f5f833e45d2
394
asm
Assembly
oeis/261/A261465.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/261/A261465.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/261/A261465.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A261465: a(n) = prime(n+1)^2 - prime(n). ; Submitted by Christian Krause ; 7,22,44,114,158,276,344,510,818,932,1338,1644,1808,2166,2762,3428,3662,4428,4974,5258,6168,6810,7838,9320,10104,10508,11346,11774,12660,16016,17034,18638,19184,22062,22652,24498,26412,27726,29762 mov $2,$0 add $0,1 seq $0,40 ; The prime numbers. mov $1,$0 pow $1,2 seq $2,40 ; The prime numbers. sub $1,$2 mov $0,$1
30.307692
197
0.705584
d10e7b89078cde102511963dc54a6abbb2a44727
85,961
asm
Assembly
Blitters/sDraw/src/sDraw.asm
idinev/pub_toys
c5518c1b974ab0d921d16d806cc3924f03a66989
[ "Unlicense" ]
null
null
null
Blitters/sDraw/src/sDraw.asm
idinev/pub_toys
c5518c1b974ab0d921d16d806cc3924f03a66989
[ "Unlicense" ]
null
null
null
Blitters/sDraw/src/sDraw.asm
idinev/pub_toys
c5518c1b974ab0d921d16d806cc3924f03a66989
[ "Unlicense" ]
null
null
null
USE_BANK = 0 COMPILE_AS_DLL = 0 COMPILE_AS_EXE = 0 INCLUDE_COPYRIGHT_TEXT = 1 ALLOW_EXTERNAL_LIBS = 1 if USE_BANK include \masm32\ultrano\bank\base.inc HEAP2 textequ <HEAP1> else include src\CompatLayer.inc endif include ../sDraw.inc if ALLOW_EXTERNAL_LIBS includelib \masm32\lib\ole32.lib includelib \masm32\lib\olepro32.lib endif option PROC:PRIVATE public SD_TransparentColor public SD_CurFont public sTarget_Data public sSource_Data SRECT STRUCT left SDWORD ? top SDWORD ? right SDWORD ? bottom SDWORD ? SRECT ENDS SBLTPARAM struct x dd ? y dd ? wid dd ? hei dd ? x2 dd ? y2 dd ? SBLTPARAM ends backDC textequ <SDBackDC> public backDC public SDhDC .data SD_TransparentColor dd 0FF00FFh SD_CurFont dd 0 .data? align 16 SDBound SRECT <> SDOriginalBound SRECT <> SDDrawOffs POINT <> ScreenSize POINT <> SDhWnd dd ? SDhDC dd ? backDC dd ? backDC_PrevHBmp dd ? SD_BackSprite dd ? align 16 sTarget_Data sSprite <> sSource_Data sSprite <> pTargetSprite dd ? pSourceSprite dd ? .code .data sd_pLastSprite dd 0 .code sdRegisterSprite proc PRIVATE uses eax edx pSprite mov edx,pSprite .if edx mov eax,sd_pLastSprite mov sd_pLastSprite,edx mov [edx].sSprite.zz_pNext,eax .endif ret sdRegisterSprite endp sdUnregisterSprite proc PRIVATE uses eax ecx edx pSprite mov edx,pSprite mov ecx,sd_pLastSprite test edx,edx jz _ret .if edx==ecx mov eax,[ecx].sSprite.zz_pNext mov sd_pLastSprite,eax jmp _ret .endif .while ecx mov eax,[ecx].sSprite.zz_pNext .if eax==edx ; found it mov eax,[edx].sSprite.zz_pNext mov [ecx].sSprite.zz_pNext,eax jmp _ret .endif mov ecx,eax .endw _ret: ret sdUnregisterSprite endp sdDeleteSprite proc PUBLIC UseAll pSprite mov ecx,pSprite test ecx,ecx jz _ret invoke sdUnregisterSprite,ecx free [ecx].sSprite.bits free ecx _ret: ret sdDeleteSprite endp sdDeleteAllSprites proc PRIVATE UseAll .while sd_pLastSprite invoke sdDeleteSprite,sd_pLastSprite .endw ret sdDeleteAllSprites endp CreateDIBsprite proc PRIVATE UseMost wid,hei local hdr1:BITMAPINFOHEADER local s:sSprite m2m s.wid,wid m2m s.hei,hei mov s.dwFlags,0 ;--------[ setup bitmapinfohdr ]-----------[ Clear hdr1 mov hdr1.biSize,sizeof BITMAPINFOHEADER m2m hdr1.biWidth,wid m2m hdr1.biHeight,hei neg hdr1.biHeight ; !!!!!! make the height negative mov hdr1.biPlanes,1 mov hdr1.biBitCount,32 mov hdr1.biCompression,BI_RGB mov eax,wid mul hei shl eax,2 mov hdr1.biSizeImage,eax mov hdr1.biClrImportant,0 mov hdr1.biClrUsed,0 ;-------------------------------------------/ invoke CreateDIBSection,backDC,addr hdr1,DIB_RGB_COLORS,addr s.bits,0,0 mov s.hBitmap,eax ;---[ compute stuff ]-------[ mov eax,wid shl eax,2 mov s.linesize,eax ;---------------------------/ invoke memclone,addr s,sizeof sSprite ret CreateDIBsprite endp sdSpriteFromHBITMAP proc PUBLIC UseMost hBitmap local bi:BITMAP,wid,hei local hdr1:BITMAPINFOHEADER local s:sSprite .if !hBitmap xor eax,eax ret .endif invoke GetObject,hBitmap,sizeof BITMAP,addr bi m2m wid,bi.bmWidth m2m hei,bi.bmHeight m2m s.wid,wid m2m s.hei,hei mov s.dwFlags,0 mov s.hBitmap,0 ;--------[ setup bitmapinfohdr ]-----------[ Clear hdr1 mov hdr1.biSize,sizeof BITMAPINFOHEADER m2m hdr1.biWidth,wid m2m hdr1.biHeight,hei neg hdr1.biHeight mov hdr1.biPlanes,1 mov hdr1.biBitCount,32 mov hdr1.biCompression,BI_RGB mov eax,wid mul hei shl eax,2 mov hdr1.biSizeImage,eax ;-------------------------------------------/ mov s.bits,malloc(hdr1.biSizeImage) invoke GetDIBits,backDC,hBitmap,0,hei,s.bits,addr hdr1,DIB_RGB_COLORS ;---[ compute stuff ]-------[ mov eax,wid shl eax,2 mov s.linesize,eax ;---------------------------/ invoke memclone,addr s,sizeof sSprite invoke sdRegisterSprite,eax ret sdSpriteFromHBITMAP endp sdCreateBlankSprite proc PUBLIC UseMost wid,hei local s:sSprite m2m s.wid,wid m2m s.hei,hei mov s.dwFlags,0 mov s.hBitmap,0 mov eax,wid imul eax,hei shl eax,2 mov s.bits,malloc(eax) ;---[ compute stuff ]-------[ mov eax,wid shl eax,2 mov s.linesize,eax ;---------------------------/ invoke memclone,addr s,sizeof sSprite invoke sdRegisterSprite,eax ret sdCreateBlankSprite endp sdSpriteFromBitmapFile proc PUBLIC UseMost lpszFileName invoke LoadImage,0,lpszFileName,IMAGE_BITMAP,0,0,LR_LOADFROMFILE .if eax mov ecx,eax invoke sdSpriteFromHBITMAP,eax push eax invoke DeleteObject,ecx pop eax .endif ret sdSpriteFromBitmapFile endp sdSpriteFromILB proc PUBLIC UseMost lpSourceData local wid,hei,IsAlpha,WIDxHEI local PackedSize,pPackedBuf,pUnpackedBuf local pSprite,wid2 ;-----[ get info from the ILIX Bitmap ]----[ mov IsAlpha,0 mov ebx,lpSourceData mov eax,[ebx] .if eax & 65536 mov IsAlpha,1 movzx eax,ax .endif mov wid,eax mov eax,[ebx+4] mov hei,eax mov eax,[ebx+8] mov PackedSize,eax add ebx,12 mov pPackedBuf,ebx mov eax,wid imul eax,hei mov WIDxHEI,eax .if IsAlpha lea eax,[eax+eax*2] .else shl eax,1 .endif mov pUnpackedBuf,malloc(eax) ;------------------------------------------/ ;--------[ decompress into 16-bit or 16+8-bit ]----[ invoke unpack,pPackedBuf,pUnpackedBuf,PackedSize ;--------------------------------------------------/ invoke sdCreateBlankSprite,wid,hei mov pSprite,eax mov edi,[eax].sSprite.bits mov esi,pUnpackedBuf ;------------[ deflate 16->32 ]-----------------------------------------------------------[ .if IsAlpha mov eax,pSprite mov [eax].sSprite.dwFlags,SDRAWSPRITE_HASALPHA mov ecx,WIDxHEI lea ecx,[esi+ecx*2] nextline: m2m wid2,wid align 16 @@: ;---[16->32]--------\ mov dx,[esi] mov al,dl shl al,3 mov [edi+0],al shr dx,5 mov al,dl shl al,2 mov [edi+1],al mov al,[ecx] shr dx,6 shl dl,3 mov [edi+2],dl mov byte ptr[edi+3],al ;-------------------/ add esi,2 add edi,4 inc ecx dec wid2 jnz @B dec hei jnz nextline .else nextline2: mov ecx,wid align 16 @@: ;---[16->24]--------\ mov dx,[esi] mov al,dl shl al,3 mov [edi+0],al shr dx,5 mov al,dl shl al,2 mov [edi+1],al shr dx,6 shl dl,3 mov [edi+2],dl mov byte ptr[edi+3],255 ;-------------------/ add esi,2 add edi,4 dec ecx jnz @B dec hei jnz nextline2 .endif ;-----------------------------------------------------------------------------------------/ mov eax,pSprite ret sdSpriteFromILB endp sdSpriteFromILBFile proc PUBLIC UseMost lpszFileName local nread,f1,fsiz,pPacked invoke CreateFile,lpszFileName,GENERIC_READ,0,0,OPEN_EXISTING,0,0 .if eax==-1 xor eax,eax ret .endif mov f1,eax invoke GetFileSize,f1,0 mov fsiz,eax mov pPacked,malloc(eax) invoke ReadFile,f1,pPacked,fsiz,addr nread,0 invoke CloseHandle,f1 invoke sdSpriteFromILB,pPacked free pPacked ret sdSpriteFromILBFile endp .data IID_IPicture dd 07BF80980H dw 0BF32H, 0101AH db 08BH, 0BBH, 000H, 0AAH, 000H, 030H, 00CH, 0ABH .code sdSpriteFromJPG proc PUBLIC UseMost pData,DataSize local PictuBaka,pstm,hGlobal local hBmp local pSprite mov pSprite,0 ;-----[ make hGlobal ]----------------------[ invoke GlobalAlloc,GMEM_MOVEABLE,DataSize mov hGlobal, eax test eax,eax jz _ret invoke GlobalLock, hGlobal test eax,eax je _ret ; we had an error invoke memmove,eax,pData,DataSize invoke GlobalUnlock, hGlobal ;-------------------------------------------/ ;----[ create IStream* from global memory ]------------[ CreateStreamOnHGlobal proto :DWORD,:DWORD,:DWORD OleLoadPicture proto :DWORD,:DWORD,:DWORD,:DWORD,:DWORD CoInitialize proto :DWORD CoUninitialize proto invoke CreateStreamOnHGlobal, hGlobal,1,addr pstm test eax,eax jnz _ret ;------------------------------------------------------/ ;-----[ Create IPicture from image file ]---------------------------------------[ mov ecx, PictuBaka invoke OleLoadPicture, pstm, DataSize,0, ADDR IID_IPicture, addr PictuBaka .if eax ; pstm->Release() multi mov eax,pstm | push eax | mov eax,[eax] | call dword ptr[eax+2*4] jmp _ret .endif ;-------------------------------------------------------------------------------/ ;---------[ make the pSprite ]--------------------------------------------------------------------------[ ; PictuBaka->get_Handle(&hBmp) multi lea eax,hBmp | push eax | mov eax,PictuBaka | push eax | mov eax,[eax] | call dword ptr[eax+3*4] .if !eax invoke sdSpriteFromHBITMAP,hBmp mov pSprite,eax .endif ;-------------------------------------------------------------------------------------------------------/ ;--------[ release stuff ]----------------------------------------------------[ ; PictuBaka->Release() multi mov eax,PictuBaka | push eax | mov eax,[eax] | call dword ptr[eax+2*4] ; pstm->Release() multi mov eax,pstm | push eax | mov eax,[eax] | call dword ptr[eax+2*4] ;-----------------------------------------------------------------------------/ _ret: .if hGlobal invoke GlobalFree,hGlobal .endif mov eax,pSprite ret sdSpriteFromJPG endp sdSpriteFromJPGFile proc PUBLIC UseMost lpszFileName local nread,f1,fsiz,pPacked invoke CreateFile,lpszFileName,GENERIC_READ,0,0,OPEN_EXISTING,0,0 .if eax==-1 xor eax,eax ret .endif mov f1,eax invoke GetFileSize,f1,0 mov fsiz,eax mov pPacked,malloc(eax) invoke ReadFile,f1,pPacked,fsiz,addr nread,0 invoke CloseHandle,f1 invoke sdSpriteFromJPG,pPacked,fsiz free pPacked ret sdSpriteFromJPGFile endp sdSetSourceSprite proc PUBLIC uses ecx esi edi pSprite mov esi,pSprite .if !esi mov esi,SD_BackSprite .endif mov pSourceSprite,esi mov edi,offset sSource_Data mov ecx,(sizeof sSprite)/4 rep movsd ret sdSetSourceSprite endp sdSetTargetSprite proc PUBLIC uses eax pSprite mov eax,pSprite .if !eax mov eax,SD_BackSprite .endif mov pTargetSprite,eax invoke memmove,addr sTarget_Data,eax,sizeof sSprite ret sdSetTargetSprite endp sdSpritePreprocess_AlphaFromColor proc PRIVATE UseAll pSprite,dwColor local dwSize local iR,iG,iB,aA ;-----[ compute iR,iG,iB ]-----[ mov eax,dwColor movzx edx,al mov iB,edx movzx edx,ah mov iG,edx shr eax,16 movzx edx,al mov iR,edx ;------------------------------/ mov ecx,pSprite test ecx,ecx jz _ret mov eax,[ecx].sSprite.wid imul eax,[ecx].sSprite.hei mov dwSize,eax mov edi,[ecx].sSprite.bits or [ecx].sSprite.dwFlags,SDRAWSPRITE_HASALPHA align 16 nextpix: mov eax,[edi] mov ebx,eax ;--------[ process pixel ]----------------[ ;---[ fetch sR,sG,sB ]--[ movzx ecx,al sub ecx,iB jge @F neg ecx @@: movzx edx,ah sub edx,iG jge @F neg edx @@: .if ecx<edx mov ecx,edx .endif shr eax,16 movzx edx,al sub edx,iR jge @F neg edx @@: .if ecx<edx mov ecx,edx .endif ; ecx = max alpha ;-----------------------/ ;------[ compose and put sR,sG,sB,aA ]-------[ and ebx,0FFFFFFh shl ecx,24 or ebx,ecx mov [edi],ebx ;-----------------------------------------/ add edi,4 dec dwSize jnz nextpix _ret: ret sdSpritePreprocess_AlphaFromColor endp sdSpritePreprocess_PremultiplyAlpha proc PRIVATE UseAll pSprite local dwSize mov ecx,pSprite test ecx,ecx jz _ret mov eax,[ecx].sSprite.wid imul eax,[ecx].sSprite.hei mov dwSize,eax mov edi,[ecx].sSprite.bits or [ecx].sSprite.dwFlags,SDRAWSPRITE_PREMULALPHA align 16 @@: mov eax,[edi] mov ecx,eax mov ebx,eax shr ecx,24 and eax,0FF00FFh and ebx,000FF00h imul eax,ecx imul ebx,ecx and eax,0FF00FF00h and ebx,000FF0000h shl ecx,24 or eax,ebx shr eax,8 or eax,ecx mov [edi],eax add edi,4 dec dwSize jnz @B _ret: ret sdSpritePreprocess_PremultiplyAlpha endp sdPreprocessSprite proc PUBLIC pSprite,dwOperationID,dwColor .if dwOperationID==SDPREPR_ALPHA_FROM_COLOR invoke sdSpritePreprocess_AlphaFromColor,pSprite,dwColor .elseif dwOperationID==SDPREPR_PREMULTIPLY_ALPHA invoke sdSpritePreprocess_PremultiplyAlpha,pSprite .endif ret sdPreprocessSprite endp ;=====[[ some_Macros >>===\ MAKERECT macro Rect1,x,y,wid,hei mov eax,x mov Rect1.left,eax add eax,wid mov Rect1.right,eax mov eax,y mov Rect1.top,eax add eax,hei mov Rect1.bottom,eax endm CHECKDRAWRECT macro mov eax,x mov ebx,y mov ecx,wid mov edx,hei add eax,SDDrawOffs.x add ebx,SDDrawOffs.y add ecx,eax add edx,ebx cmp eax,SDBound.left jge @F mov eax,SDBound.left @@: cmp ebx,SDBound.top jge @F mov ebx,SDBound.top @@: cmp ecx,SDBound.right jle @F mov ecx,SDBound.right @@: cmp edx,SDBound.bottom jle @F mov edx,SDBound.bottom @@: sub ecx,eax jle _ret sub edx,ebx jle _ret mov x,eax mov y,ebx mov wid,ecx mov hei,edx endm CLIPRECTADJUST macro Rect,ClipRect,ptX,ptY ;----[ clip left,top ]---------[ mov eax,ClipRect.left sub eax,Rect.left jle @F add Rect.left,eax add ptX,eax @@: mov eax,ClipRect.top sub eax,Rect.top jle @F add Rect.top,eax add ptY,eax @@: ;---------------------------------/ ;-----[ clip right,bottom ]----------[ mov eax,ClipRect.right cmp eax,Rect.right jge @F mov Rect.right,eax @@: mov eax,ClipRect.bottom cmp eax,Rect.bottom jge @F mov Rect.bottom,eax @@: ;------------------------------------/ endm COMPUTEBLTBITS macro ;---[ compute pBits ]--------------[ mov eax,y mov edi,x shl edi,2 imul eax,sTarget_Data.linesize add edi,eax add edi,sTarget_Data.bits ;----------------------------------/ ;-[ compute extraDest ]---[ mov eax,sTarget_Data.wid sub eax,wid shl eax,2 mov extraDest,eax ;-------------------------/ endm COMPUTEBLTBITS1 macro ;---[ compute pBits ]--------------[ mov eax,y mov edi,x shl edi,2 imul eax,sTarget_Data.linesize add edi,eax add edi,sTarget_Data.bits ;----------------------------------/ endm COMPUTEBLTBITS2 macro ;---[ compute pBits ]--------------[ mov eax,y mov edi,x shl edi,2 imul eax,sTarget_Data.linesize add edi,eax add edi,sTarget_Data.bits ;----------------------------------/ ;---[ compute pBits2 ]--------------[ mov eax,y2 mov esi,x2 shl esi,2 imul eax,sSource_Data.linesize add esi,eax add esi,sSource_Data.bits ;-----------------------------------/ ;--[ compute extraDest,extraSrc ]--[ mov eax,sTarget_Data.wid sub eax,wid shl eax,2 mov extraDest,eax mov eax,sSource_Data.wid sub eax,wid shl eax,2 mov extraSrc,eax ;----------------------------------/ endm COMPUTEBLTBITS3 macro ;---[ compute pBits ]--------------[ mov eax,y mov edi,x shl edi,2 imul eax,sTarget_Data.linesize add edi,eax add edi,sTarget_Data.bits ;----------------------------------/ ;---[ compute pBits2 ]--------------[ mov eax,y2 mov esi,x2 shl esi,2 imul eax,sSource_Data.linesize add esi,eax add esi,sSource_Data.bits ;-----------------------------------/ endm ;=======/ ;=====<< RectTools >>===\ MakeRect proc uses eax ecx pOutRect,x,y,wid,hei mov ecx,pOutRect MAKERECT [ecx].RECT,x,y,wid,hei ret MakeRect endp ;=======/ ;=====<< FixupSBLTparams >>===\ ; ; Called in sdBlt,sdBltTrans,sdBltAlpha, and the like ; Fixes-up the "x,y,wid,hei,x2,y2" params right into ; the stack, ZeroFlag is set if we needn't draw ; FixupSBLTparams proc pX local Dest:SRECT,BRec:SRECT assume ecx:ptr SBLTPARAM mov ecx,pX mov eax,SDDrawOffs.x add [ecx].x,eax mov eax,SDDrawOffs.y add [ecx].y,eax MAKERECT Dest,[ecx].x,[ecx].y,[ecx].wid,[ecx].hei CLIPRECTADJUST Dest,SDBound,[ecx].x2,[ecx].y2 mov eax,Dest.right sub eax,Dest.left jle _ret mov [ecx].wid,eax mov eax,Dest.bottom sub eax,Dest.top jle _ret mov [ecx].hei,eax mov eax,Dest.left mov [ecx].x,eax mov eax,Dest.top mov [ecx].y,eax assume ecx:nothing _done: xor eax,eax inc eax ret _ret: ; failed xor eax,eax ret FixupSBLTparams endp ;=======/ ;=====[[ sdEnter/Leave/ForceClip >>===\ .data? pClipStack dd ? ClipStackData db 24*40 dup (?) .code ; clipper size = 24 bytes sdLeaveClip proc PUBLIC uses eax sub pClipStack,24 mov eax,pClipStack push dword ptr[eax+ 0] push dword ptr[eax+ 4] push dword ptr[eax+ 8] push dword ptr[eax+12] push dword ptr[eax+16] push dword ptr[eax+20] pop SDBound.left pop SDBound.top pop SDBound.right pop SDBound.bottom pop SDDrawOffs.x pop SDDrawOffs.y ret sdLeaveClip endp sdEnterClip proc PUBLIC uses eax ebx ecx edx x,y,wid,hei ;-----[ push clipper ]---------------[ mov eax,pClipStack push SDBound.left push SDBound.top push SDBound.right push SDBound.bottom push SDDrawOffs.x push SDDrawOffs.y pop dword ptr[eax+ 0] pop dword ptr[eax+ 4] pop dword ptr[eax+ 8] pop dword ptr[eax+12] pop dword ptr[eax+16] pop dword ptr[eax+20] add pClipStack,24 ;------------------------------------/ mov eax,x mov ebx,y mov ecx,wid mov edx,hei add eax,SDDrawOffs.x add ebx,SDDrawOffs.y mov SDDrawOffs.x,eax mov SDDrawOffs.y,ebx add ecx,eax add edx,ebx ;------[ intersect rectangle ]----------[ cmp eax,SDBound.left jge @F mov eax,SDBound.left @@: cmp ebx,SDBound.top jge @F mov ebx,SDBound.top @@: cmp ecx,SDBound.right jle @F mov ecx,SDBound.right @@: cmp edx,SDBound.bottom jle @F mov edx,SDBound.bottom @@: ;---------------------------------------/ ;----[ check if left>right ]----[ cmp eax,ecx jle @F mov ecx,eax @@: ;-------------------------------/ ;---[ check if top>bottom ]----[ cmp ebx,edx jle @F mov edx,ebx @@: ;------------------------------/ mov SDBound.left,eax mov SDBound.top,ebx mov SDBound.right,ecx mov SDBound.bottom,edx ;------[ set zero-flag if clip is null ]-----[ .if eax!=ecx && ebx!=edx xor eax,eax inc eax .else xor eax,eax .endif ;--------------------------------------------/ ret sdEnterClip endp sdForceClip proc PUBLIC uses eax ebx wid,hei xor eax,eax mov SDDrawOffs.x,eax mov SDDrawOffs.y,eax mov SDBound.left,eax mov SDBound.top,eax mov eax,wid mov ebx,hei .if eax>sTarget_Data.wid mov eax,sTarget_Data.wid .endif .if ebx>sTarget_Data.hei mov ebx,sTarget_Data.hei .endif mov SDBound.right,eax mov SDBound.bottom,ebx ret sdForceClip endp ;=======/ ;=====[[ sdLockRect >>===\ sdLockRect proc PUBLIC UseMost pLR,x,y,wid,hei local WasClipped mov esi,pLR ;-----[ compute rectangle ]-----[ mov WasClipped,0 mov eax,x mov ebx,y mov ecx,wid mov edx,hei add eax,SDDrawOffs.x add ebx,SDDrawOffs.y add ecx,eax add edx,ebx ;-------------------------------/ ;------[ clip to SDBound ]----------[ cmp eax,SDBound.left jge @F mov eax,SDBound.left mov WasClipped,1 @@: cmp ebx,SDBound.top jge @F mov ebx,SDBound.top mov WasClipped,1 @@: cmp ecx,SDBound.right jle @F mov ecx,SDBound.right mov WasClipped,1 @@: cmp edx,SDBound.bottom jle @F mov edx,SDBound.bottom mov WasClipped,1 @@: sub ecx,eax jle _ret sub edx,ebx jle _ret ;------------------------------------/ ;---[ compute pBits ]--------------[ mov edi,eax push ebx shl edi,2 imul ebx,sTarget_Data.linesize add edi,sTarget_Data.bits add edi,ebx pop ebx ;----------------------------------/ sub eax,SDDrawOffs.x sub ebx,SDDrawOffs.y mov [esi].SDLOCKEDRECT.x,eax mov [esi].SDLOCKEDRECT.y,ebx mov [esi].SDLOCKEDRECT.wid,ecx mov [esi].SDLOCKEDRECT.hei,edx mov [esi].SDLOCKEDRECT.lpBits,edi sub eax,x sub ebx,y sub ecx,wid sub edx,hei neg ecx neg edx mov [esi].SDLOCKEDRECT.deltaX,eax mov [esi].SDLOCKEDRECT.deltaY,ebx mov [esi].SDLOCKEDRECT.deltaW,ecx mov [esi].SDLOCKEDRECT.deltaH,edx mov eax,sTarget_Data.wid mov [esi].SDLOCKEDRECT.pitch,eax mov eax,WasClipped inc eax ret _ret: xor eax,eax ret sdLockRect endp ;=======/ ;=====[[ copyright >>===\ if INCLUDE_COPYRIGHT_TEXT db 13,10,13,10,13,10 db "======================================================================",13,10 db "======================================================================",13,10 db "* sDraw Library: COPYRIGHT Ultrano Software, *",13,10 db "* Ilian Dinev *",13,10 db "* http://www.ultranos.com *",13,10 db "======================================================================",13,10 db "======================================================================",13,10 db 13,10,13,10,13,10 endif ;=======/ ;=====[[ sDrawRect/RectFrame/RectFrame3D >>===\ sDrawLineH proc PUBLIC UseAll x,y,wid,dwColor mov ecx,x mov edi,y mov eax,wid add ecx,SDDrawOffs.x add edi,SDDrawOffs.y add eax,ecx cmp edi,SDBound.top jl _ret cmp edi,SDBound.bottom jge _ret cmp ecx,SDBound.left jge @F mov ecx,SDBound.left @@: cmp eax,SDBound.right jle @F mov eax,SDBound.right @@: sub eax,ecx jle _ret imul edi,sTarget_Data.linesize shl ecx,2 add edi,sTarget_Data.bits add edi,ecx mov ecx,eax mov eax,dwColor rep stosd _ret: ret sDrawLineH endp sDrawLineV proc PUBLIC UseAll x,y,hei,dwColor mov ecx,x mov edi,y mov eax,hei add ecx,SDDrawOffs.x add edi,SDDrawOffs.y add eax,edi cmp ecx,SDBound.left jl _ret cmp ecx,SDBound.right jge _ret cmp edi,SDBound.top jge @F mov edi,SDBound.top @@: cmp eax,SDBound.bottom jle @F mov eax,SDBound.bottom @@: sub eax,edi jle _ret imul edi,sTarget_Data.linesize shl ecx,2 add edi,sTarget_Data.bits add edi,ecx mov ecx,dwColor align 16 @@: mov [edi],ecx add edi,sTarget_Data.linesize dec eax jnz @B _ret: ret sDrawLineV endp sDrawRect proc PUBLIC UseAll x,y,wid,hei,dwColor local extraDest CHECKDRAWRECT COMPUTEBLTBITS mov eax,dwColor mov esi,wid mov ebx,hei mov edx,extraDest cld align 16 @@: mov ecx,esi rep stosd add edi,edx dec ebx jnz @B _ret: ret sDrawRect endp sDrawRectFrame proc PUBLIC UseAll x,y,wid,hei,dwColor cmp wid,0 jle _ret cmp hei,0 jle _ret invoke sDrawLineH,x,y,wid,dwColor ; top mov eax,y add eax,hei dec eax invoke sDrawLineH,x,eax,wid,dwColor ; bottom invoke sDrawLineV,x,y,hei,dwColor ; left mov eax,x add eax,wid dec eax invoke sDrawLineV,eax,y,hei,dwColor ; right _ret: ret sDrawRectFrame endp sDrawRectFrame3D proc PUBLIC UseAll x,y,wid,hei,dwColor,dwLightColor,dwDarkColor ;-------[ if too small ]---------------------[ cmp wid,0 jle _ret cmp hei,0 jle _ret .if wid<3 || hei<3 invoke sDrawRect,x,y,wid,hei,dwColor jmp _ret .endif ;--------------------------------------------/ mov ecx,wid mov edx,hei mov esi,x mov edi,y dec edx invoke sDrawLineH,esi,edi,ecx,dwLightColor ; top line inc edi dec edx dec ecx invoke sDrawLineV,esi,edi,edx,dwLightColor ; left line inc esi dec ecx invoke sDrawRect,esi,edi,ecx,edx,dwColor ; base color add esi,ecx invoke sDrawLineV,esi,edi,edx,dwDarkColor ; right line add edi,edx invoke sDrawLineH,x,edi,wid,dwDarkColor ; bottom line _ret: ret sDrawRectFrame3D endp ;=======/ ;=====[[ sBlt - normal >>===\ sBlt proc PUBLIC UseAll x,y,wid,hei,x2,y2 local extraDest,extraSrc local Alpha,invAlpha,wid2 invoke FixupSBLTparams,addr x jz _ret COMPUTEBLTBITS2 .if !(sSource_Data.dwFlags & SDRAWSPRITE_HASALPHA) ;----------[ draw a normal solid bitmap ]-------[ mov ebx,hei mov eax,extraSrc mov edx,extraDest align 16 @@: mov ecx,wid rep movsd add esi,eax add edi,edx dec ebx jnz @B ;-----------------------------------------------/ ret .else .if sSource_Data.dwFlags & SDRAWSPRITE_PREMULALPHA ;---------[ draw a bitmap that has premultiplied alpha-channel ]-------------------------[ @@: m2m wid2,wid align 16 _nextpix: mov eax,[esi] mov ecx,[edi] mov ebx,eax shr ebx,24 jz _zeroalpha sub ebx,256 neg ebx mov edx,ecx and ecx,0FF00FFh and edx,000FF00h imul ecx,ebx imul edx,ebx and ecx,0FF00FF00h and edx,000FF0000h or ecx,edx shr ecx,8 add ecx,eax mov [edi],ecx _zeroalpha: add esi,4 add edi,4 dec wid2 jnz _nextpix add esi,extraSrc add edi,extraDest dec hei jnz @B ret ;----------------------------------------------------------------------------------------/ .else ;-----[ draw a bitmap that has alpha-channel ]-------[ @@: m2m wid2,wid align 16 _nextpix2: mov eax,[esi] mov ecx,[edi] ;-----[ get alpha ]-----[ mov edx,256 mov ebx,eax shr ebx,24 jz _zeroalpha2 sub edx,ebx mov Alpha,ebx mov invAlpha,edx ;-----------------------/ mov ebx,eax mov edx,ecx and eax,0FF00FFh and ecx,0FF00FFh and ebx,000FF00h and edx,000FF00h imul eax,Alpha imul ecx,invAlpha imul ebx,Alpha imul edx,invAlpha add eax,ecx add ebx,edx and eax,0FF00FF00h and ebx,000FF0000h or eax,ebx shr eax,8 mov [edi],eax _zeroalpha2: add esi,4 add edi,4 dec wid2 jnz _nextpix2 add esi,extraSrc add edi,extraDest dec hei jnz @B ret ;----------------------------------------------------/ .endif .endif _ret: ret sBlt endp ;=======/ sBltTile proc PUBLIC uses eax ebx ecx edx TileX,TileY,TileWidth,TileHeight,SpriteX,SpriteY,SpriteWid,SpriteHei,StartX,StartY invoke sdEnterClip,TileX,TileY,TileWidth,TileHeight neg StartX neg StartY mov edx,StartY .while edx<TileHeight mov ecx,StartX .while ecx<TileWidth invoke sBlt,ecx,edx,SpriteWid,SpriteHei,SpriteX,SpriteY add ecx,SpriteWid .endw add edx,SpriteHei .endw invoke sdLeaveClip ret sBltTile endp ;=====[[ sdGet/Set/SetPixelA >>===\ sdGetPixel proc PUBLIC uses ecx edx x,y mov ecx,x mov edx,y add ecx,SDDrawOffs.x add edx,SDDrawOffs.y xor eax,eax cmp ecx,SDBound.left jl _ret cmp ecx,SDBound.right jge _ret cmp edx,SDBound.top jl _ret cmp edx,SDBound.bottom jge _ret imul edx,sTarget_Data.wid mov eax,sTarget_Data.bits add ecx,edx mov eax,[eax+ecx*4] and eax,0FFFFFFh _ret: ret sdGetPixel endp sdSetPixel proc PUBLIC uses eax ecx edx x,y,dwColor mov ecx,x mov edx,y add ecx,SDDrawOffs.x add edx,SDDrawOffs.y xor eax,eax cmp ecx,SDBound.left jl _ret cmp ecx,SDBound.right jge _ret cmp edx,SDBound.top jl _ret cmp edx,SDBound.bottom jge _ret imul edx,sTarget_Data.wid mov eax,sTarget_Data.bits add ecx,edx mov edx,dwColor mov [eax+ecx*4],edx _ret: ret sdSetPixel endp sdSetPixelA proc PUBLIC uses eax ecx ebx edx edi x,y,dwColor,Alpha cmp Alpha,0 jle _ret mov ecx,x mov edx,y add ecx,SDDrawOffs.x add edx,SDDrawOffs.y xor eax,eax cmp ecx,SDBound.left jl _ret cmp ecx,SDBound.right jge _ret cmp edx,SDBound.top jl _ret cmp edx,SDBound.bottom jge _ret ;---[ compute edi ]----------------[ imul edx,sTarget_Data.wid mov edi,sTarget_Data.bits add ecx,edx lea edi,[edi+ecx*4] ;----------------------------------/ ;---[ compute invAlpha ]---------[ .if Alpha>255 push dwColor pop dword ptr[edi] jmp _ret .endif mov edx,256 sub edx,Alpha mov y,edx ; y = invAlpha ;--------------------------------/ mov eax,dwColor mov ecx,[edi] mov ebx,eax mov edx,ecx and eax,0FF00FFh and ecx,0FF00FFh and ebx,000FF00h and edx,000FF00h imul eax,Alpha imul ecx,y;invAlpha imul ebx,Alpha imul edx,y;invAlpha add eax,ecx add ebx,edx and eax,0FF00FF00h and ebx,000FF0000h or eax,ebx shr eax,8 mov [edi],eax _ret: ret sdSetPixelA endp ;=======/ ;=====[[ sDrawLine - normal >>===\ SD_DRAWLINE_EXTRALAPHA equ 64 sDrawLine proc PUBLIC UseAll x,y,x2,y2,dwColor local idx,idy local zdx,zdy ;-----[ check if completely outside cliprect ]-----\ mov esi,SDDrawOffs.x mov edi,SDDrawOffs.y mov eax,x mov ebx,y mov ecx,x2 mov edx,y2 add eax,esi add ebx,edi add ecx,esi add edx,edi cmp eax,ecx jle @F xchg eax,ecx @@: cmp ebx,edx jle @F xchg ebx,edx @@: ; eax=minx, ebx=miny, ecx=maxx, edx=maxy cmp eax,SDBound.right jg _ret cmp ebx,SDBound.bottom jg _ret cmp ecx,SDBound.left jl _ret cmp edx,SDBound.top jl _ret ;--------------------------------------------------/ ;--------[ check if too long ]---------------\ sub ecx,eax sub edx,ebx add ecx,edx .if ecx>100 mov eax,x mov ecx,y add eax,x2 add ecx,y2 sar eax,1 sar ecx,1 invoke sDrawLine,x,y,eax,ecx,dwColor invoke sDrawLine,eax,ecx,x2,y2,dwColor ret .endif ;--------------------------------------------/ mov idx,-1 mov idy,-1 mov eax,x sub eax,x2 mov zdx,eax .if sign? neg eax neg idx .endif mov edx,y sub edx,y2 mov zdy,edx .if sign? neg edx neg idy .endif .if zdx==0 && zdy==0 invoke sdSetPixel,x,y,dwColor ret .endif .if eax<=edx ;mov dwColor,255 shl zdx,16 fild zdx fidiv zdy fimul idy fistp idx mov eax,x shl eax,16 mov ecx,y .while ecx!=y2 mov edx,eax sar edx,16 movzx ebx,ah push ebx sub ebx,255+SD_DRAWLINE_EXTRALAPHA neg ebx invoke sdSetPixelA,edx,ecx,dwColor,ebx pop ebx inc edx add ebx,SD_DRAWLINE_EXTRALAPHA invoke sdSetPixelA,edx,ecx,dwColor,ebx add eax,idx add ecx,idy .endw ret .else shl zdy,16 fild zdy fidiv zdx fimul idx fistp idy mov eax,x mov ecx,y shl ecx,16 .while eax!=x2 mov edx,ecx sar edx,16 movzx ebx,ch push ebx sub ebx,255+SD_DRAWLINE_EXTRALAPHA neg ebx invoke sdSetPixelA,eax,edx,dwColor,ebx pop ebx inc edx add ebx,SD_DRAWLINE_EXTRALAPHA invoke sdSetPixelA,eax,edx,dwColor,ebx add eax,idx add ecx,idy .endw ret .endif _ret: ret sDrawLine endp ;=======/ ;=====<< sDrawFastLine >>===\ sDrawFastLine proc PUBLIC UseAll x0,y0,x1,y1,dwColor local steep local stepy,stepx ;-----[ check if completely outside cliprect ]-----\ mov esi,SDDrawOffs.x mov edi,SDDrawOffs.y mov eax,x0 mov ebx,y0 mov ecx,x1 mov edx,y1 .if eax==ecx && ebx==edx invoke sdSetPixel,eax,ebx,dwColor .endif add eax,esi add ebx,edi add ecx,esi add edx,edi cmp eax,ecx jle @F xchg eax,ecx @@: cmp ebx,edx jle @F xchg ebx,edx @@: ; eax=minx, ebx=miny, ecx=maxx, edx=maxy cmp eax,SDBound.right jg _ret cmp ebx,SDBound.bottom jg _ret cmp ecx,SDBound.left jl _ret cmp edx,SDBound.top jl _ret sub x0,esi sub y0,esi sub x1,esi sub y1,esi ;--------------------------------------------------/ ;------[ check steepness ]-----\ mov eax,y0 sub eax,y1 mov edx,x0 sub edx,x1 mov ecx,eax sar ecx,31 add eax,ecx xor eax,ecx mov ecx,edx sar ecx,31 add edx,ecx xor edx,ecx cmp eax,edx mov steep,0 mov stepx,1 mov stepy,1 mov eax,x0 ; eax = x0 mov ebx,y0 ; ebx = y0 mov ecx,x1 ; ecx = x1 mov edx,y1 ; edx = y1 .if !SIGN? ; abs(y1 - y0) > abs(x1 - x0) mov steep,1 xchg eax,ebx xchg ecx,edx .endif cmp eax,ecx jle @F neg stepx @@: mov x0,eax mov y0,ebx mov x1,ecx mov y1,edx ;------------------------------/ sub ecx,eax ; ecx = deltax mov esi,ecx sar esi,31 add ecx,esi xor ecx,esi mov edi,ecx shr edi,1 ; edi = deltax/2 sub edx,ebx mov esi,edx sar esi,31 add edx,esi xor edx,esi ; edx = deltay xor esi,esi ; esi = error cmp ebx,y1 jl @F neg stepy @@: ; now EAX=x0, EBX=y0, ECX=deltax, EDX=deltay, ESI=error, EDI=deltax/2 align 16 next_X: cmp eax,x1 je _ret .if steep invoke sdSetPixel,ebx,eax,dwColor .else invoke sdSetPixel,eax,ebx,dwColor .endif add eax,stepx add esi,edx ; error+=deltay cmp esi,edi jl next_X add ebx,stepy sub esi,ecx jmp next_X _ret: ret sDrawFastLine endp ;=======/ ;=====<< sDrawLineCustom >>===\ sDrawLineCustom proc PUBLIC UseAll x0,y0,x1,y1,pfCallback,dwWidth,dwColor local steep local stepy,stepx ;-----[ check if completely outside cliprect ]-----\ mov esi,SDDrawOffs.x mov edi,SDDrawOffs.y mov eax,x0 mov ebx,y0 mov ecx,x1 mov edx,y1 add eax,esi add ebx,edi add ecx,esi add edx,edi cmp eax,ecx jle @F xchg eax,ecx @@: cmp ebx,edx jle @F xchg ebx,edx @@: mov esi,dwWidth mov edi,esi shr esi,1 sub edi,esi sub eax,esi sub ebx,esi add ecx,edi add edx,edi ; eax=minx, ebx=miny, ecx=maxx, edx=maxy cmp eax,SDBound.right jg _ret cmp ebx,SDBound.bottom jg _ret cmp ecx,SDBound.left jl _ret cmp edx,SDBound.top jl _ret sub x0,esi sub y0,esi sub x1,esi sub y1,esi ;--------------------------------------------------/ ;------[ check steepness ]-----\ mov eax,y0 sub eax,y1 mov edx,x0 sub edx,x1 mov ecx,eax sar ecx,31 add eax,ecx xor eax,ecx mov ecx,edx sar ecx,31 add edx,ecx xor edx,ecx cmp eax,edx mov steep,0 mov stepx,1 mov stepy,1 mov eax,x0 ; eax = x0 mov ebx,y0 ; ebx = y0 mov ecx,x1 ; ecx = x1 mov edx,y1 ; edx = y1 .if !SIGN? ; abs(y1 - y0) > abs(x1 - x0) mov steep,1 xchg eax,ebx xchg ecx,edx .endif cmp eax,ecx jle @F neg stepx @@: mov x0,eax mov y0,ebx mov x1,ecx mov y1,edx ;------------------------------/ sub ecx,eax ; ecx = deltax mov esi,ecx sar esi,31 add ecx,esi xor ecx,esi mov edi,ecx shr edi,1 ; edi = deltax/2 sub edx,ebx mov esi,edx sar esi,31 add edx,esi xor edx,esi ; edx = deltay xor esi,esi ; esi = error cmp ebx,y1 jl @F neg stepy @@: ; now EAX=x0, EBX=y0, ECX=deltax, EDX=deltay, ESI=error, EDI=deltax/2 align 16 next_X: cmp eax,x1 je _ret push dwColor .if steep push eax push ebx .else push ebx push eax .endif call pfCallback add eax,stepx add esi,edx ; error+=deltay cmp esi,edi jl next_X add ebx,stepy sub esi,ecx jmp next_X _ret: ret sDrawLineCustom endp ;=======/ ;=====<< sDrawBSpline >>===\ .data BSplineShader dd 0 BSplineShadeWid dd 1 .code sDrawBSpline proc PUBLIC UseAll pSpline:ptr SDSPLINE,numPoints,dwColor local xa,xb,xc local ya,yb,yc local deltaT:real8,curT:real8 local curX,curY,nX,nY mov ecx,pSpline test ecx,ecx jz _ret assume ecx:ptr SDSPLINE ; C = 3.0 * (cp[1] - cp[0]); mov eax,[ecx].p1.x mov edx,[ecx].p1.y sub eax,[ecx].p0.x sub edx,[ecx].p0.y lea eax,[eax+eax*2] lea edx,[edx+edx*2] mov xc,eax mov yc,edx ; B = 3.0 * (cp[2] - cp[1]) - C; mov eax,[ecx].p2.x mov edx,[ecx].p2.y sub eax,[ecx].p1.x sub edx,[ecx].p1.y lea eax,[eax+eax*2] lea edx,[edx+edx*2] sub eax,xc sub edx,yc mov xb,eax mov yb,edx ; A = cp[3].x - cp[0].x - cx - bx; mov eax,[ecx].p3.x mov edx,[ecx].p3.y sub eax,[ecx].p0.x sub edx,[ecx].p0.y sub eax,xc sub edx,yc sub eax,xb sub edx,yb mov xa,eax mov ya,edx ;--------[ compute numPoints if necessary ]----------\ .if numPoints==0 ;----[ compute average point of p1 & p2 ]--\ mov eax,[ecx].p2.x mov edx,[ecx].p2.y add eax,[ecx].p1.x add edx,[ecx].p1.y sar eax,1 sar edx,1 mov nX,eax ; store it temporarily in nX:nY mov nY,eax ;------------------------------------------/ ;----[ compute sqr of len p0:pN ]--\ fild [ecx].p0.x fisub nX fmul ST,ST fild [ecx].p0.y fisub nY fmul ST,ST fadd ;----------------------------------/ ;----[ compute sqr of len p3:pN ]--\ fild [ecx].p3.x fisub nX fmul ST,ST fild [ecx].p3.y fisub nY fmul ST,ST fadd ;----------------------------------/ fadd fsqrt fistp numPoints shr numPoints,3 add numPoints,4 .endif ;----------------------------------------------------/ fld1 fidiv numPoints fst deltaT fstp curT m2m curX,[ecx].p0.x m2m curY,[ecx].p0.y @@: ; nX = (ax * tCubed) + (bx * tSquared) + (cx * t) + cp[0].x; fild [ecx].p0.x fild xc fmul curT fadd fild xb fmul curT fmul curT fadd fild xa fmul curT fmul curT fmul curT fadd fistp nX ; nY = (ay * tCubed) + (by * tSquared) + (cy * t) + cp[0].y; fild [ecx].p0.y fild yc fmul curT fadd fild yb fmul curT fmul curT fadd fild ya fmul curT fmul curT fmul curT fadd fistp nY .if !BSplineShader invoke sDrawLine,curX,curY,nX,nY,dwColor .else invoke sDrawLineCustom,curX,curY,nX,nY,BSplineShader,BSplineShadeWid,dwColor .endif m2m curX,nX m2m curY,nY fld curT fadd deltaT fstp curT dec numPoints jnz @B assume ecx:nothing _ret: ret sDrawBSpline endp sDrawBSplineShade proc PUBLIC pSpline:ptr SDSPLINE,numPoints,dwColor,pShadeFunc,ShadeWid m2m BSplineShader,pShadeFunc m2m BSplineShadeWid,ShadeWid invoke sDrawBSpline,pSpline,numPoints,dwColor mov BSplineShader,0 mov BSplineShadeWid,1 ret sDrawBSplineShade endp ;=======/ sBltTrans proc PUBLIC UseAll x,y,wid,hei,x2,y2 local Alpha,invAlpha,wid2 invoke FixupSBLTparams,addr x jz _ret COMPUTEBLTBITS3 sub esi,4 sub edi,4 mov ebx,SD_TransparentColor nextline: mov ecx,wid align 16 @@: mov eax,[esi+ecx*4] and eax,0FFFFFFh .if eax!=ebx mov [edi+ecx*4],eax .endif dec ecx jnz @B add esi,sSource_Data.linesize add edi,sTarget_Data.linesize dec hei jnz nextline _ret: ret sBltTrans endp sBltTransAlpha proc PUBLIC UseAll x,y,wid,hei,x2,y2,Alpha local extraDest,extraSrc local wid2,invAlpha,Alpha2 ;---[ check alpha ]--------------------[ cmp Alpha,0 jle _ret .if Alpha>255 invoke sBltTrans,x,y,wid,hei,x2,y2 jmp _ret .endif ;--------------------------------------/ invoke FixupSBLTparams,addr x jz _ret COMPUTEBLTBITS2 mov eax,256 sub eax,Alpha mov invAlpha,eax @@: m2m wid2,wid align 16 _nextpix: mov eax,[esi] mov ecx,[edi] mov ebx,eax xor eax,SD_TransparentColor mov edx,ecx shl eax,8 jz skippix mov eax,ebx and eax,0FF00FFh and ecx,0FF00FFh and ebx,000FF00h and edx,000FF00h imul eax,Alpha imul ecx,invAlpha imul ebx,Alpha imul edx,invAlpha add eax,ecx add ebx,edx and eax,0FF00FF00h and ebx,000FF0000h add eax,ebx shr eax,8 mov [edi],eax ; out = (dcolor*(256-alpha) + color*alpha)/256 = ; dcolor*256 - dcolor*alpha + color*alpha = dcolor*256 + alpha*(color-dcolor) skippix: add esi,4 add edi,4 dec wid2 jnz _nextpix add esi,extraSrc add edi,extraDest dec hei jnz @B _ret: ret sBltTransAlpha endp ;=====<< sBltAlpha >>===\ sBltAlpha proc PUBLIC UseAll x,y,wid,hei,x2,y2,Alpha local extraDest,extraSrc local wid2,invAlpha,Alpha2 ;---[ check alpha ]--------------------[ cmp Alpha,0 jle _ret .if Alpha>255 invoke sBlt,x,y,wid,hei,x2,y2 jmp _ret .endif ;--------------------------------------/ invoke FixupSBLTparams,addr x jz _ret COMPUTEBLTBITS2 .if !(sSource_Data.dwFlags & SDRAWSPRITE_HASALPHA) mov eax,256 sub eax,Alpha mov invAlpha,eax @@: m2m wid2,wid align 16 _nextpix: mov eax,[esi] mov ecx,[edi] mov ebx,eax mov edx,ecx and eax,0FF00FFh and ecx,0FF00FFh and ebx,000FF00h and edx,000FF00h imul eax,Alpha imul ecx,invAlpha imul ebx,Alpha imul edx,invAlpha add eax,ecx add ebx,edx and eax,0FF00FF00h and ebx,000FF0000h add eax,ebx shr eax,8 mov [edi],eax ; out = (dcolor*(256-alpha) + color*alpha)/256 = ; dcolor*256 - dcolor*alpha + color*alpha = dcolor*256 + alpha*(color-dcolor) add esi,4 add edi,4 dec wid2 jnz _nextpix add esi,extraSrc add edi,extraDest dec hei jnz @B .else ;-----[ draw a bitmap that has alpha-channel ]-------[ @@: m2m wid2,wid align 16 _nextpix2: mov eax,[esi] mov ecx,[edi] ;-----[ get alpha ]-----[ mov edx,256 mov ebx,eax shr ebx,24 jz _zeroalpha2 imul ebx,Alpha shr ebx,8 jz _zeroalpha2 sub edx,ebx mov Alpha2,ebx mov invAlpha,edx ;-----------------------/ mov ebx,eax mov edx,ecx and eax,0FF00FFh and ecx,0FF00FFh and ebx,000FF00h and edx,000FF00h imul eax,Alpha2 imul ecx,invAlpha imul ebx,Alpha2 imul edx,invAlpha add eax,ecx add ebx,edx and eax,0FF00FF00h and ebx,000FF0000h or eax,ebx shr eax,8 mov [edi],eax _zeroalpha2: add esi,4 add edi,4 dec wid2 jnz _nextpix2 add esi,extraSrc add edi,extraDest dec hei jnz @B ret ;----------------------------------------------------/ .endif _ret: ret sBltAlpha endp ;=======/ sDrawRectAlpha proc PUBLIC UseAll x,y,wid,hei,dwColor,Alpha ;----[ check params ]------------------------[ cmp Alpha,0 jle _ret .if Alpha>255 invoke sDrawRect,x,y,wid,hei,dwColor jmp _ret .endif ;--------------------------------------------/ CHECKDRAWRECT COMPUTEBLTBITS1 ;---[ premultiply dwColor ]---[ mov eax,dwColor mov ebx,eax and eax,0FF00FFh and ebx,000FF00h imul eax,Alpha imul ebx,Alpha and eax,0FF00FF00h and ebx,000FF0000h or eax,ebx shr eax,8 mov dwColor,eax ;-----------------------------/ sub edi,4 mov ebx,256 sub ebx,Alpha ; ebx = invAlpha .if Alpha!=128 nextline: mov ecx,wid align 16 @@: mov eax,[edi+ecx*4] mov edx,eax and eax,0FF00FFh and edx,000FF00h imul eax,ebx imul edx,ebx and eax,0FF00FF00h and edx,000FF0000h or eax,edx shr eax,8 add eax,dwColor mov [edi+ecx*4],eax dec ecx jnz @B add edi,sTarget_Data.linesize dec hei jnz nextline ret .else ; Alpha=128 mov edx,dwColor mov ebx,7F7F7Fh nextline2: mov ecx,wid align 16 @@: mov eax,[edi+ecx*4] shr eax,1 and eax,ebx add eax,edx mov [edi+ecx*4],eax dec ecx jnz @B add edi,sTarget_Data.linesize dec hei jnz nextline2 .endif _ret: ret sDrawRectAlpha endp sDrawLineH_HalfAlpha proc PUBLIC uses eax edx ecx edi x,y,wid,dwColor mov ecx,x mov edi,y mov eax,wid add ecx,SDDrawOffs.x add edi,SDDrawOffs.y add eax,ecx cmp edi,SDBound.top jl _ret cmp edi,SDBound.bottom jge _ret cmp ecx,SDBound.left jge @F mov ecx,SDBound.left @@: cmp eax,SDBound.right jle @F mov eax,SDBound.right @@: sub eax,ecx jle _ret imul edi,sTarget_Data.linesize shl ecx,2 add edi,sTarget_Data.bits add edi,ecx sub edi,4 mov ecx,dwColor and ecx,0FEFEFEh align 16 @@: mov edx,[edi+eax*4] and edx,0FEFEFEh add edx,ecx shr edx,1 mov [edi+eax*4],edx dec eax jnz @B ret _ret: ret sDrawLineH_HalfAlpha endp sDrawLineV_HalfAlpha proc PUBLIC uses eax edx ecx edi x,y,hei,dwColor mov ecx,x mov edi,y mov eax,hei add ecx,SDDrawOffs.x add edi,SDDrawOffs.y add eax,edi cmp ecx,SDBound.left jl _ret cmp ecx,SDBound.right jge _ret cmp edi,SDBound.top jge @F mov edi,SDBound.top @@: cmp eax,SDBound.bottom jle @F mov eax,SDBound.bottom @@: sub eax,edi jle _ret imul edi,sTarget_Data.linesize shl ecx,2 add edi,sTarget_Data.bits add edi,ecx mov ecx,dwColor and ecx,0FEFEFEh align 16 @@: mov edx,[edi] and edx,0FEFEFEh add edx,ecx shr edx,1 mov [edi],edx add edi,sTarget_Data.linesize dec eax jnz @B _ret: ret sDrawLineV_HalfAlpha endp ;=====[[ sBltAdd+Fade >>===\ sBltAdd proc PUBLIC UseAll x,y,wid,hei,x2,y2 local extraDest,extraSrc local Num16px,Num1px invoke FixupSBLTparams,addr x jz _ret COMPUTEBLTBITS2 mov eax,wid shr eax,4 mov Num16px,eax mov eax,wid and eax,15 mov Num1px,eax ;----------[ draw a normal solid bitmap ]-------[ nextline: mov ecx,Num16px .if ecx align 8 @@: movq mm0,[edi] movq mm1,[esi] movq mm2,[edi+8] movq mm3,[esi+8] movq mm4,[edi+16] movq mm5,[esi+16] movq mm6,[edi+24] movq mm7,[esi+24] paddusb mm0,mm1 paddusb mm2,mm3 paddusb mm4,mm5 paddusb mm6,mm7 movq [edi],mm0 movq [edi+8],mm2 movq [edi+16],mm4 movq [edi+24],mm6 add esi,32 add edi,32 movq mm0,[edi] movq mm1,[esi] movq mm2,[edi+8] movq mm3,[esi+8] movq mm4,[edi+16] movq mm5,[esi+16] movq mm6,[edi+24] movq mm7,[esi+24] paddusb mm0,mm1 paddusb mm2,mm3 paddusb mm4,mm5 paddusb mm6,mm7 movq [edi],mm0 movq [edi+8],mm2 movq [edi+16],mm4 movq [edi+24],mm6 add esi,32 add edi,32 dec ecx jnz @B .endif mov ecx,Num1px .if ecx @@: movd mm0,[esi] movd mm1,[edi] paddusb mm0,mm1 movd [edi],mm0 add esi,4 add edi,4 dec ecx jnz @B .endif add esi,extraSrc add edi,extraDest dec hei jnz nextline ;-----------------------------------------------/ emms _ret: ret sBltAdd endp sBltAddFade proc PUBLIC UseAll x,y,wid,hei,x2,y2,Fader local extraDest,extraSrc cmp Fader,0 jle _ret .if Fader>255 invoke sBltAdd,x,y,wid,hei,x2,y2 jmp _ret .endif invoke FixupSBLTparams,addr x jz _ret COMPUTEBLTBITS2 ;--[ set masks ]--[ mov eax,0FF00FFh mov ecx,000FF00h movd mm6,eax movd mm7,ecx mov eax,Fader mov edx,eax shl edx,16 or eax,edx movd mm5,eax ;-----------------/ ;----------[ draw a normal solid bitmap ]-------[ nextline: mov ecx,wid align 16 @@: movd mm0,[esi] movd mm1,[edi] movq mm2,mm0 pand mm0,mm6 pand mm2,mm7 psrad mm2,8 pmullw mm0,mm5 pmullw mm2,mm5 psraw mm0,8 pand mm0,mm6 pand mm2,mm7 paddusb mm1,mm0 paddusb mm1,mm2 movd [edi],mm1 add esi,4 add edi,4 dec ecx jnz @B add esi,extraSrc add edi,extraDest dec hei jnz nextline ;-----------------------------------------------/ emms _ret: ret sBltAddFade endp ;=======/ sDrawRectAddFade proc PUBLIC UseAll x,y,wid,hei,dwColor,Alpha ;----[ check params ]------------------------[ cmp Alpha,0 jle _ret .if Alpha>256 mov Alpha,256 .endif ;--------------------------------------------/ CHECKDRAWRECT COMPUTEBLTBITS1 ;---[ premultiply dwColor ]---[ mov eax,dwColor mov ebx,eax and eax,0FF00FFh and ebx,000FF00h imul eax,Alpha imul ebx,Alpha and eax,0FF00FF00h and ebx,000FF0000h or eax,ebx shr eax,8 movd mm1,eax ;-----------------------------/ sub edi,4 align 16 nextline: mov ecx,wid align 16 @@: movd mm0,[edi+ecx*4] paddusb mm0,mm1 movd [edi+ecx*4],mm0 dec ecx jnz @B sub edi,sTarget_Data.linesize dec hei jnz nextline emms _ret: ret sDrawRectAddFade endp sDrawLineHAdd proc PUBLIC uses eax edx ecx edi x,y,wid,dwColor mov ecx,x mov edi,y mov eax,wid add ecx,SDDrawOffs.x add edi,SDDrawOffs.y add eax,ecx cmp edi,SDBound.top jl _ret cmp edi,SDBound.bottom jge _ret cmp ecx,SDBound.left jge @F mov ecx,SDBound.left @@: cmp eax,SDBound.right jle @F mov eax,SDBound.right @@: sub eax,ecx jle _ret imul edi,sTarget_Data.linesize shl ecx,2 add edi,sTarget_Data.bits add edi,ecx sub edi,4 mov ecx,dwColor and ecx,0FEFEFEh movd mm1,ecx align 16 @@: movd mm0,[edi+eax*4] paddusb mm0,mm1 movd [edi+eax*4],mm0 dec eax jnz @B emms _ret: ret sDrawLineHAdd endp sDrawLineVAdd proc PUBLIC uses eax edx ecx edi x,y,hei,dwColor mov ecx,x mov edi,y mov eax,hei add ecx,SDDrawOffs.x add edi,SDDrawOffs.y add eax,edi cmp ecx,SDBound.left jl _ret cmp ecx,SDBound.right jge _ret cmp edi,SDBound.top jge @F mov edi,SDBound.top @@: cmp eax,SDBound.bottom jle @F mov eax,SDBound.bottom @@: sub eax,edi jle _ret imul edi,sTarget_Data.linesize shl ecx,2 add edi,sTarget_Data.bits add edi,ecx mov ecx,dwColor and ecx,0FEFEFEh movd mm1,ecx align 16 @@: movd mm0,[edi] paddusb mm0,mm1 movd [edi],mm0 sub edi,sTarget_Data.linesize dec eax jnz @B emms _ret: ret sDrawLineVAdd endp sBltTint proc PUBLIC UseAll x,y,wid,hei,x2,y2,dwColor local extraDest,extraSrc local wid2 local TintRB,TintG invoke FixupSBLTparams,addr x jz _ret COMPUTEBLTBITS2 ; ; NOTE ; ; uses only the alpha-channel of source-bitmap mov eax,dwColor mov edx,eax and eax,0FF00FFh and edx,000FF00h mov TintRB,eax mov TintG,edx @@: m2m wid2,wid align 16 _nextpix: mov eax,[esi] mov ecx,[edi] ;-----[ get alpha ]-----[ shr eax,24 mov ebx,256 sub ebx,eax ; eax = Alpha ; ebx = invAlpha ;-----------------------/ mov edx,ecx and ecx,0FF00FFh and edx,000FF00h imul ecx,ebx imul edx,ebx mov ebx,eax imul eax,TintRB imul ebx,TintG add eax,ecx add ebx,edx and eax,0FF00FF00h and ebx,000FF0000h add eax,ebx shr eax,8 mov [edi],eax ; out = (dcolor*(256-alpha) + color*alpha)/256 = ; dcolor*256 - dcolor*alpha + color*alpha = dcolor*256 + alpha*(color-dcolor) add esi,4 add edi,4 dec wid2 jnz _nextpix add esi,extraSrc add edi,extraDest dec hei jnz @B _ret: ret sBltTint endp sBltTintDirect proc PUBLIC UseAll x,y,wid,hei,x2,y2,dwOriginalColor,dwColor local extraDest,extraSrc local wid2 local TintRB,TintG local iR,iG,iB invoke FixupSBLTparams,addr x jz _ret COMPUTEBLTBITS2 ; ; NOTE ; ; doesn't use the alpha-channel of the source-bitmap ;--[ compute TintRB,TintG ]----[ mov eax,dwColor mov edx,eax and eax,0FF00FFh and edx,000FF00h mov TintRB,eax mov TintG,edx ;------------------------------/ ;-----[ compute iR,iG,iB ]-----[ mov eax,dwOriginalColor movzx edx,al mov iB,edx movzx edx,ah mov iG,edx shr eax,16 movzx edx,al mov iR,edx ;------------------------------/ _nextline: m2m wid2,wid align 16 _nextpix: mov eax,[esi] ;---[ fetch sR,sG,sB ]--[ movzx ecx,al sub ecx,iB jge @F neg ecx @@: movzx edx,ah sub edx,iG jge @F neg edx @@: add ecx,edx shr eax,16 movzx edx,al sub edx,iR jge @F neg edx @@: add ecx,edx .if ecx>256 mov ecx,256 .endif ; ecx = max alpha ;-----------------------/ ;-------------[ get alpha ]------------[ mov ebx,256 sub ebx,ecx mov eax,ecx ; eax = Alpha ; ebx = invAlpha ;--------------------------------------/ mov ecx,[edi] mov edx,ecx and ecx,0FF00FFh and edx,000FF00h imul ecx,ebx imul edx,ebx mov ebx,eax imul eax,TintRB imul ebx,TintG add eax,ecx add ebx,edx and eax,0FF00FF00h and ebx,000FF0000h add eax,ebx shr eax,8 mov [edi],eax ; out = (dcolor*(256-alpha) + color*alpha)/256 = ; dcolor*256 - dcolor*alpha + color*alpha = dcolor*256 + alpha*(color-dcolor) add esi,4 add edi,4 dec wid2 jnz _nextpix add esi,extraSrc add edi,extraDest dec hei jnz _nextline _ret: ret sBltTintDirect endp sDrawRectROP proc PUBLIC UseAll x,y,wid,hei,dwColor,dwROP local extraDest CHECKDRAWRECT COMPUTEBLTBITS mov eax,dwColor mov edx,dwROP mov ebx,dwColor sub edi,4 mov esi,sTarget_Data.linesize cmp edx,SD_COPY je _SD_COPY cmp edx,SD_XOR je _SD_XOR cmp edx,SD_ADD je _SD_ADD cmp edx,SD_SUB je _SD_SUB cmp edx,SD_OR je _SD_OR cmp edx,SD_AND je _SD_AND cmp edx,SD_SHR je _SD_SHR cmp edx,SD_MUL je _SD_MUL cmp edx,SD_ADDSAT je _SD_ADDSAT cmp edx,SD_SUBSAT je _SD_SUBSAT cmp edx,SD_SHRSAT je _SD_SHRSAT cmp edx,SD_SHLSAT je _SD_SHLSAT jmp _ret ;------------[ COPY ]---------------[ _SD_COPY: mov ecx,wid align 16 @@: mov [edi+ecx*4],ebx dec ecx jnz @B add edi,esi dec hei jnz _SD_COPY jmp _ret ;-----------------------------------/ ;------------[ XOR ]---------------[ _SD_XOR: mov ecx,wid align 16 @@: xor [edi+ecx*4],ebx dec ecx jnz @B add edi,esi dec hei jnz _SD_XOR jmp _ret ;----------------------------------/ ;------------[ ADD ]---------------[ _SD_ADD: mov ecx,wid @@: add [edi+ecx*4],ebx dec ecx jnz @B add edi,esi dec hei jnz _SD_ADD jmp _ret ;----------------------------------/ ;------------[ SUB ]---------------[ _SD_SUB: mov ecx,wid @@: sub [edi+ecx*4],ebx dec ecx jnz @B add edi,esi dec hei jnz _SD_SUB jmp _ret ;----------------------------------/ ;------------[ OR ]---------------[ _SD_OR: mov ecx,wid @@: or [edi+ecx*4],ebx dec ecx jnz @B add edi,esi dec hei jnz _SD_OR jmp _ret ;----------------------------------/ ;------------[ AND ]---------------[ _SD_AND: mov ecx,wid @@: and [edi+ecx*4],ebx dec ecx jnz @B add edi,esi dec hei jnz _SD_AND jmp _ret ;----------------------------------/ ;------------[ SHR ]---------------[ _SD_SHR: mov ecx,ebx mov edx,wid @@: shr dword ptr [edi+ecx*4],cl dec edx jnz @B add edi,esi dec hei jnz _SD_SHR jmp _ret ;----------------------------------/ ;------------[ MUL ]---------------[ _SD_MUL: mov ecx,wid @@: mov eax,[edi+ecx*4] mov edx,eax and eax,0FF00FFh and edx,000FF00h imul eax,ebx imul edx,ebx and eax,0FF00FF00h and edx,000FF0000h or eax,edx shr eax,8 mov [edi+ecx*4],eax dec ecx jnz @B add edi,esi dec hei jnz _SD_MUL jmp _ret ;----------------------------------/ ;------------[ ADDSAT ]---------------[ _SD_ADDSAT: movd mm1,dwColor _addsat_nl: mov ecx,wid align 16 @@: movd mm0,[edi+ecx*4] paddusb mm0,mm1 movd [edi+ecx*4],mm0 dec ecx jnz @B add edi,esi dec hei jnz _addsat_nl emms jmp _ret ;-------------------------------------/ ;------------[ SUBSAT ]---------------[ _SD_SUBSAT: movd mm1,dwColor _subsat_nl: mov ecx,wid align 16 @@: movd mm0,[edi+ecx*4] psubusb mm0,mm1 movd [edi+ecx*4],mm0 dec ecx jnz @B add edi,esi dec hei jnz _subsat_nl emms jmp _ret ;-------------------------------------/ ;------------[ SHRSAT ]---------------[ _SD_SHRSAT: mov ebx,07F7F7Fh _shrsat_nl: mov ecx,wid align 16 @@: mov eax,[edi+ecx*4] shr eax,1 and eax,ebx mov [edi+ecx*4],eax dec ecx jnz @B add edi,esi dec hei jnz _shrsat_nl jmp _ret ;-------------------------------------/ ;------------[ SHLSAT ]---------------[ _SD_SHLSAT: mov ecx,wid align 16 @@: movd mm0,[edi+ecx*4] paddusb mm0,mm0 movd [edi+ecx*4],mm0 dec ecx jnz @B add edi,esi dec hei jnz _SD_SHLSAT emms jmp _ret ;-------------------------------------/ _ret: ret sDrawRectROP endp ;=====<< SdLoadFont >>===\ SFontStruct struct wid dd ? hei dd ? isMono dd ? ChPoss dw 96 dup (?) ChWids db 96 dup (?) bits db 0 dup (?) SFontStruct ends sdLoadFont proc PUBLIC UseMost pFontData local pFont mov ecx,pFontData .if dword ptr[ecx]!='SDFT' xor eax,eax ret .endif mov pFont,malloc(dword ptr[ecx+8]) invoke unpack,addr [ecx+12],pFont,dword ptr[ecx+4] mov eax,pFont ret sdLoadFont endp ;=======/ ;=====[[ tool: sTextOUTGetDrawnSize >>===\ sTextOUTGetDrawnSize proc PUBLIC uses ecx edx pText local maxwid,y local LineHei xor eax,eax mov ebx,pText mov maxwid,eax or ebx,ebx jz _ret mov ecx,SD_CurFont mov edx,[ecx].SFontStruct.hei mov LineHei,edx mov y,edx lea ecx,[ecx].SFontStruct.ChWids _again: movzx edx,byte ptr[ebx] inc ebx test edx,edx jz _ret .if edx>=32 && edx<128 ; drawable char sub edx,32 movzx edx,byte ptr[ecx+edx] add eax,edx jmp _again .elseif edx==10 .if eax>maxwid mov maxwid,eax .endif mov edx,LineHei add y,edx xor eax,eax .endif jmp _again _ret: .if maxwid>eax mov eax,maxwid .endif mov ebx,y ret sTextOUTGetDrawnSize endp ;=======/ sTextPrintLine proc PRIVATE x,y,wid,hei,pText ; x,y,wid,hei are NOT random! ret sTextPrintLine endp sTextOut proc PUBLIC UseAll x,y,pText,dwColor local wid,hei local defaultX,LineDataSize,FontHei,FontWid local CharOffs,CharWid,IsMonochrome local esi2,edi2 local dwColorG,dwColorRB cmp pText,0 je _ret ;-----[ try to clip early ]----------[ mov eax,x mov edx,y add eax,SDDrawOffs.x add edx,SDDrawOffs.y cmp eax,SDBound.right jge _ret cmp edx,SDBound.bottom jge _ret mov x,eax mov defaultX,eax mov y,edx invoke sTextOUTGetDrawnSize,pText mov wid,eax mov hei,ebx add eax,x add ebx,y cmp eax,SDBound.left jle _ret cmp ebx,SDBound.top jle _ret ;------------------------------------/ ;----[ preload data+registers ]-----[ mov ebx,pText mov ecx,SD_CurFont mov edx,[ecx].SFontStruct.wid mov FontWid,edx mov edx,[ecx].SFontStruct.isMono mov IsMonochrome,edx mov edx,[ecx].SFontStruct.hei mov FontHei,edx imul edx,sTarget_Data.linesize mov LineDataSize,edx mov eax,sTarget_Data.wid imul eax,y mov edi,sTarget_Data.bits lea esi,[ecx].SFontStruct.bits lea edi,[edi+eax*4] lea edx,[ecx].SFontStruct.ChWids lea ecx,[ecx].SFontStruct.ChPoss mov esi2,esi mov edi2,edi mov eax,dwColor and eax,000FF00h mov dwColorG,eax mov eax,dwColor and eax,0FF00FFh mov dwColorRB,eax ;-----------------------------------/ ;------[ for each char ]-------------\ _nextChar: movzx eax,byte ptr[ebx] inc ebx test eax,eax jz _ret .if al==10 ; on newline mov eax,FontHei add y,eax mov eax,defaultX mov x,eax mov eax,LineDataSize sub edi2,eax jmp _nextChar .endif .if eax>=32 && eax<128 ; drawable char sub eax,32 pushi ebx,ecx,edx movzx ecx,word ptr[ecx+eax*2] ; ecx=char-offset movzx edx,byte ptr[edx+eax] ; edx=char-width mov CharOffs,ecx mov CharWid,edx mov eax,x ; eax=left add x,edx ; increase target x with char width mov ebx,edx add ebx,eax; ebx= right mov ecx,y ; ecx=top mov edx,FontHei add edx,ecx ; edx=bottom cmp eax,SDBound.right jge _charDone cmp ebx,SDBound.left jle _charDone cmp ecx,SDBound.bottom jge _charDone cmp edx,SDBound.top jle _charDone .if sdword ptr edx>SDBound.bottom mov edx,SDBound.bottom .endif .if sdword ptr ebx>SDBound.right mov ebx,SDBound.right .endif mov esi,esi2 mov edi,edi2 add esi,CharOffs lea edi,[edi+eax*4] .if IsMonochrome ;-----------[ for each scanline ]-----------[ _nextHScan: .if sdword ptr ecx>=SDBound.top pushi eax,esi,edi ;--[ for each h-pixel ]---[ _nextpix: .if sdword ptr eax>=SDBound.left ;------[ finally, fill the pixel ]------------[ .if byte ptr[esi] m2m dword ptr[edi],dwColor .endif ;---------------------------------------------/ .endif inc eax add edi,4 inc esi cmp eax,ebx jl _nextpix ;-------------------------/ poppi eax,esi,edi .endif inc ecx add edi,sTarget_Data.linesize add esi,FontWid cmp ecx,edx jl _nextHScan ;--------------------------------------------/ .else ;-----------[ for each scanline ]-----------[ _nextHScan2: .if sdword ptr ecx>=SDBound.top pushi eax,ecx,edx,esi,edi ;--[ for each h-pixel ]---[ _nextpix2: .if sdword ptr eax>= sdword ptr SDBound.left ;------[ finally, fill the pixel ]------------[ pushi eax,ebx movzx eax,byte ptr[esi] mov ecx,[edi] ;-----[ get alpha ]-----[ mov ebx,256 sub ebx,eax ; eax = Alpha ; ebx = invAlpha ;-----------------------/ mov edx,ecx and ecx,0FF00FFh and edx,000FF00h imul ecx,ebx imul edx,ebx mov ebx,eax imul eax,dwColorRB imul ebx,dwColorG add eax,ecx add ebx,edx and eax,0FF00FF00h and ebx,000FF0000h add eax,ebx shr eax,8 mov [edi],eax poppi eax,ebx ;---------------------------------------------/ .endif inc eax add edi,4 inc esi cmp eax,ebx jl _nextpix2 ;-------------------------/ poppi eax,ecx,edx,esi,edi .endif inc ecx add edi,sTarget_Data.linesize add esi,FontWid cmp ecx,edx jl _nextHScan2 ;--------------------------------------------/ .endif _charDone: ;add x,1 ; move target x right, for char spacing poppi ebx,ecx,edx .endif jmp _nextChar ;------------------------------------/ _ret: ret sTextOut endp ;=====[[ sdPrintDec >>===\ sdPrintDec proc PUBLIC UseAll x,y,Value,dwColor local digits[64]:byte local str1[64]:byte lea edi,str1 mov eax,Value cmp eax,0 jge @F neg eax mov byte ptr[edi],'-' inc edi @@: mov ecx,10 xor ebx,ebx @@: xor edx,edx div ecx add dl,'0' mov digits[ebx],dl inc ebx or eax,eax jnz @B .while ebx dec ebx mov al,digits[ebx] mov [edi],al inc edi .endw mov byte ptr[edi],0 invoke sTextOut,x,y,addr str1,dwColor ret sdPrintDec endp ;=======/ sBltParam proc PUBLIC x,y,wid,hei,x2,y2,pSprite push pSourceSprite invoke sdSetSourceSprite,pSprite invoke sBlt,x,y,wid,hei,x2,y2 call sdSetSourceSprite ret sBltParam endp sBltTransParam proc PUBLIC x,y,wid,hei,x2,y2,pSprite push pSourceSprite invoke sdSetSourceSprite,pSprite invoke sBltTrans,x,y,wid,hei,x2,y2 call sdSetSourceSprite ret sBltTransParam endp sBltAlphaParam proc PUBLIC x,y,wid,hei,x2,y2,Alpha,pSprite push pSourceSprite invoke sdSetSourceSprite,pSprite invoke sBltAlpha,x,y,wid,hei,x2,y2,Alpha call sdSetSourceSprite ret sBltAlphaParam endp sBltTransAlphaParam proc PUBLIC x,y,wid,hei,x2,y2,Alpha,pSprite push pSourceSprite invoke sdSetSourceSprite,pSprite invoke sBltTransAlpha,x,y,wid,hei,x2,y2,Alpha call sdSetSourceSprite ret sBltTransAlphaParam endp sBltAddParam proc PUBLIC x,y,wid,hei,x2,y2,pSprite push pSourceSprite invoke sdSetSourceSprite,pSprite invoke sBltAdd,x,y,wid,hei,x2,y2 call sdSetSourceSprite ret sBltAddParam endp sBltAddFadeParam proc PUBLIC x,y,wid,hei,x2,y2,Fader,pSprite push pSourceSprite invoke sdSetSourceSprite,pSprite invoke sBltAddFade,x,y,wid,hei,x2,y2,Fader call sdSetSourceSprite ret sBltAddFadeParam endp sBltTintParam proc PUBLIC x,y,wid,hei,x2,y2,dwColor,pSprite push pSourceSprite invoke sdSetSourceSprite,pSprite invoke sBltTint,x,y,wid,hei,x2,y2,dwColor call sdSetSourceSprite ret sBltTintParam endp InitSDraw proc PUBLIC UseAll wid,hei local DesktopDC local bits .if !wid invoke GetSystemMetrics,SM_CXSCREEN mov wid,eax .endif .if !hei invoke GetSystemMetrics,SM_CYSCREEN mov hei,eax .endif m2m ScreenSize.x,wid m2m ScreenSize.y,hei ;---------[ make backDC ]----------[ invoke GetDC,0 mov DesktopDC,eax invoke CreateCompatibleDC,eax mov backDC,eax invoke ReleaseDC,0,DesktopDC ;----------------------------------/ invoke CreateDIBsprite,wid,hei mov SD_BackSprite,eax invoke SelectObject,backDC,[eax].sSprite.hBitmap mov backDC_PrevHBmp,eax ret InitSDraw endp ResizeSDrawArea proc PUBLIC UseAll wid,hei ;-------[ check params ]---------------------[ .if !wid invoke GetSystemMetrics,SM_CXSCREEN mov wid,eax .endif .if !hei invoke GetSystemMetrics,SM_CYSCREEN mov hei,eax .endif ;--------------------------------------------/ ;-----[ exit if no actual change ]---------[ mov eax,wid mov edx,hei .if eax==ScreenSize.x && edx==ScreenSize.y ret .endif ;------------------------------------------/ m2m ScreenSize.x,wid m2m ScreenSize.y,hei ;-------[ replace the DIBsprite ]-----------[ invoke SelectObject,backDC,backDC_PrevHBmp mov eax,SD_BackSprite invoke DeleteObject,[eax].sSprite.hBitmap free SD_BackSprite invoke CreateDIBsprite,wid,hei mov SD_BackSprite,eax invoke SelectObject,backDC,[eax].sSprite.hBitmap mov backDC_PrevHBmp,eax invoke sdSetTargetSprite,0 ;-------------------------------------------/ ret ResizeSDrawArea endp FreeSDraw proc PUBLIC UseAll invoke sdDeleteAllSprites ; unnecessary ;--------[ free the main DIB ]--------------------[ invoke SelectObject,backDC,backDC_PrevHBmp mov eax,SD_BackSprite invoke DeleteObject,[eax].sSprite.hBitmap free SD_BackSprite invoke DeleteObject,backDC mov SD_BackSprite,0 mov backDC,0 ;-------------------------------------------------/ ifndef HEAP1 invoke HeapDestroy,HEAP2 mov HEAP2,0 endif ret FreeSDraw endp sdGetCtlVariable proc PUBLIC VariableID mov eax,VariableID .if eax==SDVAR_ID_SD_TransparentColor mov eax,SD_TransparentColor ret .elseif eax==SDVAR_ID_SD_CurFont mov eax,SD_CurFont ret .elseif eax==SDVAR_ID_SDBound_ptr lea eax,SDBound ret .elseif eax==SDVAR_ID_SDDrawOffs_ptr lea eax,SDDrawOffs ret .elseif eax==SDVAR_ID_sTarget_Data lea eax,sTarget_Data ret .elseif eax==SDVAR_ID_sSource_Data lea eax,sSource_Data ret .elseif eax==SDVAR_ID_SDBackDC mov eax,SDBackDC ret .elseif eax==SDVAR_ID_SDhDC mov eax,SDhDC ret .endif xor eax,eax ret sdGetCtlVariable endp sdSetCtlVariable proc PUBLIC VariableID,Value .if VariableID==SDVAR_ID_SD_TransparentColor m2m SD_TransparentColor,Value .elseif VariableID==SDVAR_ID_SD_CurFont m2m SD_CurFont,Value .endif ret sdSetCtlVariable endp .data? sdSDOS_Prev_DOx dd ? sdSDOS_Prev_DOy dd ? sdSDOS_Prev_DBl dd ? sdSDOS_Prev_DBr dd ? sdSDOS_Prev_DBt dd ? sdSDOS_Prev_DBb dd ? sdSDOS_Prev_OBl dd ? sdSDOS_Prev_OBr dd ? sdSDOS_Prev_OBt dd ? sdSDOS_Prev_OBb dd ? sdSDOS_Prev_PSS dd ? sdSDOS_Prev_PTS dd ? .code sdStartDrawingOnSprite proc PUBLIC UseAll TargetSprite ;-------[ save current state ]-----[ push SDDrawOffs.x push SDDrawOffs.y push SDBound.left push SDBound.right push SDBound.top push SDBound.bottom push SDOriginalBound.left push SDOriginalBound.right push SDOriginalBound.top push SDOriginalBound.bottom push pSourceSprite push pTargetSprite pop sdSDOS_Prev_PTS pop sdSDOS_Prev_PSS pop sdSDOS_Prev_OBb pop sdSDOS_Prev_OBt pop sdSDOS_Prev_OBr pop sdSDOS_Prev_OBl pop sdSDOS_Prev_DBb pop sdSDOS_Prev_DBt pop sdSDOS_Prev_DBr pop sdSDOS_Prev_DBl pop sdSDOS_Prev_DOy pop sdSDOS_Prev_DOx ;----------------------------------/ mov ecx,TargetSprite xor eax,eax mov SDDrawOffs.x,eax mov SDDrawOffs.y,eax mov SDBound.left,eax mov SDBound.top,eax m2m SDBound.right,[ecx].sSprite.wid m2m SDBound.bottom,[ecx].sSprite.hei m2m SDOriginalBound.left, SDBound.left m2m SDOriginalBound.top, SDBound.top m2m SDOriginalBound.right, SDBound.right m2m SDOriginalBound.bottom,SDBound.bottom invoke sdSetTargetSprite,TargetSprite ret sdStartDrawingOnSprite endp sdEndDrawingOnSprite proc PUBLIC ;-------[ load previous state ]-----[ push sdSDOS_Prev_PTS push sdSDOS_Prev_PSS push sdSDOS_Prev_OBb push sdSDOS_Prev_OBt push sdSDOS_Prev_OBr push sdSDOS_Prev_OBl push sdSDOS_Prev_DBb push sdSDOS_Prev_DBt push sdSDOS_Prev_DBr push sdSDOS_Prev_DBl push sdSDOS_Prev_DOy push sdSDOS_Prev_DOx pop SDDrawOffs.x pop SDDrawOffs.y pop SDBound.left pop SDBound.right pop SDBound.top pop SDBound.bottom pop SDOriginalBound.left pop SDOriginalBound.right pop SDOriginalBound.top pop SDOriginalBound.bottom pop pSourceSprite pop pTargetSprite ;----------------------------------/ invoke sdSetSourceSprite,pSourceSprite invoke sdSetTargetSprite,pTargetSprite ret sdEndDrawingOnSprite endp sdStart proc PUBLIC UseMost hWnd m2m SDhWnd,hWnd invoke GetDC,hWnd mov SDhDC,eax invoke GetClipBox,SDhDC,addr SDBound .if eax==NULLREGION invoke ReleaseDC,hWnd,SDhDC mov SDhWnd,0 mov SDhDC,0 xor eax,eax ret .endif m2m SDOriginalBound.left, SDBound.left m2m SDOriginalBound.top, SDBound.top m2m SDOriginalBound.right, SDBound.right m2m SDOriginalBound.bottom,SDBound.bottom mov SDDrawOffs.x,0 mov SDDrawOffs.y,0 invoke sdSetSourceSprite,0 invoke sdSetTargetSprite,0 mov pClipStack,offset ClipStackData ;---[ return 1, clear zero flag ]---[ xor eax,eax inc eax ret ;-----------------------------------/ sdStart endp sdEnd proc PUBLIC UseAll mov eax,SDOriginalBound.right mov edx,SDOriginalBound.bottom sub eax,SDOriginalBound.left sub edx,SDOriginalBound.top invoke BitBlt,SDhDC,SDOriginalBound.left,SDOriginalBound.top,eax,edx,\ backDC,SDOriginalBound.left,SDOriginalBound.top,SRCCOPY invoke ReleaseDC,SDhWnd,SDhDC mov SDhWnd,0 mov SDhDC,0 ret sdEnd endp sdStartEx proc PUBLIC UseAll hWnd,dwType m2m SDhWnd,hWnd invoke GetDC,hWnd mov SDhDC,eax ;-------------[ get major clipping box ]-------------------------------------[ .if dwType==SDSTARTEX_ONUPDATEREGION ;---[ if on update-region ]-------------\ invoke GetUpdateRect,hWnd,addr SDBound,0 .if !eax _sdStartExFailed: invoke ReleaseDC,hWnd,SDhDC mov SDhWnd,0 mov SDhDC,0 xor eax,eax ret .endif ;---------------------------------------/ .else ;----[ if on draw-region, or custom-region ]------------\ invoke GetClipBox,SDhDC,addr SDBound cmp eax,NULLREGION je _sdStartExFailed ;-----------------------------------------------------/ .endif ;-----------------------------------------------------------------------------/ ;-------[ intersect if a custom rectangle is specified ]----------------[ .if dwType!=SDSTARTEX_ONDRAWREGION && dwType!=SDSTARTEX_ONUPDATEREGION mov edx,dwType ;---[ clip horizontal ]--------[ mov eax,[edx].RECT.left mov ecx,[edx].RECT.right cmp eax,SDBound.left jge @F mov eax,SDBound.left @@: cmp ecx,SDBound.right jle @F mov ecx,SDBound.right @@: cmp eax,ecx jge _sdStartExFailed mov SDBound.left,eax mov SDBound.right,ecx ;------------------------------/ ;---[ clip vertical ]----------[ mov eax,[edx].RECT.top mov ecx,[edx].RECT.bottom cmp eax,SDBound.top jge @F mov eax,SDBound.top @@: cmp ecx,SDBound.bottom jle @F mov ecx,SDBound.bottom @@: cmp eax,ecx jge _sdStartExFailed mov SDBound.top,eax mov SDBound.bottom,ecx ;------------------------------/ .endif ;-----------------------------------------------------------------------/ m2m SDOriginalBound.left, SDBound.left m2m SDOriginalBound.top, SDBound.top m2m SDOriginalBound.right, SDBound.right m2m SDOriginalBound.bottom,SDBound.bottom mov SDDrawOffs.x,0 mov SDDrawOffs.y,0 invoke sdSetSourceSprite,0 invoke sdSetTargetSprite,0 mov pClipStack,offset ClipStackData ;---[ return 1, clear zero flag ]---[ xor eax,eax inc eax ret ;-----------------------------------/ ret sdStartEx endp sdEndEx proc PUBLIC UseAll bDoUpdate .if bDoUpdate mov eax,SDOriginalBound.right mov edx,SDOriginalBound.bottom sub eax,SDOriginalBound.left sub edx,SDOriginalBound.top invoke BitBlt,SDhDC,SDOriginalBound.left,SDOriginalBound.top,eax,edx,\ backDC,SDOriginalBound.left,SDOriginalBound.top,SRCCOPY .endif invoke ReleaseDC,SDhWnd,SDhDC mov SDhWnd,0 mov SDhDC,0 ret sdEndEx endp sdForceUpdate proc PUBLIC UseAll mov eax,SDBound.right mov edx,SDBound.bottom sub eax,SDBound.left sub edx,SDBound.top invoke BitBlt,SDhDC,SDBound.left,SDBound.top,eax,edx,backDC,SDBound.left,SDBound.top,SRCCOPY ret sdForceUpdate endp sdFetchBackground proc PUBLIC UseAll mov eax,SDOriginalBound.right mov edx,SDOriginalBound.bottom sub eax,SDOriginalBound.left sub edx,SDOriginalBound.top invoke BitBlt,backDC,SDOriginalBound.left,SDOriginalBound.top,eax,edx,\ SDhDC,SDOriginalBound.left,SDOriginalBound.top,SRCCOPY ret sdFetchBackground endp if COMPILE_AS_DLL LibMain proc PUBLIC hInstDLL,reason, unused mov eax,1 ret LibMain Endp sdSetCurFont proc PUBLIC pFont m2m SD_CurFont,pFont ret sdSetCurFont endp @CatStr(<en>,<dif>) ; trick masm @CatStr(<en>,<d LibMain>) ; trick masm endif if COMPILE_AS_EXE eq 0 @CatStr(<en>,<dif>) ; trick masm @CatStr(<en>,<d >) ; trick masm endif includelib \masm32\lib\ole32.lib includelib \masm32\lib\oleaut32.lib include Font1.inc MakeOneWindow proc wid,hei,pFunc,pTitle local wc:WNDCLASSEX local rect:RECT local hInst Clear wc mov wc.cbSize,sizeof wc m2m wc.lpfnWndProc,pFunc mov wc.hCursor,$invoke(LoadCursor,0,IDC_ARROW) mov wc.hInstance,$invoke(GetModuleHandle,0) mov hInst,eax mov wc.hIcon,$invoke (LoadIcon,eax,1) mov wc.lpszClassName,T("OneWindowCls") invoke RegisterClassEx,addr wc ;-------------------------------------------/ ;-----[ adjust window size ]---------\ mov rect.left,0 mov rect.top,0 m2m rect.right,wid m2m rect.bottom,hei invoke AdjustWindowRect,addr rect,WS_POPUP or WS_CAPTION or WS_VISIBLE or WS_SYSMENU,0 mov eax,rect.right sub eax,rect.left mov ecx,rect.bottom sub ecx,rect.top ;------------------------------------/ invoke CreateWindowEx,0,wc.lpszClassName,pTitle,WS_POPUP or WS_CAPTION or WS_VISIBLE or WS_SYSMENU,50,50,eax,ecx,0,0,hInst,0 ret MakeOneWindow endp ; ; ; To test this file, remove the "end" above, and in sDraw.tix remove the "!" from "!sDraw" ; ; .data spr1 dd ? spr2 dd ? dude dd ? ball dd ? txt1 dd ? jpg1 dd ? imgCable dd ? round1 dd ? hwnd1 dd ? font1 dd ? .code includelib Ball_tga.lib externdef Ball_tga:DWORD Cable struct first POINT <> p1 POINT <> p3 POINT <> last POINT <> inert1 POINT <> inert3 POINT <> IsResting dd ? dwColor dd 151515h Cable ends AnimateCable proc UseAll pCable local p1x,p3x,p1y,p3y local I1:POINT,I3:POINT ; intertias, in real4 local TM:POINT ; in int mov ecx,pCable assume ecx:ptr Cable .if !ecx || [ecx].IsResting ret .endif ;----[ compute TM ]--------------\ mov eax,[ecx].first.x add eax,[ecx].last.x sar eax,1 mov TM.x,eax mov eax,[ecx].first.y mov edx,[ecx].last.y .if sdword ptr eax<edx mov eax,edx .endif add eax,50 mov edx,[ecx].first.x sub edx,[ecx].last.x .if SIGN? neg edx .endif sar edx,2 add eax,edx mov TM.y,eax ;--------------------------------/ ;-----[ compute p1x,p3x ]-------[ ; p1x = avg(tmx,firstx mov ebx,TM.x mov edx,ebx add ebx,[ecx].first.x add edx,[ecx].last.x sar ebx,1 sar edx,1 mov p1x,ebx mov p3x,edx ;-------------------------------/ ;------[ compute p1y,p3y ]--------[ mov ebx,TM.y lea ebx,[ebx+ebx*2] mov edx,ebx add ebx,[ecx].first.y add edx,[ecx].last.y sar ebx,1 sar edx,1 mov p1y,ebx mov p3y,edx m2m p1y,TM.y m2m p3y,TM.y ;---------------------------------/ .data ccvar1 real4 0.2 ; speed ccvar2 real4 0.7 ; elasticity .code @@INERTCAB macro _PTX,_PT,_INER fild _PTX fisub [ecx]._PT fmul ccvar1 fadd [ecx]._INER fild [ecx]._PT fadd ST,ST(1) fistp [ecx]._PT fmul ccvar2 fstp [ecx]._INER ;mov eax,_PTX ;sub eax,[ecx]._PT ;sar eax,2 ;add eax,[ecx]._INER ;add [ecx]._PT,eax ;sar eax,1 ;mov [ecx]._INER,eax endm ;---[ compute I1, anim P1 ]-----\ @@INERTCAB p1x,p1.x,inert1.x @@INERTCAB p1y,p1.y,inert1.y ;-------------------------------/ ;---[ compute I3, anim P3 ]-----\ @@INERTCAB p3x,p3.x,inert3.x @@INERTCAB p3y,p3.y,inert3.y ;-------------------------------/ mov esi,7FFFFFFFh movf edi,0.1 mov eax,[ecx].inert1.x mov ebx,[ecx].inert1.y mov edx,[ecx].inert3.x mov ecx,[ecx].inert3.y and eax,esi and ebx,esi and ecx,esi and edx,esi .if eax<edi && ebx<edi && ecx<edi && edx<edi mov ecx,pCable mov [ecx].IsResting,1 .endif assume ecx:nothing ret AnimateCable endp Shader1 proc x,y,dwColor invoke sDrawRectROP,x,y,5,5,151515h,SD_SUBSAT ret Shader1 endp Shader3 proc uses ecx x,y,dwColor .data SH3WR dd 0 SH3RD dd 0 SH3HX dd 8 dup (?) SH3HY dd 8 dup (?) .code invoke sBltTint,x,y,5,5,0,0,dwColor mov ecx,SH3WR and ecx,7 m2m SH3HX[ecx*4],x m2m SH3HY[ecx*4],y inc SH3WR .if SH3WR>4 mov ecx,SH3RD and ecx,7 invoke sBltAdd,SH3HX[ecx*4],SH3HY[ecx*4],5,5,12,0 inc SH3RD .endif ret Shader3 endp Shader3_init proc mov SH3WR,0 mov SH3RD,0 ret Shader3_init endp Shader3_finish proc mov eax,SH3RD mov ecx,eax .while eax!=SH3WR and ecx,7 invoke sBltAdd,SH3HX[ecx*4],SH3HY[ecx*4],5,5,6,0 inc eax inc ecx .endw ret Shader3_finish endp DrawCable proc pCable,IsSelected ;----[ SHADOW ]-------------------------------------[ mov ecx,pCable assume ecx:ptr Cable mov eax,10 add [ecx].first.x,2 add [ecx].first.y,2 add [ecx].p1.x,eax add [ecx].p1.y,eax add [ecx].p3.x,eax add [ecx].p3.y,eax .if IsSelected add [ecx].last.x,eax add [ecx].last.y,eax .endif invoke sDrawBSplineShade,ecx,20,0,Shader1,5 sub [ecx].first.x,2 sub [ecx].first.y,2 sub [ecx].p1.x,eax sub [ecx].p1.y,eax sub [ecx].p3.x,eax sub [ecx].p3.y,eax .if IsSelected sub [ecx].last.x,eax sub [ecx].last.y,eax .endif ;---------------------------------------------------/ ;------[ CABLE ]----------------------------------\ invoke sdSetSourceSprite,imgCable invoke Shader3_init mov ecx,pCable invoke sDrawBSplineShade,pCable,20,[ecx].dwColor,Shader3,5 invoke Shader3_finish ;-------------------------------------------------/ ;mov ecx,pCable ;invoke sBltTint,[ecx].p1.x,[ecx].p1.y,5,5,0,0,[ecx].dwColor ;invoke sBltTint,[ecx].p3.x,[ecx].p3.y,5,5,0,0,[ecx].dwColor ;invoke sDrawRectROP,[ecx].p1.x,[ecx].p1.y,8,8,303030h,SD_ADDSAT ;invoke sDrawRectROP,[ecx].p3.x,[ecx].p3.y,8,8,303030h,SD_ADDSAT assume ecx:nothing ret DrawCable endp DistanceFromLineToPoint proc uses ebx ecx edx mousex,mousey,X0,Y0,X1,Y1 ;dist = abs( ;(Y0-Y1)*mousex + (X1-X0)*mousey + (X0*Y1) - (X1*Y0) ;) mov eax,X0 mov ebx,X1 mov ecx,Y0 mov edx,Y1 .if sdword ptr eax>ebx xchg eax,ebx .endif .if sdword ptr ecx>edx xchg ecx,edx .endif sub eax,4 add ebx,4 sub ecx,4 add edx,4 cmp mousex,eax jl _ret cmp mousex,ebx jg _ret cmp mousey,ecx jl _ret cmp mousey,edx jg _ret mov eax,Y0 sub eax,Y1 imul eax,mousex mov ebx,X1 sub ebx,X0 imul ebx,mousey mov ecx,X0 imul ecx,Y1 mov edx,X1 imul edx,Y0 add eax,ebx add eax,ecx sub eax,edx imul eax,eax mov ebx,X1 sub ebx,X0 mov ecx,Y1 sub ecx,Y0 imul ebx,ebx imul ecx,ecx add ebx,ecx xor edx,edx inc ebx div ebx ret _ret: mov eax,7FFFFFFFh ret DistanceFromLineToPoint endp DrawSpline proc UseAll local pt:POINT invoke GetCursorPos,addr pt invoke ScreenToClient,hwnd1,addr pt .data cab1 Cable <<400,130>,<0,0>,<0,0>,<200,0>,<0,0>,<0,0>,0,00800000h> cab2 Cable <<400,0>,<0,0>,<0,0>,<10,50>,<0,0>,<0,0>,0,0> cab3 Cable <<0,100>,<0,0>,<0,0>,<0,0>,<0,0>,<0,0>,0,804000h> cab4 Cable <<0,10>,<0,0>,<0,0>,<0,0>,<0,0>,<0,0>,0,100> cab5 Cable <<0,140>,<0,0>,<0,0>,<400,0>,<0,0>,<0,0>,0,100> cab6 Cable <<0,160>,<0,0>,<0,0>,<400,0>,<0,0>,<0,0>,0,100> cab7 Cable <<0,100>,<0,0>,<0,0>,<400,0>,<0,0>,<0,0>,0,100> cab8 Cable <<0,170>,<0,0>,<0,0>,<400,100>,<0,0>,<0,0>,0,100> .code mov eax,pt.x mov ecx,pt.y mov cab3.last.x,eax mov cab3.last.y,ecx mov cab3.IsResting,0 invoke AnimateCable,addr cab1 invoke AnimateCable,addr cab2 invoke AnimateCable,addr cab3 invoke AnimateCable,addr cab4 invoke AnimateCable,addr cab5 invoke AnimateCable,addr cab6 invoke AnimateCable,addr cab7 invoke AnimateCable,addr cab8 invoke DrawCable,addr cab1,0 invoke DrawCable,addr cab2,0 invoke DrawCable,addr cab4,0 invoke DrawCable,addr cab5,0 invoke DrawCable,addr cab6,0 invoke DrawCable,addr cab7,0 invoke DrawCable,addr cab8,0 invoke DrawCable,addr cab3,1 .data Line1 POINT <200,200> Line2 POINT <100,200> .code ;trace "%d:%d",pt.x,pt.y invoke DistanceFromLineToPoint,pt.x,pt.y,Line1.x,Line1.y,Line2.x,Line2.y mov edx,255 .if eax<=16 shl edx,16 .endif invoke sDrawLine,Line1.x,Line1.y,Line2.x,Line2.y,edx ret DrawSpline endp TestDraw proc hWnd local sdl:SDLOCKEDRECT local pt:POINT invoke GetCursorPos,addr pt invoke ScreenToClient,hwnd1,addr pt invoke sdStart,hWnd jz _ret invoke sdSetSourceSprite,spr2 invoke sBlt,0,0,400,300,0,0 invoke sdSetSourceSprite,spr1 invoke sBltAlpha,50,80,100,100,0,0,80 invoke sdEnterClip,40,40,100,30 invoke sDrawRectROP,0,0,100,30,RGB(30,0,0),SD_ADDSAT invoke sTextOut,0,0,T("An especially long text?",13,10,"Should show correctly"),-1 invoke sdLeaveClip invoke GetTickCount shr eax,3 and eax,511 .if eax>256 sub eax,512 neg eax .endif mov edx,eax shr edx,2 add eax,100 invoke sBltAddFade,eax,28,24,24,100,0,eax invoke sdSetSourceSprite,dude invoke sBlt,pt.x,pt.y,46,57,0,0 ;invoke sBltTint,220,60,125,57,50,0,-1 invoke sdSetSourceSprite,txt1 invoke sBltTint,220,200,100,50,0,0,-1 invoke sDrawRectROP,100,100,400,300,65 shl 16,SD_ADDSAT ;invoke sdSetSourceSprite,ball ;invoke sBlt,0,10,100,100,0,0 ;invoke sBltAlpha,-90,100,100,100,0,0,200 invoke DrawSpline invoke sdEnd _ret: ret TestDraw endp WinPric proc UseMost hWnd,msg,w,l .if msg==WM_CLOSE invoke PostQuitMessage,0 .elseif msg==WM_PAINT invoke TestDraw,hWnd invoke ValidateRect,hWnd,0 .elseif msg==WM_TIMER invoke TestDraw,hWnd .elseif msg==WM_KEYDOWN && w==VK_ESCAPE invoke PostQuitMessage,0 .else invoke DefWindowProc,hWnd,msg,w,l ret .endif xor eax,eax ret WinPric endp .data ilkoz dd 255 .code main proc local msg:MSG local loop1,atom1 invoke CoInitialize,0 invoke InitSDraw,0,0 invoke sdSpriteFromBitmapFile,T("main.bmp") mov spr1,eax invoke sdSpriteFromBitmapFile,T("back.bmp") mov spr2,eax invoke sdSpriteFromBitmapFile,T("dude.bmp") mov dude,eax invoke sdSpriteFromBitmapFile,T("txt1.bmp") mov txt1,eax invoke sdSpriteFromJPGFile,T("jpg1.jpg") mov jpg1,eax invoke sdSpriteFromILBFile,T("cable1.ilb") mov imgCable,eax invoke sdSpriteFromILB,addr Ball_tga mov ball,eax invoke sdSpritePreprocess_AlphaFromColor,dude,RGB(255,0,255) invoke sdSpritePreprocess_AlphaFromColor,txt1,0 invoke sdSpritePreprocess_PremultiplyAlpha,dude ;invoke sdSpritePreprocess_PremultiplyAlpha,ball invoke sdSpriteFromILBFile,T("round1.ilb") mov round1,eax invoke sdSpritePreprocess_PremultiplyAlpha,eax invoke sdLoadFont,addr WildWordsBold_fntdata mov font1,eax m2m SD_CurFont,font1 ;print [eax].SFontStruct.isMono invoke MakeOneWindow,400,300,WinPric,T("hello sDraw") mov hwnd1,eax invoke SetTimer,hwnd1,1,20,0 MessageLoop invoke sdDeleteSprite,dude invoke CoUninitialize ret main endp start: print "hello1" invoke main print "hello" invoke ExitProcess,0 end start
17.991
126
0.592827
111720f41bb155bd6b2caddc1b328ab9d6cdbc67
541
asm
Assembly
libsrc/adt/stack/adt_StackDelete_callee.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/adt/stack/adt_StackDelete_callee.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/adt/stack/adt_StackDelete_callee.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
; void __CALLEE__ adt_StackDelete_callee(struct adt_Stack *s, void *delete) ; 09.2005, 11.2006 aralbrec PUBLIC adt_StackDelete_callee PUBLIC ASMDISP_ADT_STACKDELETE_CALLEE EXTERN adt_StackDeleteS_callee EXTERN ASMDISP_ADT_STACKDELETES_CALLEE EXTERN _u_free .adt_StackDelete_callee pop hl pop de ex (sp),hl .asmentry push hl call adt_StackDeleteS_callee + ASMDISP_ADT_STACKDELETES_CALLEE pop hl push hl call _u_free pop hl ret DEFC ASMDISP_ADT_STACKDELETE_CALLEE = # asmentry - adt_StackDelete_callee
18.655172
75
0.792976
043dedadc2dba0a3077a15b295eeaa57709550bd
10,502
asm
Assembly
P6/data_P6_2/MDTest154.asm
alxzzhou/BUAA_CO_2020
b54bf367081a5a11701ebc3fc78a23494aecca9e
[ "Apache-2.0" ]
1
2022-01-23T09:24:47.000Z
2022-01-23T09:24:47.000Z
P6/data_P6_2/MDTest154.asm
alxzzhou/BUAA_CO_2020
b54bf367081a5a11701ebc3fc78a23494aecca9e
[ "Apache-2.0" ]
null
null
null
P6/data_P6_2/MDTest154.asm
alxzzhou/BUAA_CO_2020
b54bf367081a5a11701ebc3fc78a23494aecca9e
[ "Apache-2.0" ]
null
null
null
ori $ra,$ra,0xf srav $2,$5,$2 lui $6,29827 mult $3,$5 ori $0,$4,58025 sll $4,$2,29 addiu $1,$5,-10547 sll $1,$3,4 div $2,$ra sb $6,7($0) mflo $0 sb $1,14($0) sb $3,7($0) div $4,$ra ori $3,$3,11125 srav $4,$4,$4 mult $1,$4 ori $1,$3,39716 mult $1,$4 sll $0,$2,12 mflo $6 ori $4,$4,13360 addu $1,$1,$3 sb $4,1($0) sb $5,2($0) ori $4,$0,16867 srav $1,$1,$4 mflo $6 lb $1,14($0) lui $4,46383 mthi $4 lui $4,24651 addu $4,$4,$2 addiu $5,$4,-20920 mfhi $2 mult $3,$2 div $5,$ra mfhi $1 ori $4,$2,11965 divu $4,$ra ori $6,$0,53415 mthi $1 mult $3,$6 mult $3,$3 sb $0,5($0) sb $1,8($0) mtlo $4 ori $5,$1,45533 lb $6,6($0) mtlo $1 mult $5,$5 multu $4,$4 mult $4,$3 mthi $5 div $6,$ra mtlo $6 lb $1,8($0) mthi $1 multu $4,$2 divu $2,$ra lb $4,0($0) srav $0,$0,$0 div $4,$ra sb $5,4($0) lb $4,13($0) mthi $3 srav $0,$4,$0 lui $3,42019 ori $4,$5,9934 mflo $4 divu $5,$ra sb $1,15($0) ori $0,$2,61681 ori $6,$1,5645 lui $2,1557 divu $1,$ra mflo $6 mflo $1 divu $2,$ra lb $5,13($0) ori $4,$4,15963 mtlo $4 mtlo $3 multu $3,$3 mfhi $4 div $1,$ra lb $4,0($0) mfhi $6 mult $4,$1 mfhi $4 mtlo $2 addiu $4,$4,11831 ori $4,$5,25001 divu $4,$ra multu $3,$3 addu $5,$5,$5 mtlo $0 ori $4,$6,63181 mfhi $4 ori $0,$2,421 lui $4,58593 sb $3,5($0) mult $4,$0 sll $1,$1,6 divu $4,$ra mfhi $1 mtlo $1 multu $4,$5 sb $4,5($0) addiu $4,$4,11116 mflo $0 mult $4,$5 mfhi $4 mtlo $4 addiu $0,$6,4692 divu $0,$ra addu $5,$5,$2 mfhi $4 mfhi $5 srav $0,$2,$2 div $5,$ra div $2,$ra addu $2,$1,$2 ori $6,$1,52611 mthi $5 lb $1,1($0) ori $3,$2,32161 mult $4,$4 mthi $6 mtlo $0 multu $5,$6 lui $5,44659 sll $6,$2,13 ori $1,$4,65457 multu $1,$2 lui $5,16797 lui $4,36350 div $4,$ra mtlo $4 addu $5,$4,$6 addiu $4,$1,-19509 ori $5,$2,18091 sb $5,8($0) mthi $4 mfhi $4 div $0,$ra addu $4,$1,$6 div $1,$ra multu $5,$5 div $1,$ra mfhi $3 lui $5,27683 mflo $0 mfhi $4 sll $4,$4,9 addiu $0,$6,-21239 mfhi $4 lui $1,8232 mult $2,$2 divu $0,$ra mfhi $0 mult $5,$2 mtlo $6 mflo $5 multu $5,$5 mfhi $4 mtlo $2 addu $5,$6,$5 lb $2,0($0) srav $0,$6,$2 mflo $0 lb $5,9($0) div $0,$ra srav $1,$1,$5 ori $0,$4,52467 mtlo $2 mtlo $3 multu $4,$1 addu $4,$4,$5 lb $6,7($0) sll $5,$2,8 multu $3,$1 lb $4,13($0) mthi $3 addu $1,$2,$0 lb $6,16($0) div $4,$ra divu $5,$ra mtlo $6 mfhi $1 lb $1,16($0) mthi $2 sll $2,$2,17 ori $4,$0,12559 mthi $0 divu $0,$ra ori $2,$2,13109 addu $0,$5,$0 mtlo $4 mfhi $2 srav $5,$5,$3 ori $2,$2,46612 sll $4,$1,20 mult $4,$1 divu $4,$ra mfhi $3 ori $3,$2,58389 srav $4,$2,$4 ori $4,$1,7519 addiu $6,$4,-28917 sll $6,$5,17 mult $5,$5 mflo $4 mflo $0 mfhi $0 sll $1,$2,24 lui $3,6838 addu $4,$4,$2 srav $0,$5,$5 lb $2,9($0) mthi $2 multu $5,$5 div $5,$ra multu $6,$4 mfhi $2 ori $4,$1,20605 mtlo $2 mflo $4 ori $2,$4,2946 div $4,$ra mfhi $0 mfhi $4 mfhi $3 divu $1,$ra multu $5,$2 ori $1,$5,11921 addiu $4,$1,-6486 mflo $1 ori $4,$4,46674 sb $4,16($0) divu $1,$ra divu $4,$ra mtlo $5 mtlo $5 addiu $2,$2,22874 mflo $2 mtlo $2 srav $1,$5,$1 mthi $6 divu $6,$ra divu $2,$ra addu $3,$3,$3 multu $3,$3 ori $2,$2,8689 sll $5,$6,29 lui $4,40189 ori $4,$3,10256 mult $4,$4 mthi $5 ori $2,$0,46178 divu $6,$ra addu $6,$6,$2 mtlo $3 multu $4,$4 div $6,$ra addiu $6,$6,26415 srav $5,$1,$1 lb $2,10($0) mult $2,$2 mthi $5 ori $4,$2,29147 mult $1,$2 mflo $4 mult $5,$6 addiu $1,$2,-29218 lui $3,50625 mflo $5 div $4,$ra mfhi $4 mthi $5 mflo $3 div $4,$ra divu $4,$ra sb $3,13($0) sll $4,$4,27 lui $5,28995 mult $4,$1 lb $2,12($0) divu $4,$ra ori $2,$2,8991 srav $5,$0,$0 mult $4,$4 mult $4,$4 multu $4,$4 srav $4,$4,$2 mtlo $3 mult $4,$3 ori $6,$6,23592 sb $1,6($0) ori $3,$5,3001 sll $2,$2,30 sb $5,14($0) multu $4,$0 mfhi $3 multu $5,$2 ori $5,$5,24529 mult $5,$5 mthi $4 div $4,$ra srav $1,$6,$3 addu $1,$5,$5 srav $5,$5,$5 sll $0,$2,0 mfhi $0 div $5,$ra addu $1,$1,$1 lui $6,40275 mflo $4 mthi $3 lb $1,16($0) ori $2,$2,35899 mult $0,$4 ori $2,$2,25184 mtlo $1 mult $4,$4 sb $4,8($0) ori $4,$1,36461 sll $5,$6,17 lui $6,49913 lui $3,3960 mfhi $5 mflo $1 lb $4,4($0) lui $5,36996 mult $5,$5 mfhi $0 mflo $4 addu $1,$2,$1 mult $4,$2 multu $5,$1 div $4,$ra div $1,$ra mflo $5 mult $5,$4 ori $5,$6,8834 mtlo $3 srav $6,$3,$3 addiu $1,$4,-15573 mtlo $1 div $5,$ra mflo $5 addiu $4,$4,-30437 mfhi $4 multu $5,$1 sll $6,$2,0 addu $5,$0,$5 sb $6,14($0) sll $2,$2,28 div $1,$ra lb $3,6($0) mflo $4 ori $4,$5,42498 lui $4,25 mult $4,$0 mtlo $0 addiu $1,$6,-5304 lb $2,1($0) srav $1,$5,$1 addiu $2,$2,-22505 mtlo $2 div $1,$ra srav $5,$6,$3 addu $3,$6,$3 mfhi $5 lui $1,13033 lb $5,12($0) lui $1,11356 addu $4,$3,$3 addiu $2,$2,19463 multu $1,$2 mult $6,$6 lui $4,42235 srav $2,$2,$2 divu $4,$ra sll $0,$2,18 lb $6,1($0) sll $6,$3,5 mult $1,$1 mflo $6 addu $1,$4,$2 mfhi $4 addu $1,$2,$2 multu $1,$1 multu $6,$5 mult $4,$4 mfhi $5 lui $4,53021 addu $5,$4,$4 lb $3,13($0) srav $4,$2,$2 mfhi $1 mflo $0 mfhi $5 mfhi $5 lb $4,15($0) multu $4,$2 sll $6,$5,21 mult $4,$4 sll $3,$2,26 addu $1,$6,$2 div $5,$ra addu $3,$0,$3 mthi $4 mtlo $1 mtlo $3 sb $5,9($0) addiu $1,$3,-23568 ori $1,$1,26774 lb $2,0($0) multu $4,$4 srav $5,$5,$5 sb $4,0($0) div $4,$ra divu $6,$ra lb $1,7($0) multu $4,$6 mtlo $1 mfhi $4 addiu $5,$2,-25245 sb $2,10($0) mthi $2 addiu $2,$2,25604 ori $1,$1,61699 mult $1,$1 div $4,$ra srav $1,$2,$2 multu $6,$6 divu $1,$ra div $4,$ra srav $0,$4,$4 div $4,$ra mfhi $1 div $5,$ra mflo $0 sb $4,6($0) mflo $1 multu $5,$6 mtlo $1 divu $6,$ra ori $5,$4,42120 multu $3,$0 mfhi $6 mthi $1 mtlo $4 addiu $5,$3,16147 lb $4,0($0) srav $3,$4,$3 mthi $4 sb $5,9($0) divu $5,$ra div $6,$ra mfhi $3 divu $6,$ra mtlo $4 lb $5,14($0) mthi $5 mtlo $4 mflo $4 srav $3,$3,$3 ori $4,$4,13615 mfhi $5 addiu $4,$1,-6721 ori $4,$4,54394 sb $1,1($0) srav $2,$2,$3 sb $1,1($0) addu $5,$5,$5 addu $1,$2,$5 mtlo $4 mflo $0 lui $4,28411 mthi $1 lui $3,13996 mthi $5 divu $1,$ra sb $4,1($0) mfhi $3 sll $4,$2,26 multu $4,$3 srav $2,$4,$2 div $1,$ra sb $4,16($0) multu $4,$4 multu $5,$4 ori $1,$2,104 sll $3,$1,23 multu $0,$1 mtlo $5 ori $5,$1,24508 mflo $5 addu $4,$3,$3 sb $0,9($0) srav $1,$0,$1 lb $4,8($0) addu $6,$6,$4 mult $4,$4 mflo $0 mult $4,$2 srav $4,$1,$1 addiu $3,$3,4714 sll $2,$2,28 mtlo $4 sb $1,1($0) multu $4,$6 mthi $1 sb $4,15($0) mthi $2 div $4,$ra multu $1,$0 ori $5,$5,22053 sll $2,$5,22 div $0,$ra addu $4,$0,$3 div $5,$ra div $1,$ra multu $2,$2 sll $1,$4,7 lb $4,9($0) divu $2,$ra addiu $5,$4,-26085 mflo $5 div $4,$ra addiu $1,$2,-13866 sll $1,$4,7 mflo $1 lb $5,16($0) multu $0,$2 lb $4,7($0) sb $5,14($0) srav $4,$1,$2 sll $2,$2,29 sb $5,5($0) divu $4,$ra mtlo $4 multu $3,$1 ori $1,$1,54432 sll $3,$4,1 lui $5,15300 multu $6,$4 ori $4,$2,27843 mthi $4 divu $5,$ra sb $0,11($0) srav $0,$4,$0 ori $4,$2,51181 mthi $2 lui $2,23878 addiu $1,$1,-18531 multu $1,$4 mfhi $1 mflo $5 srav $2,$2,$1 div $5,$ra mtlo $5 multu $3,$3 ori $1,$1,44660 mthi $5 sll $5,$0,23 divu $0,$ra addiu $2,$1,12308 multu $1,$3 sll $5,$4,24 mtlo $2 lui $5,20124 multu $2,$5 ori $4,$4,23732 mfhi $4 mflo $5 addu $1,$4,$3 mult $1,$5 lb $3,13($0) mult $6,$6 divu $0,$ra sb $6,12($0) mtlo $4 mfhi $1 divu $3,$ra sll $5,$5,20 mflo $1 addiu $1,$5,-27369 mthi $0 lb $6,15($0) mflo $1 sb $5,16($0) mtlo $1 sb $0,3($0) sb $4,1($0) sb $0,1($0) mult $1,$1 mtlo $4 addiu $1,$4,-15546 lui $3,18391 mtlo $1 mflo $1 div $6,$ra mtlo $1 mthi $4 mfhi $4 mthi $1 srav $5,$6,$6 lui $1,34823 div $5,$ra divu $6,$ra addu $2,$2,$2 addiu $4,$4,-14345 mflo $1 lui $5,14023 lui $1,28062 mfhi $5 lb $6,10($0) lui $1,40693 lui $0,34612 mult $3,$3 lui $3,15193 addiu $5,$0,30497 mtlo $0 sll $4,$0,7 div $2,$ra mfhi $5 sb $6,8($0) divu $4,$ra mthi $0 sb $5,14($0) addiu $1,$4,23040 div $2,$ra srav $4,$2,$3 sb $2,7($0) addu $2,$5,$2 div $4,$ra mtlo $0 mtlo $1 sll $5,$4,12 sll $4,$2,31 div $1,$ra addiu $5,$4,6405 mfhi $2 srav $5,$2,$2 sll $4,$6,27 ori $5,$1,52470 addu $5,$5,$5 ori $4,$4,8913 divu $4,$ra mthi $6 multu $6,$1 addu $0,$1,$6 mfhi $4 ori $4,$0,41836 lui $0,52882 lui $4,51599 multu $1,$5 sb $5,7($0) lb $5,7($0) sll $4,$1,2 lb $5,4($0) sb $1,13($0) srav $3,$3,$3 srav $5,$5,$5 multu $4,$2 ori $4,$1,35279 srav $6,$0,$6 addiu $6,$4,-5523 addu $4,$4,$6 lb $4,8($0) lui $5,11262 sb $1,5($0) mtlo $3 sll $4,$1,24 sll $4,$4,29 addu $2,$2,$2 ori $3,$3,26792 mtlo $3 ori $4,$1,2463 addu $6,$4,$6 ori $6,$6,44580 srav $2,$2,$2 mthi $4 div $4,$ra mtlo $6 divu $4,$ra addu $2,$5,$2 lui $2,58940 sb $1,8($0) sll $5,$5,30 mthi $3 mfhi $2 mtlo $5 ori $5,$2,32441 multu $5,$2 lb $2,12($0) divu $5,$ra lui $3,10849 lui $0,58270 addu $3,$1,$3 addu $1,$1,$1 divu $4,$ra srav $4,$6,$3 srav $4,$6,$4 srav $4,$5,$3 div $4,$ra mfhi $5 multu $4,$1 srav $5,$0,$3 srav $4,$4,$3 addiu $4,$1,914 mult $1,$4 sb $5,9($0) sb $6,4($0) mthi $3 div $1,$ra addu $4,$2,$5 mfhi $5 mult $5,$4 divu $2,$ra mtlo $6 div $4,$ra mtlo $4 sb $1,14($0) mtlo $0 mfhi $6 sb $6,8($0) div $5,$ra lui $3,11717 srav $1,$1,$1 mflo $4 sb $5,15($0) mflo $0 mflo $1 divu $1,$ra mflo $4 sll $3,$4,4 lui $5,28038 divu $5,$ra addu $4,$6,$4 lui $5,29497 mthi $2 mfhi $3 lui $5,60654 lui $4,32341 lui $5,4951 addiu $3,$4,-29010 mthi $4 mthi $4 addiu $6,$6,16056 sll $0,$4,15 lb $6,13($0) divu $2,$ra sll $4,$3,28 div $4,$ra srav $0,$4,$2 mtlo $4 addu $2,$2,$2 ori $1,$2,12182 addiu $0,$4,-19602 mflo $4 multu $6,$1 mult $1,$1 divu $3,$ra lb $3,1($0) mflo $4 lb $1,3($0) mtlo $5 srav $4,$2,$3 mult $5,$4 addu $1,$4,$3 lb $1,6($0) srav $1,$1,$0 ori $5,$2,43455 addiu $5,$5,24151 sb $0,15($0) sb $1,11($0) divu $6,$ra multu $4,$4 mthi $5 multu $4,$4 lb $4,2($0) lui $4,24259 ori $6,$4,58425 div $4,$ra mfhi $5 multu $4,$4 multu $6,$3 div $5,$ra lb $2,6($0) ori $4,$4,59801 sb $4,9($0) lb $4,7($0) sb $6,12($0) lui $5,11029 sb $1,5($0) sb $4,13($0) mtlo $4 mthi $6 sb $3,16($0) div $0,$ra divu $5,$ra div $4,$ra lui $1,10838 sll $6,$4,15 mfhi $4 mtlo $5 sll $4,$4,23 divu $4,$ra div $6,$ra multu $0,$4 lb $4,15($0) addiu $2,$2,-17619 divu $2,$ra lb $5,13($0) lb $5,0($0) mfhi $5 lui $1,10035 divu $0,$ra div $5,$ra mfhi $4 mfhi $4 mtlo $5 sll $3,$4,16 addiu $5,$5,17070 sll $3,$3,23 lb $2,16($0) lb $3,10($0) divu $5,$ra ori $0,$1,20915 mfhi $4 sb $3,8($0) lui $1,53062 addu $3,$1,$3 mfhi $4 lb $4,14($0) mfhi $5 lb $3,13($0) ori $0,$4,4378 lui $4,65166 divu $4,$ra lui $4,9289 mtlo $5 mfhi $6 multu $2,$2 lb $4,2($0) lb $2,11($0) srav $4,$2,$6 multu $1,$2 mtlo $6 div $2,$ra mult $5,$5 div $0,$ra sb $4,10($0) addu $3,$3,$3 sll $6,$1,12 mflo $1 mtlo $1 mflo $5 mult $3,$4 mult $4,$4 addu $0,$5,$0 sb $3,8($0) ori $1,$1,40440 mult $6,$1 srav $1,$2,$1 mthi $4 divu $4,$ra mfhi $1 mthi $6 div $1,$ra mthi $0 addu $6,$5,$6 lui $4,62285 sb $2,14($0) mthi $6 mtlo $4 mthi $4 mflo $4 srav $1,$1,$6 mtlo $4 lui $1,42701 mtlo $1 mtlo $4 mfhi $1 sll $5,$5,16
11.8
18
0.566749
81b031ca844b1d99bab383149aa13bdca8d75875
127
asm
Assembly
lab5/fibonacci/main.asm
samdsk/lab_arch2
45ac71c5647b2a7985f2391686f22ebab685ba67
[ "MIT" ]
null
null
null
lab5/fibonacci/main.asm
samdsk/lab_arch2
45ac71c5647b2a7985f2391686f22ebab685ba67
[ "MIT" ]
null
null
null
lab5/fibonacci/main.asm
samdsk/lab_arch2
45ac71c5647b2a7985f2391686f22ebab685ba67
[ "MIT" ]
null
null
null
.text .globl main main: li $a0 6 li $s0 0 jal fibonacci move $a0 $v0 li $v0 1 syscall exit: li $v0 10 syscall
7.470588
14
0.598425
24b0336acef69b768a1856e2da55de3918b0b348
32,382
asm
Assembly
lab6/lab6 code.asm
jeffliou64/elec291
dc6c77554b6894ae703328eea61653aab429d8ae
[ "MIT" ]
null
null
null
lab6/lab6 code.asm
jeffliou64/elec291
dc6c77554b6894ae703328eea61653aab429d8ae
[ "MIT" ]
null
null
null
lab6/lab6 code.asm
jeffliou64/elec291
dc6c77554b6894ae703328eea61653aab429d8ae
[ "MIT" ]
1
2022-01-28T19:04:22.000Z
2022-01-28T19:04:22.000Z
;-------------------------------------------------------- ; File Created by C51 ; Version 1.0.0 #1069 (Apr 23 2015) (MSVC) ; This file was generated Tue Mar 15 11:58:54 2016 ;-------------------------------------------------------- $name lab6_code $optc51 --model-small $printf_float R_DSEG segment data R_CSEG segment code R_BSEG segment bit R_XSEG segment xdata R_PSEG segment xdata R_ISEG segment idata R_OSEG segment data overlay BIT_BANK segment data overlay R_HOME segment code R_GSINIT segment code R_IXSEG segment xdata R_CONST segment code R_XINIT segment code R_DINIT segment code ;-------------------------------------------------------- ; Public variables in this module ;-------------------------------------------------------- public _InitPinADC_PARM_2 public _main public _Volts_at_Pin public _ADC_at_Pin public _InitPinADC public _InitADC public _Timer2_ISR public __c51_external_startup public _DRV public _PWM_2 public _PWM_1 public _proceed public _pwm_count ;-------------------------------------------------------- ; Special Function Registers ;-------------------------------------------------------- _P0 DATA 0x80 _SP DATA 0x81 _DPL DATA 0x82 _DPH DATA 0x83 _EMI0TC DATA 0x84 _EMI0CF DATA 0x85 _OSCLCN DATA 0x86 _PCON DATA 0x87 _TCON DATA 0x88 _TMOD DATA 0x89 _TL0 DATA 0x8a _TL1 DATA 0x8b _TH0 DATA 0x8c _TH1 DATA 0x8d _CKCON DATA 0x8e _PSCTL DATA 0x8f _P1 DATA 0x90 _TMR3CN DATA 0x91 _TMR4CN DATA 0x91 _TMR3RLL DATA 0x92 _TMR4RLL DATA 0x92 _TMR3RLH DATA 0x93 _TMR4RLH DATA 0x93 _TMR3L DATA 0x94 _TMR4L DATA 0x94 _TMR3H DATA 0x95 _TMR4H DATA 0x95 _USB0ADR DATA 0x96 _USB0DAT DATA 0x97 _SCON DATA 0x98 _SCON0 DATA 0x98 _SBUF DATA 0x99 _SBUF0 DATA 0x99 _CPT1CN DATA 0x9a _CPT0CN DATA 0x9b _CPT1MD DATA 0x9c _CPT0MD DATA 0x9d _CPT1MX DATA 0x9e _CPT0MX DATA 0x9f _P2 DATA 0xa0 _SPI0CFG DATA 0xa1 _SPI0CKR DATA 0xa2 _SPI0DAT DATA 0xa3 _P0MDOUT DATA 0xa4 _P1MDOUT DATA 0xa5 _P2MDOUT DATA 0xa6 _P3MDOUT DATA 0xa7 _IE DATA 0xa8 _CLKSEL DATA 0xa9 _EMI0CN DATA 0xaa __XPAGE DATA 0xaa _SBCON1 DATA 0xac _P4MDOUT DATA 0xae _PFE0CN DATA 0xaf _P3 DATA 0xb0 _OSCXCN DATA 0xb1 _OSCICN DATA 0xb2 _OSCICL DATA 0xb3 _SBRLL1 DATA 0xb4 _SBRLH1 DATA 0xb5 _FLSCL DATA 0xb6 _FLKEY DATA 0xb7 _IP DATA 0xb8 _CLKMUL DATA 0xb9 _SMBTC DATA 0xb9 _AMX0N DATA 0xba _AMX0P DATA 0xbb _ADC0CF DATA 0xbc _ADC0L DATA 0xbd _ADC0H DATA 0xbe _SFRPAGE DATA 0xbf _SMB0CN DATA 0xc0 _SMB1CN DATA 0xc0 _SMB0CF DATA 0xc1 _SMB1CF DATA 0xc1 _SMB0DAT DATA 0xc2 _SMB1DAT DATA 0xc2 _ADC0GTL DATA 0xc3 _ADC0GTH DATA 0xc4 _ADC0LTL DATA 0xc5 _ADC0LTH DATA 0xc6 _P4 DATA 0xc7 _TMR2CN DATA 0xc8 _TMR5CN DATA 0xc8 _REG01CN DATA 0xc9 _TMR2RLL DATA 0xca _TMR5RLL DATA 0xca _TMR2RLH DATA 0xcb _TMR5RLH DATA 0xcb _TMR2L DATA 0xcc _TMR5L DATA 0xcc _TMR2H DATA 0xcd _TMR5H DATA 0xcd _SMB0ADM DATA 0xce _SMB1ADM DATA 0xce _SMB0ADR DATA 0xcf _SMB1ADR DATA 0xcf _PSW DATA 0xd0 _REF0CN DATA 0xd1 _SCON1 DATA 0xd2 _SBUF1 DATA 0xd3 _P0SKIP DATA 0xd4 _P1SKIP DATA 0xd5 _P2SKIP DATA 0xd6 _USB0XCN DATA 0xd7 _PCA0CN DATA 0xd8 _PCA0MD DATA 0xd9 _PCA0CPM0 DATA 0xda _PCA0CPM1 DATA 0xdb _PCA0CPM2 DATA 0xdc _PCA0CPM3 DATA 0xdd _PCA0CPM4 DATA 0xde _P3SKIP DATA 0xdf _ACC DATA 0xe0 _XBR0 DATA 0xe1 _XBR1 DATA 0xe2 _XBR2 DATA 0xe3 _IT01CF DATA 0xe4 _CKCON1 DATA 0xe4 _SMOD1 DATA 0xe5 _EIE1 DATA 0xe6 _EIE2 DATA 0xe7 _ADC0CN DATA 0xe8 _PCA0CPL1 DATA 0xe9 _PCA0CPH1 DATA 0xea _PCA0CPL2 DATA 0xeb _PCA0CPH2 DATA 0xec _PCA0CPL3 DATA 0xed _PCA0CPH3 DATA 0xee _RSTSRC DATA 0xef _B DATA 0xf0 _P0MDIN DATA 0xf1 _P1MDIN DATA 0xf2 _P2MDIN DATA 0xf3 _P3MDIN DATA 0xf4 _P4MDIN DATA 0xf5 _EIP1 DATA 0xf6 _EIP2 DATA 0xf7 _SPI0CN DATA 0xf8 _PCA0L DATA 0xf9 _PCA0H DATA 0xfa _PCA0CPL0 DATA 0xfb _PCA0CPH0 DATA 0xfc _PCA0CPL4 DATA 0xfd _PCA0CPH4 DATA 0xfe _VDM0CN DATA 0xff _DPTR DATA 0x8382 _TMR2RL DATA 0xcbca _TMR3RL DATA 0x9392 _TMR4RL DATA 0x9392 _TMR5RL DATA 0xcbca _TMR2 DATA 0xcdcc _TMR3 DATA 0x9594 _TMR4 DATA 0x9594 _TMR5 DATA 0xcdcc _SBRL1 DATA 0xb5b4 _ADC0 DATA 0xbebd _ADC0GT DATA 0xc4c3 _ADC0LT DATA 0xc6c5 _PCA0 DATA 0xfaf9 _PCA0CP1 DATA 0xeae9 _PCA0CP2 DATA 0xeceb _PCA0CP3 DATA 0xeeed _PCA0CP0 DATA 0xfcfb _PCA0CP4 DATA 0xfefd ;-------------------------------------------------------- ; special function bits ;-------------------------------------------------------- _P0_0 BIT 0x80 _P0_1 BIT 0x81 _P0_2 BIT 0x82 _P0_3 BIT 0x83 _P0_4 BIT 0x84 _P0_5 BIT 0x85 _P0_6 BIT 0x86 _P0_7 BIT 0x87 _TF1 BIT 0x8f _TR1 BIT 0x8e _TF0 BIT 0x8d _TR0 BIT 0x8c _IE1 BIT 0x8b _IT1 BIT 0x8a _IE0 BIT 0x89 _IT0 BIT 0x88 _P1_0 BIT 0x90 _P1_1 BIT 0x91 _P1_2 BIT 0x92 _P1_3 BIT 0x93 _P1_4 BIT 0x94 _P1_5 BIT 0x95 _P1_6 BIT 0x96 _P1_7 BIT 0x97 _S0MODE BIT 0x9f _SCON0_6 BIT 0x9e _MCE0 BIT 0x9d _REN0 BIT 0x9c _TB80 BIT 0x9b _RB80 BIT 0x9a _TI0 BIT 0x99 _RI0 BIT 0x98 _SCON_6 BIT 0x9e _MCE BIT 0x9d _REN BIT 0x9c _TB8 BIT 0x9b _RB8 BIT 0x9a _TI BIT 0x99 _RI BIT 0x98 _P2_0 BIT 0xa0 _P2_1 BIT 0xa1 _P2_2 BIT 0xa2 _P2_3 BIT 0xa3 _P2_4 BIT 0xa4 _P2_5 BIT 0xa5 _P2_6 BIT 0xa6 _P2_7 BIT 0xa7 _EA BIT 0xaf _ESPI0 BIT 0xae _ET2 BIT 0xad _ES0 BIT 0xac _ET1 BIT 0xab _EX1 BIT 0xaa _ET0 BIT 0xa9 _EX0 BIT 0xa8 _P3_0 BIT 0xb0 _P3_1 BIT 0xb1 _P3_2 BIT 0xb2 _P3_3 BIT 0xb3 _P3_4 BIT 0xb4 _P3_5 BIT 0xb5 _P3_6 BIT 0xb6 _P3_7 BIT 0xb7 _IP_7 BIT 0xbf _PSPI0 BIT 0xbe _PT2 BIT 0xbd _PS0 BIT 0xbc _PT1 BIT 0xbb _PX1 BIT 0xba _PT0 BIT 0xb9 _PX0 BIT 0xb8 _MASTER0 BIT 0xc7 _TXMODE0 BIT 0xc6 _STA0 BIT 0xc5 _STO0 BIT 0xc4 _ACKRQ0 BIT 0xc3 _ARBLOST0 BIT 0xc2 _ACK0 BIT 0xc1 _SI0 BIT 0xc0 _MASTER1 BIT 0xc7 _TXMODE1 BIT 0xc6 _STA1 BIT 0xc5 _STO1 BIT 0xc4 _ACKRQ1 BIT 0xc3 _ARBLOST1 BIT 0xc2 _ACK1 BIT 0xc1 _SI1 BIT 0xc0 _TF2 BIT 0xcf _TF2H BIT 0xcf _TF2L BIT 0xce _TF2LEN BIT 0xcd _TF2CEN BIT 0xcc _T2SPLIT BIT 0xcb _TR2 BIT 0xca _T2CSS BIT 0xc9 _T2XCLK BIT 0xc8 _TF5H BIT 0xcf _TF5L BIT 0xce _TF5LEN BIT 0xcd _TMR5CN_4 BIT 0xcc _T5SPLIT BIT 0xcb _TR5 BIT 0xca _TMR5CN_1 BIT 0xc9 _T5XCLK BIT 0xc8 _CY BIT 0xd7 _AC BIT 0xd6 _F0 BIT 0xd5 _RS1 BIT 0xd4 _RS0 BIT 0xd3 _OV BIT 0xd2 _F1 BIT 0xd1 _PARITY BIT 0xd0 _CF BIT 0xdf _CR BIT 0xde _PCA0CN_5 BIT 0xde _CCF4 BIT 0xdc _CCF3 BIT 0xdb _CCF2 BIT 0xda _CCF1 BIT 0xd9 _CCF0 BIT 0xd8 _ACC_7 BIT 0xe7 _ACC_6 BIT 0xe6 _ACC_5 BIT 0xe5 _ACC_4 BIT 0xe4 _ACC_3 BIT 0xe3 _ACC_2 BIT 0xe2 _ACC_1 BIT 0xe1 _ACC_0 BIT 0xe0 _AD0EN BIT 0xef _AD0TM BIT 0xee _AD0INT BIT 0xed _AD0BUSY BIT 0xec _AD0WINT BIT 0xeb _AD0CM2 BIT 0xea _AD0CM1 BIT 0xe9 _AD0CM0 BIT 0xe8 _B_7 BIT 0xf7 _B_6 BIT 0xf6 _B_5 BIT 0xf5 _B_4 BIT 0xf4 _B_3 BIT 0xf3 _B_2 BIT 0xf2 _B_1 BIT 0xf1 _B_0 BIT 0xf0 _SPIF BIT 0xff _WCOL BIT 0xfe _MODF BIT 0xfd _RXOVRN BIT 0xfc _NSSMD1 BIT 0xfb _NSSMD0 BIT 0xfa _TXBMT BIT 0xf9 _SPIEN BIT 0xf8 ;-------------------------------------------------------- ; overlayable register banks ;-------------------------------------------------------- rbank0 segment data overlay ;-------------------------------------------------------- ; internal ram data ;-------------------------------------------------------- rseg R_DSEG _pwm_count: ds 1 _proceed: ds 1 _PWM_1: ds 2 _PWM_2: ds 2 _DRV: ds 2 _main_selection_1_56: ds 2 _main_voltage_1_56: ds 4 ;-------------------------------------------------------- ; overlayable items in internal ram ;-------------------------------------------------------- rseg R_OSEG _InitPinADC_PARM_2: ds 1 rseg R_OSEG ;-------------------------------------------------------- ; indirectly addressable internal ram data ;-------------------------------------------------------- rseg R_ISEG ;-------------------------------------------------------- ; absolute internal ram data ;-------------------------------------------------------- DSEG ;-------------------------------------------------------- ; bit data ;-------------------------------------------------------- rseg R_BSEG _Timer2_ISR_sloc0_1_0: DBIT 1 ;-------------------------------------------------------- ; paged external ram data ;-------------------------------------------------------- rseg R_PSEG ;-------------------------------------------------------- ; external ram data ;-------------------------------------------------------- rseg R_XSEG ;-------------------------------------------------------- ; absolute external ram data ;-------------------------------------------------------- XSEG ;-------------------------------------------------------- ; external initialized ram data ;-------------------------------------------------------- rseg R_IXSEG rseg R_HOME rseg R_GSINIT rseg R_CSEG ;-------------------------------------------------------- ; Reset entry point and interrupt vectors ;-------------------------------------------------------- CSEG at 0x0000 ljmp _crt0 CSEG at 0x002b ljmp _Timer2_ISR ;-------------------------------------------------------- ; global & static initialisations ;-------------------------------------------------------- rseg R_HOME rseg R_GSINIT rseg R_GSINIT ;-------------------------------------------------------- ; data variables initialization ;-------------------------------------------------------- rseg R_DINIT ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:22: volatile unsigned char pwm_count=0; mov _pwm_count,#0x00 ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:24: volatile unsigned int PWM_1=0; clr a mov _PWM_1,a mov (_PWM_1 + 1),a ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:25: volatile unsigned int PWM_2=0; clr a mov _PWM_2,a mov (_PWM_2 + 1),a ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:26: volatile int DRV = 0; clr a mov _DRV,a mov (_DRV + 1),a ; The linker places a 'ret' at the end of segment R_DINIT. ;-------------------------------------------------------- ; code ;-------------------------------------------------------- rseg R_CSEG ;------------------------------------------------------------ ;Allocation info for local variables in function '_c51_external_startup' ;------------------------------------------------------------ ;------------------------------------------------------------ ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:29: char _c51_external_startup (void) ; ----------------------------------------- ; function _c51_external_startup ; ----------------------------------------- __c51_external_startup: using 0 ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:31: PCA0MD&=(~0x40) ; // DISABLE WDT: clear Watchdog Enable bit anl _PCA0MD,#0xBF ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:32: VDM0CN=0x80; // enable VDD monitor mov _VDM0CN,#0x80 ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:33: RSTSRC=0x02|0x04; // Enable reset on missing clock detector and VDD mov _RSTSRC,#0x06 ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:41: CLKSEL|=0b_0000_0011; // SYSCLK derived from the Internal High-Frequency Oscillator / 1. orl _CLKSEL,#0x03 ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:45: OSCICN |= 0x03; // Configure internal oscillator for its maximum frequency orl _OSCICN,#0x03 ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:48: SCON0 = 0x10; mov _SCON0,#0x10 ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:50: TH1 = 0x10000-((SYSCLK/BAUDRATE)/2L); mov _TH1,#0x30 ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:51: CKCON &= ~0x0B; // T1M = 1; SCA1:0 = xx anl _CKCON,#0xF4 ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:52: CKCON |= 0x08; orl _CKCON,#0x08 ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:65: TL1 = TH1; // Init Timer1 mov _TL1,_TH1 ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:66: TMOD &= ~0xf0; // TMOD: timer 1 in 8-bit autoreload anl _TMOD,#0x0F ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:67: TMOD |= 0x20; orl _TMOD,#0x20 ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:68: TR1 = 1; // START Timer1 setb _TR1 ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:69: TI = 1; // Indicate TX0 ready setb _TI ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:72: P2MDOUT|=0b_0000_0011; orl _P2MDOUT,#0x03 ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:73: P0MDOUT |= 0x10; // Enable UTX as push-pull output orl _P0MDOUT,#0x10 ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:74: XBR0 = 0x01; // Enable UART on P0.4(TX) and P0.5(RX) mov _XBR0,#0x01 ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:75: XBR1 = 0x40; // Enable crossbar and weak pull-ups mov _XBR1,#0x40 ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:78: TMR2CN=0x00; // Stop Timer2; Clear TF2; mov _TMR2CN,#0x00 ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:79: CKCON|=0b_0001_0000; orl _CKCON,#0x10 ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:80: TMR2RL=(-(SYSCLK/(2*48))/(100L)); // Initialize reload value mov _TMR2RL,#0x78 mov (_TMR2RL >> 8),#0xEC ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:81: TMR2=0xffff; // Set to reload immediately mov _TMR2,#0xFF mov (_TMR2 >> 8),#0xFF ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:82: ET2=1; // Enable Timer2 interrupts setb _ET2 ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:83: TR2=1; // Start Timer2 setb _TR2 ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:85: EA=1; // Enable interrupts setb _EA ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:87: return 0; mov dpl,#0x00 ret ;------------------------------------------------------------ ;Allocation info for local variables in function 'Timer2_ISR' ;------------------------------------------------------------ ;------------------------------------------------------------ ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:91: void Timer2_ISR (void) interrupt 5 ; ----------------------------------------- ; function Timer2_ISR ; ----------------------------------------- _Timer2_ISR: push acc push ar2 push ar3 push psw mov psw,#0x00 ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:93: TF2H = 0; // Clear Timer2 interrupt flag clr _TF2H ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:95: pwm_count++; inc _pwm_count ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:96: if(pwm_count>100) pwm_count=0; mov a,_pwm_count add a,#0xff - 0x64 jnc L003002? mov _pwm_count,#0x00 L003002?: ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:98: OUT0=pwm_count>PWM_1?0:1; mov r2,_pwm_count mov r3,#0x00 clr c mov a,_PWM_1 subb a,r2 mov a,(_PWM_1 + 1) subb a,r3 mov _Timer2_ISR_sloc0_1_0,c cpl c mov _P2_0,c ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:99: OUT1=pwm_count>PWM_2?0:1; mov r2,_pwm_count mov r3,#0x00 clr c mov a,_PWM_2 subb a,r2 mov a,(_PWM_2 + 1) subb a,r3 mov _Timer2_ISR_sloc0_1_0,c cpl c mov _P2_1,c pop psw pop ar3 pop ar2 pop acc reti ; eliminated unneeded push/pop dpl ; eliminated unneeded push/pop dph ; eliminated unneeded push/pop b ;------------------------------------------------------------ ;Allocation info for local variables in function 'InitADC' ;------------------------------------------------------------ ;------------------------------------------------------------ ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:102: void InitADC (void) ; ----------------------------------------- ; function InitADC ; ----------------------------------------- _InitADC: ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:105: ADC0CF = 0xF8; // SAR clock = 31, Right-justified result mov _ADC0CF,#0xF8 ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:106: ADC0CN = 0b_1000_0000; // AD0EN=1, AD0TM=0 mov _ADC0CN,#0x80 ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:107: REF0CN = 0b_0000_1000; //Select VDD as the voltage reference for the converter mov _REF0CN,#0x08 ret ;------------------------------------------------------------ ;Allocation info for local variables in function 'InitPinADC' ;------------------------------------------------------------ ;pinno Allocated with name '_InitPinADC_PARM_2' ;portno Allocated to registers r2 ;mask Allocated to registers r3 ;------------------------------------------------------------ ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:110: void InitPinADC (unsigned char portno, unsigned char pinno) ; ----------------------------------------- ; function InitPinADC ; ----------------------------------------- _InitPinADC: mov r2,dpl ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:114: mask=1<<pinno; mov b,_InitPinADC_PARM_2 inc b mov a,#0x01 sjmp L005012? L005010?: add a,acc L005012?: djnz b,L005010? mov r3,a ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:116: switch (portno) mov a,r2 add a,#0xff - 0x03 jc L005007? mov a,r2 add a,r2 add a,r2 mov dptr,#L005014? jmp @a+dptr L005014?: ljmp L005001? ljmp L005002? ljmp L005003? ljmp L005004? ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:118: case 0: L005001?: ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:119: P0MDIN &= (~mask); // Set pin as analog input mov a,r3 cpl a anl _P0MDIN,a ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:120: P0SKIP |= mask; // Skip Crossbar decoding for this pin mov a,r3 orl _P0SKIP,a ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:121: break; ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:122: case 1: ret L005002?: ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:123: P1MDIN &= (~mask); // Set pin as analog input mov a,r3 cpl a anl _P1MDIN,a ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:124: P1SKIP |= mask; // Skip Crossbar decoding for this pin mov a,r3 orl _P1SKIP,a ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:125: break; ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:126: case 2: ret L005003?: ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:127: P2MDIN &= (~mask); // Set pin as analog input mov a,r3 cpl a anl _P2MDIN,a ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:128: P2SKIP |= mask; // Skip Crossbar decoding for this pin mov a,r3 orl _P2SKIP,a ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:129: break; ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:130: case 3: ret L005004?: ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:131: P3MDIN &= (~mask); // Set pin as analog input mov a,r3 cpl a mov r2,a anl _P3MDIN,a ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:132: P3SKIP |= mask; // Skip Crossbar decoding for this pin mov a,r3 orl _P3SKIP,a ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:136: } L005007?: ret ;------------------------------------------------------------ ;Allocation info for local variables in function 'ADC_at_Pin' ;------------------------------------------------------------ ;pin Allocated to registers ;------------------------------------------------------------ ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:139: unsigned int ADC_at_Pin(unsigned char pin) ; ----------------------------------------- ; function ADC_at_Pin ; ----------------------------------------- _ADC_at_Pin: mov _AMX0P,dpl ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:142: AMX0N = LQFP32_MUX_GND; // GND is negative input (Single-ended Mode) mov _AMX0N,#0x1F ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:144: AD0BUSY=1; setb _AD0BUSY ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:145: while (AD0BUSY); // Wait for dummy conversion to finish L006001?: jb _AD0BUSY,L006001? ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:147: AD0BUSY = 1; setb _AD0BUSY ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:148: while (AD0BUSY); // Wait for conversion to complete L006004?: jb _AD0BUSY,L006004? ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:149: return (ADC0L+(ADC0H*0x100)); mov r2,_ADC0L mov r3,#0x00 mov r5,_ADC0H mov r4,#0x00 mov a,r4 add a,r2 mov dpl,a mov a,r5 addc a,r3 mov dph,a ret ;------------------------------------------------------------ ;Allocation info for local variables in function 'Volts_at_Pin' ;------------------------------------------------------------ ;pin Allocated to registers r2 ;------------------------------------------------------------ ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:152: float Volts_at_Pin(unsigned char pin) ; ----------------------------------------- ; function Volts_at_Pin ; ----------------------------------------- _Volts_at_Pin: ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:154: return ((ADC_at_Pin(pin)*3.30)/1024.0); lcall _ADC_at_Pin lcall ___uint2fs mov r2,dpl mov r3,dph mov r4,b mov r5,a push ar2 push ar3 push ar4 push ar5 mov dptr,#0x3333 mov b,#0x53 mov a,#0x40 lcall ___fsmul mov r2,dpl mov r3,dph mov r4,b mov r5,a mov a,sp add a,#0xfc mov sp,a clr a push acc push acc mov a,#0x80 push acc mov a,#0x44 push acc mov dpl,r2 mov dph,r3 mov b,r4 mov a,r5 lcall ___fsdiv mov r2,dpl mov r3,dph mov r4,b mov r5,a mov a,sp add a,#0xfc mov sp,a mov dpl,r2 mov dph,r3 mov b,r4 mov a,r5 ret ;------------------------------------------------------------ ;Allocation info for local variables in function 'main' ;------------------------------------------------------------ ;selection Allocated with name '_main_selection_1_56' ;voltage Allocated with name '_main_voltage_1_56' ;------------------------------------------------------------ ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:157: void main (void) ; ----------------------------------------- ; function main ; ----------------------------------------- _main: ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:160: volatile float voltage = 0; mov _main_voltage_1_56,#0x00 ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:162: printf("\x1b[2J"); // Clear screen using ANSI escape sequence. clr a mov (_main_voltage_1_56 + 1),a mov (_main_voltage_1_56 + 2),a mov (_main_voltage_1_56 + 3),a mov a,#__str_0 push acc mov a,#(__str_0 >> 8) push acc mov a,#0x80 push acc lcall _printf dec sp dec sp dec sp ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:163: InitPinADC(1, 7); mov _InitPinADC_PARM_2,#0x07 mov dpl,#0x01 lcall _InitPinADC ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:164: initADC(); lcall _initADC ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:166: while(1) L008015?: ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:168: voltage = Volts_at_Pin(LQFP32_MUX_P1_7); mov dpl,#0x07 lcall _Volts_at_Pin mov _main_voltage_1_56,dpl mov (_main_voltage_1_56 + 1),dph mov (_main_voltage_1_56 + 2),b mov (_main_voltage_1_56 + 3),a ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:169: PWM_1 = 0; ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:170: PWM_2 = 0; clr a mov _PWM_1,a mov (_PWM_1 + 1),a mov _PWM_2,a mov (_PWM_2 + 1),a ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:171: printf(GOTO_YX, 1,1); mov a,#0x01 push acc clr a push acc mov a,#0x01 push acc clr a push acc mov a,#__str_1 push acc mov a,#(__str_1 >> 8) push acc mov a,#0x80 push acc lcall _printf mov a,sp add a,#0xf9 mov sp,a ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:172: printf("\rChoose between two options: temperature controlled motor (1), or user-controlled motor (other): "); mov a,#__str_2 push acc mov a,#(__str_2 >> 8) push acc mov a,#0x80 push acc lcall _printf dec sp dec sp dec sp ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:173: scanf("%d", selection); push _main_selection_1_56 push (_main_selection_1_56 + 1) mov a,#__str_3 push acc mov a,#(__str_3 >> 8) push acc mov a,#0x80 push acc lcall _scanf mov a,sp add a,#0xfb mov sp,a ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:175: if(selection==1) mov a,#0x01 cjne a,_main_selection_1_56,L008024? clr a cjne a,(_main_selection_1_56 + 1),L008024? sjmp L008025? L008024?: sjmp L008012? L008025?: ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:177: printf("\rvoltage: %.3f", voltage); push _main_voltage_1_56 push (_main_voltage_1_56 + 1) push (_main_voltage_1_56 + 2) push (_main_voltage_1_56 + 3) mov a,#__str_4 push acc mov a,#(__str_4 >> 8) push acc mov a,#0x80 push acc lcall _printf mov a,sp add a,#0xf9 mov sp,a ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:178: printf("\nType 'o' and press enter to end PWM: "); mov a,#__str_5 push acc mov a,#(__str_5 >> 8) push acc mov a,#0x80 push acc lcall _printf dec sp dec sp dec sp ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:179: scanf("%s", &proceed); mov a,#_proceed push acc mov a,#(_proceed >> 8) push acc mov a,#0x40 push acc mov a,#__str_6 push acc mov a,#(__str_6 >> 8) push acc mov a,#0x80 push acc lcall _scanf mov a,sp add a,#0xfa mov sp,a ljmp L008013? L008012?: ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:182: printf("\rPlease Input PWM Range 100 to -100: "); mov a,#__str_7 push acc mov a,#(__str_7 >> 8) push acc mov a,#0x80 push acc lcall _printf dec sp dec sp dec sp ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:183: scanf("%d", &DRV); mov a,#_DRV push acc mov a,#(_DRV >> 8) push acc mov a,#0x40 push acc mov a,#__str_3 push acc mov a,#(__str_3 >> 8) push acc mov a,#0x80 push acc lcall _scanf mov a,sp add a,#0xfa mov sp,a ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:184: if(DRV < -100 || DRV > 100) clr c mov a,_DRV subb a,#0x9C mov a,(_DRV + 1) xrl a,#0x80 subb a,#0x7f jc L008007? mov a,#0x64 subb a,_DRV clr a xrl a,#0x80 mov b,(_DRV + 1) xrl b,#0x80 subb a,b jnc L008008? L008007?: ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:185: printf("Value Not Within Range"); mov a,#__str_8 push acc mov a,#(__str_8 >> 8) push acc mov a,#0x80 push acc lcall _printf dec sp dec sp dec sp sjmp L008009? L008008?: ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:186: else if(DRV > 0) clr c clr a subb a,_DRV clr a xrl a,#0x80 mov b,(_DRV + 1) xrl b,#0x80 subb a,b jnc L008005? ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:188: PWM_1 = DRV; mov _PWM_1,_DRV mov (_PWM_1 + 1),(_DRV + 1) ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:189: PWM_2 = 0; clr a mov _PWM_2,a mov (_PWM_2 + 1),a sjmp L008009? L008005?: ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:191: else if(DRV < 0) mov a,(_DRV + 1) jnb acc.7,L008002? ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:193: PWM_1 = 0; clr a mov _PWM_1,a mov (_PWM_1 + 1),a ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:194: PWM_2 = -DRV; clr c clr a subb a,_DRV mov _PWM_2,a clr a subb a,(_DRV + 1) mov (_PWM_2 + 1),a sjmp L008009? L008002?: ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:198: PWM_1 = 0; ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:199: PWM_2 = 0; clr a mov _PWM_1,a mov (_PWM_1 + 1),a mov _PWM_2,a mov (_PWM_2 + 1),a L008009?: ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:201: printf("\nType 'o' and press enter to end PWM: "); mov a,#__str_5 push acc mov a,#(__str_5 >> 8) push acc mov a,#0x80 push acc lcall _printf dec sp dec sp dec sp ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:202: scanf("%s", &proceed); mov a,#_proceed push acc mov a,#(_proceed >> 8) push acc mov a,#0x40 push acc mov a,#__str_6 push acc mov a,#(__str_6 >> 8) push acc mov a,#0x80 push acc lcall _scanf mov a,sp add a,#0xfa mov sp,a L008013?: ; C:\Users\jeffreyliou\Desktop\elec291\lab6\lab6 code.c:204: printf("\x1b[2J"); mov a,#__str_0 push acc mov a,#(__str_0 >> 8) push acc mov a,#0x80 push acc lcall _printf dec sp dec sp dec sp ljmp L008015? rseg R_CSEG rseg R_XINIT rseg R_CONST __str_0: db 0x1B db '[2J' db 0x00 __str_1: db 0x1B db '[%d;%dH' db 0x00 __str_2: db 0x0D db 'Choose between two options: temperature controlled motor (1' db '), or user-controlled motor (other): ' db 0x00 __str_3: db '%d' db 0x00 __str_4: db 0x0D db 'voltage: %.3f' db 0x00 __str_5: db 0x0A db 'Type ' db 0x27 db 'o' db 0x27 db ' and press enter to end PWM: ' db 0x00 __str_6: db '%s' db 0x00 __str_7: db 0x0D db 'Please Input PWM Range 100 to -100: ' db 0x00 __str_8: db 'Value Not Within Range' db 0x00 CSEG end
29.252033
171
0.557903
7fb35e542968503e5e2283e707e7dfb9456b3aa5
1,634
asm
Assembly
asm/spim/csc-201/e1.asm
dindoliboon/archive
a5b54367dbb57260f9230375ac81e86c5fce0d7d
[ "MIT" ]
4
2020-10-02T15:24:20.000Z
2021-11-02T04:20:38.000Z
asm/spim/csc-201/e1.asm
dindoliboon/archive
a5b54367dbb57260f9230375ac81e86c5fce0d7d
[ "MIT" ]
null
null
null
asm/spim/csc-201/e1.asm
dindoliboon/archive
a5b54367dbb57260f9230375ac81e86c5fce0d7d
[ "MIT" ]
2
2019-10-28T01:20:07.000Z
2020-10-02T15:25:13.000Z
# ========================================================================= # # NAME: # DATE: May 24, 2001 # ASSIGNMENT: Example #1, CSC-201-01 # OBJECTIVE: Obtain name from keyboard and greet user. # # ========================================================================= .data .align 2 # ========================================================================= prompt1: .asciiz "Enter your name: " prompt2: .asciiz "Hello " prompt3: .asciiz "You have logged on successfully!\n" # ========================================================================= .text .align 2 main: # ========================================================================= # # $a1 - user name # # ========================================================================= # ::::: OP :::: ARGUMENTS ::::::::::::: COMMENTS :::::::::::::::::::::::::: # ========================================================================= la $a0, prompt1 li $v0, 4 syscall # print "Enter your name:" li $a1, 30 li $v0, 8 syscall # read name from keyboard move $a1, $a0 # save string into a0 la $a0, prompt2 li $v0, 4 syscall # print "Hello" move $a0, $a1 li $v0, 4 syscall # print typed in name la $a0, prompt3 li $v0, 4 syscall # print "You have logged ... " # ========================================================================= li $v0, 10 syscall # exit program # ========================================================================= # :::::::::::::::::::::::::::: END OF PROGRAM! :::::::::::::::::::::::::::: # =========================================================================
25.53125
75
0.289474
7824ac69d16543ce066e89dce503ed54f2353a90
65
asm
Assembly
src/main/fragment/mos6502-common/qvom1=qvom2_plus_vwsm1.asm
jbrandwood/kickc
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
[ "MIT" ]
2
2022-03-01T02:21:14.000Z
2022-03-01T04:33:35.000Z
src/main/fragment/mos6502-common/qvom1=qvom2_plus_vwsm1.asm
jbrandwood/kickc
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
[ "MIT" ]
null
null
null
src/main/fragment/mos6502-common/qvom1=qvom2_plus_vwsm1.asm
jbrandwood/kickc
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
[ "MIT" ]
null
null
null
lda {m2} clc adc {m1} sta {m1} lda {m2}+1 adc {m1}+1 sta {m1}+1
8.125
11
0.553846
27804fba5ac9a7c8f3817e24f4c7c75153f55dd3
79
asm
Assembly
examples/call_asm_from_c/callme.asm
arbiter0xf/hog
c59a3e0ddf295991e247cc44de5e6a9c325a02de
[ "MIT" ]
null
null
null
examples/call_asm_from_c/callme.asm
arbiter0xf/hog
c59a3e0ddf295991e247cc44de5e6a9c325a02de
[ "MIT" ]
1
2022-03-29T19:19:21.000Z
2022-03-29T19:19:21.000Z
examples/call_asm_from_c/callme.asm
arbiter0xf/hog
c59a3e0ddf295991e247cc44de5e6a9c325a02de
[ "MIT" ]
null
null
null
BITS 32 SECTION .text GLOBAL asm_return_33 asm_return_33: mov eax, 33 ret
7.9
20
0.759494
a957001a539d746a0ed5f0d0caa9f5909fad062a
4,198
asm
Assembly
Source_code/shifts.asm
alexcw234/dlxtetris
c369516fa1ac6a35b9209dd9cc009e1b016f81c2
[ "MIT" ]
null
null
null
Source_code/shifts.asm
alexcw234/dlxtetris
c369516fa1ac6a35b9209dd9cc009e1b016f81c2
[ "MIT" ]
null
null
null
Source_code/shifts.asm
alexcw234/dlxtetris
c369516fa1ac6a35b9209dd9cc009e1b016f81c2
[ "MIT" ]
null
null
null
; ICS 331 ; Tetris ; Alex Watanabe ; Using DLX architecture ; Contains anything to do with shifting so I don't have to ; scroll through many things while working on the program ; Function that shifts pieces from the current shift to the desired shift ; Arguments Taken- ; R4 | Sublocation pointer to current shift (0xC) ; R5 | Address of the piece rotation block (0x1300) ; R6 | The direction to shift (normally from x input) ; If 0 is passed in, assume default. : R7 | The sublocation pointer for the piece set (the _0 in R5) ; Arguments Passed- ; Calls no functions ; Temporaries- ; R8 | pieceRow counter ; R9 | Current row temp ; R10 | ; R11 | Temporary holder for new shift ; R12 | ; R13 | ; R14 | subtraciton result temp2 ; R15 | subtraction result temp ; ; R16 | Address of piece block (0x1300 + piece designation) ; R17 | Address of current shift for piece & upper bound of orientations ; R18 | Current shift ; R19 | Default shift ; R20 | Desired shift ; R21 | ; R22 | ; R23 | ; ; R24 | Logical temporary ; R25 | Logical temporary 2 ; Returns- ; N/A ; ; Function start, calculate needed address from arguments pshift: add R16 R5 R7 add R17 R16 R4 ; Now load current shift and default shift lw R18 R17 0x0 lw R19 R17 0x1 ; Is R6 0 (setup/new piece) or 1-3 (controller) ; If 0, we're resetting to default so ; R20 should be set to R19 ; Otherwise, R20 should be adjusted from R18 accordingly beqz R6 todeflt bnez R6 tonrml todeflt: addi R20 R19 0x0 beqz R0 endtodn tonrml: addi R20 R18 0x0 ; Calculate if R6 is 1 2 or 3 ; SL for negative, SR for positive addi R15 R6 -2 beqz R15 endtodn slti R24 R16 0x0 bnez R24 ifSL sgti R24 R16 0x0 bnez R24 ifSR ; For these if statements we first check if above/below bounds ; (note that we count shift from right corner) ifSL: addi R11 R20 1 sgei R24 R11 0xFF bnez R24 endtodn addi R20 R11 0x0 beqz R0 endtodn ifSR: addi R11 R20 -1 slti R24 R11 0x00 bnez R24 endtodn addi R20 R11 0x0 beqz R0 endtodn ; At this point we have the current shift ; R18 and the desired shift R20 ; Now we iterate over every orientation for that piece endtodn: addi R8 R16 0x0 ; Here's the outer while loop. ; Go until R18 = R20 shifting: sub R14 R20 R18 ; if >0 shift left, if <0 shift right else end slti R24 R14 0x0 sgti R25 R14 0x0 beqz R14 enshift ; Here's the inner while loop. R17 has the upper bound of iteration ; Go until pointer on 0x13_C sh1: sub R15 R17 R8 beqz R15 endsh1 bnez R25 shftL bnez R24 shftR beqz R0 retsft ; Shifts shftL: lw R9 R8 0x0 sll R9 R9 sw R9 R8 0x0 beqz R0 retsft shftR: lw R9 R8 0x0 srl R9 R9 sw R9 R8 0x0 beqz R0 retsft retsft: addi R8 R8 1 beqz R0 sh1 endsh1: addi R8 R16 0x0 ; Adjust currentshift accordingly bnez R25 eshftL bnez R24 eshftR beqz R0 ensh2 eshftL: addi R18 R18 1 beqz R0 ensh2 eshftR: addi R18 R18 -1 beqz R0 ensh2 ensh2: beqz R0 shifting enshift: sw R18 R16 0xC ; current shift stored and all piecerows have been shifted jr R31
32.796875
79
0.514531
7393c776a7ed438b8978b949d5cb6fa1f96777bd
304
asm
Assembly
programs/oeis/114/A114219.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/114/A114219.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/114/A114219.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A114219: Number triangle (k-(k-1)*0^(n-k))*[k<=n]. ; 1,0,1,0,1,1,0,1,2,1,0,1,2,3,1,0,1,2,3,4,1,0,1,2,3,4,5,1,0,1,2,3,4,5,6,1,0,1,2,3,4,5,6,7,1,0,1,2,3,4,5,6,7,8,1,0,1,2,3,4,5,6,7,8,9,1 mov $1,1 lpb $0 add $1,1 sub $0,$1 lpe mov $1,$0 mov $2,2 lpb $2 mov $0,2 mov $2,$1 add $2,1 lpe sub $0,1
17.882353
133
0.506579
8b5227fe90dcf4e899bf99653624d476baadeabd
20,830
asm
Assembly
sw/552tests/rand_complex/t_7_all.asm
JPShen-UWM/ThreadKraken
849c510531f28e36d3469535737b2120bd774935
[ "MIT" ]
1
2022-02-15T16:03:25.000Z
2022-02-15T16:03:25.000Z
sw/552tests/rand_complex/t_7_all.asm
JPShen-UWM/ThreadKraken
849c510531f28e36d3469535737b2120bd774935
[ "MIT" ]
null
null
null
sw/552tests/rand_complex/t_7_all.asm
JPShen-UWM/ThreadKraken
849c510531f28e36d3469535737b2120bd774935
[ "MIT" ]
null
null
null
// seed 7 lbi r0, 68 // icount 0 slbi r0, 174 // icount 1 lbi r1, 67 // icount 2 slbi r1, 33 // icount 3 lbi r2, 126 // icount 4 slbi r2, 76 // icount 5 lbi r3, 40 // icount 6 slbi r3, 184 // icount 7 lbi r4, 2 // icount 8 slbi r4, 23 // icount 9 lbi r5, 200 // icount 10 slbi r5, 228 // icount 11 lbi r6, 136 // icount 12 slbi r6, 227 // icount 13 lbi r7, 74 // icount 14 slbi r7, 106 // icount 15 add r4, r2, r3 // icount 16 j 24 // icount 17 nop // icount 18 nop // icount 19 nop // icount 20 nop // icount 21 nop // icount 22 nop // icount 23 nop // icount 24 nop // icount 25 nop // icount 26 nop // icount 27 nop // icount 28 nop // icount 29 lbi r5, 0 // icount 30 lbi r0, 0 // icount 31 nop // to align branch icount 32 beqz r1, 4 // icount 33 roli r0, r7, 5 // icount 34 ror r6, r5, r2 // icount 35 andni r1, r1, 1 // icount 36 stu r4, r1, 6 // icount 37 andni r0, r6, 0 // icount 38 lbi r4, 0 // icount 39 lbi r1, 0 // icount 40 beqz r2, 20 // icount 41 andni r2, r2, 1 // icount 42 ld r0, r2, 0 // icount 43 seq r4, r1, r6 // icount 44 addi r1, r1, 4 // icount 45 lbi r3, 6 // icount 46 lbi r1, 4 // icount 47 sco r5, r6, r1 // icount 48 sub r0, r7, r0 // icount 49 andni r0, r0, 1 // icount 50 stu r6, r0, 2 // icount 51 add r0, r5, r4 // icount 52 sub r6, r7, r0 // icount 53 subi r4, r6, 11 // icount 54 andni r2, r2, 2 // icount 55 andni r3, r3, 1 // icount 56 st r7, r3, 0 // icount 57 rol r7, r5, r7 // icount 58 xori r0, r3, 4 // icount 59 andn r3, r0, r2 // icount 60 addi r2, r2, 9 // icount 61 andni r1, r1, 1 // icount 62 stu r4, r1, 6 // icount 63 srli r7, r5, 2 // icount 64 add r3, r5, r2 // icount 65 lbi r4, 0 // icount 66 lbi r3, 0 // icount 67 nop // to align branch icount 68 bgez r1, 16 // icount 69 andni r3, r3, 1 // icount 70 st r6, r3, 10 // icount 71 srl r6, r7, r5 // icount 72 nop // to align meminst icount 73 andni r3, r3, 1 // icount 74 stu r5, r3, 4 // icount 75 seq r4, r7, r4 // icount 76 slbi r5, 8 // icount 77 xori r3, r3, 4 // icount 78 rol r3, r3, r6 // icount 79 subi r3, r4, 3 // icount 80 sco r2, r1, r1 // icount 81 sle r6, r0, r2 // icount 82 slt r3, r1, r7 // icount 83 subi r2, r4, 12 // icount 84 subi r5, r2, 4 // icount 85 add r5, r2, r7 // icount 86 xori r6, r6, 7 // icount 87 slt r0, r0, r3 // icount 88 j 8 // icount 89 nop // icount 90 nop // icount 91 nop // icount 92 nop // icount 93 lbi r4, 0 // icount 94 lbi r0, 0 // icount 95 nop // to align branch icount 96 bnez r3, 12 // icount 97 srl r2, r1, r6 // icount 98 nop // to align meminst icount 99 andni r2, r2, 1 // icount 100 ld r7, r2, 10 // icount 101 xor r0, r7, r6 // icount 102 add r2, r5, r2 // icount 103 srli r3, r1, 12 // icount 104 nop // to align meminst icount 105 andni r0, r0, 1 // icount 106 stu r2, r0, 10 // icount 107 roli r2, r1, 15 // icount 108 roli r3, r1, 13 // icount 109 add r4, r3, r3 // icount 110 sco r3, r0, r1 // icount 111 xor r2, r2, r2 // icount 112 andn r2, r2, r5 // icount 113 lbi r4, 0 // icount 114 lbi r5, 0 // icount 115 nop // to align branch icount 116 bnez r2, 28 // icount 117 andn r0, r6, r7 // icount 118 xor r1, r0, r6 // icount 119 srl r7, r4, r0 // icount 120 rori r2, r0, 11 // icount 121 subi r1, r2, 6 // icount 122 xor r4, r3, r1 // icount 123 add r5, r1, r1 // icount 124 slt r7, r7, r2 // icount 125 andni r7, r7, 1 // icount 126 ld r2, r7, 10 // icount 127 roli r5, r1, 13 // icount 128 srli r5, r6, 9 // icount 129 sub r5, r2, r6 // icount 130 subi r4, r5, 3 // icount 131 andni r3, r3, 1 // icount 132 stu r0, r3, 8 // icount 133 andn r7, r4, r0 // icount 134 sle r1, r7, r7 // icount 135 sub r2, r5, r4 // icount 136 andn r1, r7, r0 // icount 137 add r5, r0, r5 // icount 138 xor r7, r6, r2 // icount 139 addi r0, r4, 6 // icount 140 andn r5, r6, r5 // icount 141 andni r5, r5, 1 // icount 142 st r2, r5, 0 // icount 143 subi r6, r3, 3 // icount 144 seq r1, r5, r7 // icount 145 slli r4, r2, 7 // icount 146 add r7, r0, r4 // icount 147 sle r6, r6, r2 // icount 148 lbi r0, 0 // icount 149 lbi r3, 0 // icount 150 bltz r0, 12 // icount 151 sco r0, r6, r3 // icount 152 ror r4, r2, r5 // icount 153 andni r3, r3, 1 // icount 154 stu r2, r3, 0 // icount 155 andni r4, r4, 1 // icount 156 ld r0, r4, 10 // icount 157 sub r0, r2, r3 // icount 158 srl r0, r3, r3 // icount 159 xori r5, r7, 1 // icount 160 ror r7, r1, r7 // icount 161 andni r5, r1, 3 // icount 162 sll r4, r7, r7 // icount 163 ror r3, r2, r5 // icount 164 rol r5, r5, r4 // icount 165 lbi r6, 0 // icount 166 lbi r2, 0 // icount 167 nop // to align branch icount 168 bnez r4, 20 // icount 169 sub r5, r5, r3 // icount 170 add r5, r3, r5 // icount 171 ror r7, r1, r2 // icount 172 slt r5, r6, r6 // icount 173 andni r1, r1, 1 // icount 174 st r6, r1, 0 // icount 175 slbi r0, 7 // icount 176 xori r2, r0, 1 // icount 177 seq r1, r7, r3 // icount 178 seq r2, r5, r3 // icount 179 sle r4, r7, r2 // icount 180 srli r5, r0, 13 // icount 181 andni r5, r5, 9 // icount 182 slli r1, r2, 0 // icount 183 slt r7, r0, r3 // icount 184 andn r0, r5, r0 // icount 185 slt r2, r5, r5 // icount 186 ror r2, r2, r6 // icount 187 slli r3, r1, 10 // icount 188 nop // to align meminst icount 189 andni r5, r5, 1 // icount 190 st r0, r5, 0 // icount 191 addi r7, r5, 14 // icount 192 j 30 // icount 193 nop // icount 194 nop // icount 195 nop // icount 196 nop // icount 197 nop // icount 198 nop // icount 199 nop // icount 200 nop // icount 201 nop // icount 202 nop // icount 203 nop // icount 204 nop // icount 205 nop // icount 206 nop // icount 207 nop // icount 208 xor r3, r5, r0 // icount 209 j 30 // icount 210 nop // icount 211 nop // icount 212 nop // icount 213 nop // icount 214 nop // icount 215 nop // icount 216 nop // icount 217 nop // icount 218 nop // icount 219 nop // icount 220 nop // icount 221 nop // icount 222 nop // icount 223 nop // icount 224 nop // icount 225 slli r1, r5, 7 // icount 226 lbi r6, 0 // icount 227 lbi r5, 0 // icount 228 beqz r7, 12 // icount 229 sub r0, r5, r4 // icount 230 slli r5, r0, 8 // icount 231 subi r7, r5, 0 // icount 232 sco r2, r1, r7 // icount 233 sub r3, r7, r6 // icount 234 subi r5, r1, 11 // icount 235 andni r3, r3, 1 // icount 236 stu r6, r3, 2 // icount 237 xor r5, r1, r0 // icount 238 roli r1, r6, 0 // icount 239 xori r1, r6, 6 // icount 240 seq r0, r6, r2 // icount 241 sle r3, r4, r7 // icount 242 j 12 // icount 243 nop // icount 244 nop // icount 245 nop // icount 246 nop // icount 247 nop // icount 248 nop // icount 249 j 32 // icount 250 nop // icount 251 nop // icount 252 nop // icount 253 nop // icount 254 nop // icount 255 nop // icount 256 nop // icount 257 nop // icount 258 nop // icount 259 nop // icount 260 nop // icount 261 nop // icount 262 nop // icount 263 nop // icount 264 nop // icount 265 nop // icount 266 andn r6, r1, r7 // icount 267 seq r0, r0, r3 // icount 268 j 8 // icount 269 nop // icount 270 nop // icount 271 nop // icount 272 nop // icount 273 lbi r6, 0 // icount 274 lbi r7, 0 // icount 275 nop // to align branch icount 276 bnez r7, 8 // icount 277 andni r5, r4, 8 // icount 278 addi r3, r7, 4 // icount 279 subi r5, r4, 11 // icount 280 nop // to align meminst icount 281 andni r1, r1, 1 // icount 282 ld r6, r1, 8 // icount 283 andni r1, r1, 1 // icount 284 st r5, r1, 12 // icount 285 srli r1, r2, 8 // icount 286 add r5, r3, r6 // icount 287 srli r5, r5, 7 // icount 288 srl r2, r1, r4 // icount 289 j 22 // icount 290 nop // icount 291 nop // icount 292 nop // icount 293 nop // icount 294 nop // icount 295 nop // icount 296 nop // icount 297 nop // icount 298 nop // icount 299 nop // icount 300 nop // icount 301 lbi r3, 0 // icount 302 lbi r0, 0 // icount 303 nop // to align branch icount 304 bltz r3, 4 // icount 305 andni r2, r2, 1 // icount 306 ld r0, r2, 0 // icount 307 sco r3, r3, r7 // icount 308 xor r5, r7, r6 // icount 309 roli r6, r2, 8 // icount 310 j 2 // icount 311 nop // icount 312 addi r4, r7, 2 // icount 313 slli r0, r1, 4 // icount 314 lbi r1, 0 // icount 315 lbi r2, 0 // icount 316 bltz r1, 0 // icount 317 lbi r5, 0 // icount 318 lbi r1, 0 // icount 319 nop // to align branch icount 320 bgez r0, 4 // icount 321 seq r5, r2, r0 // icount 322 add r7, r7, r7 // icount 323 slt r5, r7, r4 // icount 324 rol r6, r0, r3 // icount 325 lbi r5, 0 // icount 326 lbi r5, 0 // icount 327 nop // to align branch icount 328 beqz r0, 12 // icount 329 roli r5, r6, 2 // icount 330 roli r4, r7, 7 // icount 331 addi r0, r4, 15 // icount 332 subi r2, r4, 12 // icount 333 subi r3, r1, 11 // icount 334 nop // to align meminst icount 335 andni r4, r4, 1 // icount 336 ld r5, r4, 0 // icount 337 andni r6, r6, 1 // icount 338 stu r0, r6, 2 // icount 339 add r3, r7, r6 // icount 340 sle r6, r2, r0 // icount 341 addi r3, r5, 11 // icount 342 xori r4, r7, 4 // icount 343 srl r0, r6, r0 // icount 344 andn r6, r1, r1 // icount 345 lbi r2, 0 // icount 346 lbi r1, 0 // icount 347 nop // to align branch icount 348 bnez r6, 4 // icount 349 sub r4, r3, r7 // icount 350 rori r4, r1, 14 // icount 351 add r1, r3, r3 // icount 352 rori r1, r3, 2 // icount 353 roli r4, r4, 15 // icount 354 xor r1, r7, r3 // icount 355 lbi r7, 0 // icount 356 lbi r3, 0 // icount 357 nop // to align branch icount 358 beqz r2, 8 // icount 359 sub r1, r6, r0 // icount 360 andni r0, r6, 9 // icount 361 andni r3, r3, 1 // icount 362 st r5, r3, 6 // icount 363 sll r4, r2, r0 // icount 364 andn r0, r6, r7 // icount 365 lbi r5, 12 // icount 366 seq r7, r5, r0 // icount 367 addi r6, r3, 0 // icount 368 rori r3, r0, 7 // icount 369 j 0 // icount 370 j 26 // icount 371 nop // icount 372 nop // icount 373 nop // icount 374 nop // icount 375 nop // icount 376 nop // icount 377 nop // icount 378 nop // icount 379 nop // icount 380 nop // icount 381 nop // icount 382 nop // icount 383 nop // icount 384 j 16 // icount 385 nop // icount 386 nop // icount 387 nop // icount 388 nop // icount 389 nop // icount 390 nop // icount 391 nop // icount 392 nop // icount 393 ror r3, r5, r0 // icount 394 lbi r4, 0 // icount 395 lbi r2, 0 // icount 396 beqz r0, 20 // icount 397 sub r6, r6, r6 // icount 398 seq r0, r6, r3 // icount 399 srl r3, r7, r5 // icount 400 srli r6, r1, 2 // icount 401 slbi r1, 2 // icount 402 rol r4, r4, r6 // icount 403 add r4, r1, r6 // icount 404 slli r3, r3, 5 // icount 405 andni r3, r3, 1 // icount 406 ld r6, r3, 4 // icount 407 seq r6, r4, r1 // icount 408 addi r0, r6, 6 // icount 409 slbi r6, 3 // icount 410 sub r6, r6, r2 // icount 411 sco r1, r1, r1 // icount 412 rori r4, r7, 3 // icount 413 sll r1, r1, r4 // icount 414 andni r4, r0, 14 // icount 415 andni r2, r2, 1 // icount 416 ld r5, r2, 12 // icount 417 andni r2, r2, 1 // icount 418 st r1, r2, 2 // icount 419 roli r3, r4, 1 // icount 420 slbi r1, 10 // icount 421 xor r5, r3, r3 // icount 422 j 0 // icount 423 lbi r7, 0 // icount 424 lbi r5, 0 // icount 425 nop // to align branch icount 426 beqz r4, 16 // icount 427 add r6, r3, r5 // icount 428 lbi r6, 12 // icount 429 roli r5, r5, 8 // icount 430 sll r3, r6, r1 // icount 431 andn r0, r5, r6 // icount 432 roli r6, r0, 3 // icount 433 roli r7, r3, 7 // icount 434 srli r3, r7, 12 // icount 435 andn r3, r0, r0 // icount 436 andn r7, r2, r1 // icount 437 roli r1, r2, 0 // icount 438 slt r6, r0, r1 // icount 439 srl r2, r2, r5 // icount 440 xor r6, r4, r1 // icount 441 andni r2, r2, 1 // icount 442 stu r0, r2, 0 // icount 443 andni r0, r0, 1 // icount 444 ld r2, r0, 2 // icount 445 rori r2, r0, 8 // icount 446 j 18 // icount 447 nop // icount 448 nop // icount 449 nop // icount 450 nop // icount 451 nop // icount 452 nop // icount 453 nop // icount 454 nop // icount 455 nop // icount 456 slli r1, r6, 14 // icount 457 andni r0, r0, 1 // icount 458 stu r2, r0, 8 // icount 459 lbi r0, 0 // icount 460 lbi r6, 0 // icount 461 nop // to align branch icount 462 bnez r1, 4 // icount 463 andni r7, r0, 1 // icount 464 lbi r6, 2 // icount 465 xori r1, r3, 6 // icount 466 sle r2, r7, r3 // icount 467 lbi r0, 0 // icount 468 lbi r4, 0 // icount 469 nop // to align branch icount 470 beqz r0, 8 // icount 471 add r5, r7, r0 // icount 472 rol r1, r3, r3 // icount 473 andni r1, r1, 1 // icount 474 stu r5, r1, 14 // icount 475 slli r4, r1, 7 // icount 476 slbi r7, 9 // icount 477 slbi r3, 6 // icount 478 xori r5, r1, 7 // icount 479 srli r3, r7, 11 // icount 480 subi r4, r7, 13 // icount 481 lbi r5, 0 // icount 482 lbi r2, 0 // icount 483 nop // to align branch icount 484 bnez r7, 20 // icount 485 andni r5, r5, 14 // icount 486 slbi r7, 0 // icount 487 ror r5, r5, r5 // icount 488 sll r5, r1, r7 // icount 489 seq r4, r4, r0 // icount 490 srli r1, r6, 6 // icount 491 addi r1, r6, 0 // icount 492 subi r6, r5, 15 // icount 493 sll r2, r5, r4 // icount 494 subi r2, r5, 1 // icount 495 ror r7, r7, r2 // icount 496 xor r0, r4, r4 // icount 497 subi r5, r1, 2 // icount 498 slbi r3, 0 // icount 499 ror r0, r2, r2 // icount 500 slt r5, r5, r3 // icount 501 andni r6, r6, 1 // icount 502 stu r7, r6, 4 // icount 503 addi r4, r0, 0 // icount 504 nop // to align meminst icount 505 andni r7, r7, 1 // icount 506 st r2, r7, 6 // icount 507 sub r6, r3, r3 // icount 508 j 18 // icount 509 nop // icount 510 nop // icount 511 nop // icount 512 nop // icount 513 nop // icount 514 nop // icount 515 nop // icount 516 nop // icount 517 nop // icount 518 sco r0, r6, r0 // icount 519 srl r2, r6, r5 // icount 520 lbi r1, 0 // icount 521 lbi r1, 0 // icount 522 bltz r7, 16 // icount 523 sub r3, r4, r4 // icount 524 xori r5, r1, 3 // icount 525 rol r6, r6, r3 // icount 526 nop // to align meminst icount 527 andni r7, r7, 1 // icount 528 st r1, r7, 6 // icount 529 subi r6, r3, 12 // icount 530 ror r5, r5, r5 // icount 531 rol r6, r1, r2 // icount 532 sle r1, r7, r0 // icount 533 ror r0, r1, r7 // icount 534 andn r7, r2, r3 // icount 535 andni r2, r5, 15 // icount 536 addi r0, r3, 2 // icount 537 andn r3, r7, r7 // icount 538 sll r6, r6, r5 // icount 539 andni r6, r6, 1 // icount 540 st r2, r6, 6 // icount 541 sco r3, r3, r4 // icount 542 lbi r0, 0 // icount 543 lbi r0, 0 // icount 544 bgez r7, 0 // icount 545 lbi r1, 0 // icount 546 lbi r1, 0 // icount 547 nop // to align branch icount 548 beqz r5, 28 // icount 549 rori r0, r1, 3 // icount 550 add r6, r2, r4 // icount 551 srli r2, r4, 1 // icount 552 nop // to align meminst icount 553 andni r0, r0, 1 // icount 554 st r1, r0, 2 // icount 555 roli r0, r3, 15 // icount 556 subi r4, r0, 12 // icount 557 subi r2, r2, 15 // icount 558 seq r2, r7, r1 // icount 559 rol r2, r3, r2 // icount 560 slt r6, r7, r0 // icount 561 seq r0, r7, r6 // icount 562 slt r2, r1, r2 // icount 563 srl r2, r1, r1 // icount 564 ror r6, r3, r2 // icount 565 slbi r1, 15 // icount 566 srli r1, r7, 12 // icount 567 sll r2, r7, r3 // icount 568 xori r1, r2, 4 // icount 569 andni r5, r5, 1 // icount 570 stu r6, r5, 0 // icount 571 sle r2, r7, r3 // icount 572 nop // to align meminst icount 573 andni r0, r0, 1 // icount 574 ld r6, r0, 2 // icount 575 add r6, r2, r1 // icount 576 andn r3, r3, r3 // icount 577 andni r1, r6, 11 // icount 578 roli r1, r0, 3 // icount 579 slbi r4, 8 // icount 580 sco r1, r0, r3 // icount 581 slli r5, r7, 7 // icount 582 subi r1, r4, 15 // icount 583 j 22 // icount 584 nop // icount 585 nop // icount 586 nop // icount 587 nop // icount 588 nop // icount 589 nop // icount 590 nop // icount 591 nop // icount 592 nop // icount 593 nop // icount 594 nop // icount 595 lbi r6, 12 // icount 596 lbi r5, 0 // icount 597 lbi r3, 0 // icount 598 beqz r5, 12 // icount 599 sle r3, r1, r2 // icount 600 addi r0, r7, 1 // icount 601 slt r4, r2, r7 // icount 602 slli r1, r1, 4 // icount 603 rol r3, r6, r7 // icount 604 andni r0, r4, 15 // icount 605 srl r5, r3, r1 // icount 606 ror r2, r6, r7 // icount 607 subi r1, r5, 0 // icount 608 andni r4, r1, 7 // icount 609 slt r5, r2, r2 // icount 610 subi r5, r3, 7 // icount 611 andni r6, r6, 1 // icount 612 st r0, r6, 12 // icount 613 andni r2, r0, 3 // icount 614 j 4 // icount 615 nop // icount 616 nop // icount 617 j 6 // icount 618 nop // icount 619 nop // icount 620 nop // icount 621 andni r7, r7, 1 // icount 622 st r6, r7, 6 // icount 623 srl r7, r2, r2 // icount 624 nop // to align meminst icount 625 andni r3, r3, 1 // icount 626 stu r6, r3, 6 // icount 627 xor r4, r7, r7 // icount 628 j 28 // icount 629 nop // icount 630 nop // icount 631 nop // icount 632 nop // icount 633 nop // icount 634 nop // icount 635 nop // icount 636 nop // icount 637 nop // icount 638 nop // icount 639 nop // icount 640 nop // icount 641 nop // icount 642 nop // icount 643 srl r1, r0, r5 // icount 644 andn r6, r2, r7 // icount 645 slbi r0, 15 // icount 646 lbi r4, 0 // icount 647 lbi r2, 0 // icount 648 bltz r5, 12 // icount 649 andn r1, r0, r5 // icount 650 addi r5, r1, 14 // icount 651 andni r2, r7, 13 // icount 652 nop // to align meminst icount 653 andni r5, r5, 1 // icount 654 stu r0, r5, 0 // icount 655 lbi r5, 9 // icount 656 slt r6, r7, r3 // icount 657 seq r3, r0, r0 // icount 658 sll r4, r4, r3 // icount 659 andni r7, r7, 1 // icount 660 ld r0, r7, 12 // icount 661 add r4, r3, r2 // icount 662 add r1, r4, r7 // icount 663 lbi r7, 10 // icount 664 j 6 // icount 665 nop // icount 666 nop // icount 667 nop // icount 668 lbi r6, 0 // icount 669 lbi r6, 0 // icount 670 bltz r2, 24 // icount 671 xori r6, r1, 15 // icount 672 srl r2, r1, r0 // icount 673 andni r5, r5, 1 // icount 674 ld r4, r5, 2 // icount 675 sco r1, r1, r0 // icount 676 rol r1, r2, r1 // icount 677 ror r0, r2, r6 // icount 678 add r4, r0, r2 // icount 679 slbi r6, 11 // icount 680 srl r6, r0, r5 // icount 681 andni r2, r2, 1 // icount 682 st r2, r2, 4 // icount 683 andn r2, r1, r2 // icount 684 slli r7, r0, 13 // icount 685 andni r3, r3, 1 // icount 686 stu r1, r3, 14 // icount 687 slbi r0, 6 // icount 688 slbi r2, 12 // icount 689 andni r4, r7, 15 // icount 690 roli r3, r4, 0 // icount 691 seq r7, r6, r1 // icount 692 sle r6, r5, r4 // icount 693 andni r4, r4, 1 // icount 694 stu r0, r4, 2 // icount 695 slli r4, r6, 6 // icount 696 sle r6, r2, r2 // icount 697 xor r5, r1, r2 // icount 698 nop // to align meminst icount 699 andni r2, r2, 1 // icount 700 ld r1, r2, 14 // icount 701 lbi r1, 0 // icount 702 lbi r6, 0 // icount 703 nop // to align branch icount 704 bnez r0, 4 // icount 705 slbi r7, 7 // icount 706 subi r0, r5, 13 // icount 707 sle r4, r3, r6 // icount 708 xori r2, r2, 12 // icount 709 sle r7, r6, r3 // icount 710 slbi r0, 5 // icount 711 andni r7, r7, 1 // icount 712 st r3, r7, 14 // icount 713 xor r0, r1, r0 // icount 714 lbi r0, 0 // icount 715 lbi r3, 0 // icount 716 beqz r7, 28 // icount 717 slbi r1, 4 // icount 718 srli r1, r4, 3 // icount 719 srli r4, r3, 9 // icount 720 slt r7, r3, r1 // icount 721 slbi r3, 1 // icount 722 add r0, r3, r1 // icount 723 andni r0, r0, 1 // icount 724 st r5, r0, 8 // icount 725 xori r0, r7, 7 // icount 726 nop // to align meminst icount 727 andni r6, r6, 1 // icount 728 ld r3, r6, 0 // icount 729 addi r2, r0, 4 // icount 730 xori r0, r6, 3 // icount 731 rol r7, r3, r3 // icount 732 slbi r5, 15 // icount 733 slli r2, r4, 8 // icount 734 sub r4, r7, r7 // icount 735 roli r0, r4, 14 // icount 736 nop // to align meminst icount 737 andni r7, r7, 1 // icount 738 stu r4, r7, 12 // icount 739 andni r2, r2, 1 // icount 740 st r5, r2, 4 // icount 741 andni r5, r5, 1 // icount 742 st r7, r5, 0 // icount 743 seq r1, r1, r4 // icount 744 xori r3, r1, 8 // icount 745 sll r1, r6, r3 // icount 746 nop // to align meminst icount 747 andni r7, r7, 1 // icount 748 ld r4, r7, 4 // icount 749 lbi r6, 15 // icount 750 seq r0, r5, r5 // icount 751 andni r1, r1, 1 // icount 752 stu r3, r1, 12 // icount 753 srl r1, r2, r0 // icount 754 addi r6, r0, 14 // icount 755 j 2 // icount 756 nop // icount 757 andni r1, r6, 11 // icount 758 andn r5, r3, r7 // icount 759 sub r6, r2, r1 // icount 760 xor r6, r1, r7 // icount 761 j 32 // icount 762 nop // icount 763 nop // icount 764 nop // icount 765 nop // icount 766 nop // icount 767 nop // icount 768 nop // icount 769 nop // icount 770 nop // icount 771 nop // icount 772 nop // icount 773 nop // icount 774 nop // icount 775 nop // icount 776 nop // icount 777 nop // icount 778 slli r5, r2, 3 // icount 779 andni r2, r2, 1 // icount 780 st r6, r2, 2 // icount 781 j 4 // icount 782 nop // icount 783 nop // icount 784 sle r2, r4, r5 // icount 785 j 10 // icount 786 nop // icount 787 nop // icount 788 nop // icount 789 nop // icount 790 nop // icount 791 sll r6, r4, r4 // icount 792 lbi r7, 12 // icount 793 j 18 // icount 794 nop // icount 795 nop // icount 796 nop // icount 797 nop // icount 798 nop // icount 799 nop // icount 800 nop // icount 801 nop // icount 802 nop // icount 803 j 8 // icount 804 nop // icount 805 nop // icount 806 nop // icount 807 nop // icount 808 j 14 // icount 809 nop // icount 810 nop // icount 811 nop // icount 812 nop // icount 813 nop // icount 814 nop // icount 815 nop // icount 816 halt // icount 817
25.402439
34
0.63687
e329e12daed87b4db138e4a3edb32a86ee69c60e
1,450
asm
Assembly
programs/oeis/250/A250723.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/250/A250723.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/250/A250723.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A250723: Number of (n+1) X (2+1) 0..1 arrays with nondecreasing x(i,j)+x(i,j-1) in the i direction and nondecreasing min(x(i,j),x(i-1,j)) in the j direction. ; 22,46,85,144,230,350,513,728,1006,1358,1797,2336,2990,3774,4705,5800,7078,8558,10261,12208,14422,16926,19745,22904,26430,30350,34693,39488,44766,50558,56897,63816,71350,79534,88405,98000,108358,119518,131521,144408,158222,173006,188805,205664,223630,242750,263073,284648,307526,331758,357397,384496,413110,443294,475105,508600,543838,580878,619781,660608,703422,748286,795265,844424,895830,949550,1005653,1064208,1125286,1188958,1255297,1324376,1396270,1471054,1548805,1629600,1713518,1800638,1891041,1984808,2082022,2182766,2287125,2395184,2507030,2622750,2742433,2866168,2994046,3126158,3262597,3403456,3548830,3698814,3853505,4013000,4177398,4346798,4521301,4701008 mov $2,$0 add $2,1 mov $4,$0 lpb $2 mov $0,$4 sub $2,1 sub $0,$2 mov $5,$0 add $5,1 mov $6,0 mov $7,$0 lpb $5 mov $0,$7 sub $5,1 sub $0,$5 mov $9,2 mov $10,0 mov $11,$0 lpb $9 mov $0,$11 sub $9,1 add $0,$9 sub $0,1 mov $12,$0 cmp $12,0 add $0,$12 add $0,3 seq $0,131941 ; Partial sums of ceiling(n^2/2) (A000982). add $0,4 mov $3,$0 mov $8,$9 mul $8,$0 add $10,$8 lpe min $11,1 mul $11,$3 mov $3,$10 sub $3,$11 add $3,2 add $6,$3 lpe add $1,$6 lpe mov $0,$1
30.208333
670
0.644138
6dfcb8a00968c0767782c6b28be1342e774d44ea
721
asm
Assembly
kernel/arch/i386/irq_a.asm
Heasummn/DevOS
2e37321c5fc14a3a6b3bb02d2ffb3a3ec4d7596f
[ "MIT" ]
8
2016-05-11T21:14:24.000Z
2021-02-11T15:29:38.000Z
kernel/arch/i386/irq_a.asm
Heasummn/DevOS
2e37321c5fc14a3a6b3bb02d2ffb3a3ec4d7596f
[ "MIT" ]
null
null
null
kernel/arch/i386/irq_a.asm
Heasummn/DevOS
2e37321c5fc14a3a6b3bb02d2ffb3a3ec4d7596f
[ "MIT" ]
2
2016-04-28T09:01:02.000Z
2016-06-06T10:08:06.000Z
global irq0 global irq1 global irq2 global irq3 global irq4 global irq5 global irq6 global irq7 global irq8 global irq9 global irq10 global irq11 global irq12 global irq13 global irq14 global irq15 %macro IRQ 1 irq%1: cli push byte 0 push byte %1 + 32 jmp irq_common_stub %endmacro IRQ 0 IRQ 1 IRQ 2 IRQ 3 IRQ 4 IRQ 5 IRQ 6 IRQ 7 IRQ 8 IRQ 9 IRQ 10 IRQ 11 IRQ 12 IRQ 13 IRQ 14 IRQ 15 extern irq_handler irq_common_stub: pusha push ds push es push fs push gs mov ax, 0x10 mov ds, ax mov es, ax mov fs, ax mov gs, ax mov eax, esp push eax mov eax, irq_handler call eax pop eax pop gs pop fs pop es pop ds popa add esp, 8 iret
10.449275
24
0.661581
dff218676236333dd89cb91ec708fe9d3e8ea0d3
1,620
asm
Assembly
programs/oeis/153/A153642.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/153/A153642.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/153/A153642.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A153642: a(n) = 4*n^2 + 24*n + 8. ; 36,72,116,168,228,296,372,456,548,648,756,872,996,1128,1268,1416,1572,1736,1908,2088,2276,2472,2676,2888,3108,3336,3572,3816,4068,4328,4596,4872,5156,5448,5748,6056,6372,6696,7028,7368,7716,8072,8436,8808,9188,9576,9972,10376,10788,11208,11636,12072,12516,12968,13428,13896,14372,14856,15348,15848,16356,16872,17396,17928,18468,19016,19572,20136,20708,21288,21876,22472,23076,23688,24308,24936,25572,26216,26868,27528,28196,28872,29556,30248,30948,31656,32372,33096,33828,34568,35316,36072,36836,37608,38388,39176,39972,40776,41588,42408,43236,44072,44916,45768,46628,47496,48372,49256,50148,51048,51956,52872,53796,54728,55668,56616,57572,58536,59508,60488,61476,62472,63476,64488,65508,66536,67572,68616,69668,70728,71796,72872,73956,75048,76148,77256,78372,79496,80628,81768,82916,84072,85236,86408,87588,88776,89972,91176,92388,93608,94836,96072,97316,98568,99828,101096,102372,103656,104948,106248,107556,108872,110196,111528,112868,114216,115572,116936,118308,119688,121076,122472,123876,125288,126708,128136,129572,131016,132468,133928,135396,136872,138356,139848,141348,142856,144372,145896,147428,148968,150516,152072,153636,155208,156788,158376,159972,161576,163188,164808,166436,168072,169716,171368,173028,174696,176372,178056,179748,181448,183156,184872,186596,188328,190068,191816,193572,195336,197108,198888,200676,202472,204276,206088,207908,209736,211572,213416,215268,217128,218996,220872,222756,224648,226548,228456,230372,232296,234228,236168,238116,240072,242036,244008,245988,247976,249972,251976,253988,256008 mov $1,$0 add $0,8 mul $1,$0 mul $1,4 add $1,36
180
1,534
0.817901
008bd27005191a4af8cfcc293b9bf54495496ae1
12,235
asm
Assembly
mikroC/DisLcd/project.asm
chen0040/cs-dspic-ultrasonic
0f9fde891cf66f480bb4a89e016da671c28d77e4
[ "MIT" ]
null
null
null
mikroC/DisLcd/project.asm
chen0040/cs-dspic-ultrasonic
0f9fde891cf66f480bb4a89e016da671c28d77e4
[ "MIT" ]
null
null
null
mikroC/DisLcd/project.asm
chen0040/cs-dspic-ultrasonic
0f9fde891cf66f480bb4a89e016da671c28d77e4
[ "MIT" ]
null
null
null
_MyLcd_Out: ;project.c,65 :: void MyLcd_Out(char* text) ;project.c,68 :: MyLcdOutLen=strlen(text); PUSH W11 PUSH W12 CALL _strlen MOV W0, _MyLcdOutLen ;project.c,69 :: for(MyLcdOutIdx=0; MyLcdOutIdx != MyLcdOutLen; ++MyLcdOutIdx) CLR W0 MOV W0, _MyLcdOutIdx L_MyLcd_Out0: MOV _MyLcdOutIdx, W1 MOV #lo_addr(_MyLcdOutLen), W0 CP W1, [W0] BRA NZ L__MyLcd_Out61 GOTO L_MyLcd_Out1 L__MyLcd_Out61: ;project.c,71 :: Lcd_Chr(MyLcdRow, MyLcdOutIdx+1, text[MyLcdOutIdx]); MOV #lo_addr(_MyLcdOutIdx), W0 ADD W10, [W0], W1 MOV _MyLcdOutIdx, W0 INC W0 PUSH W10 MOV.B [W1], W12 MOV W0, W11 MOV _MyLcdRow, W10 CALL _Lcd_Chr POP W10 ;project.c,69 :: for(MyLcdOutIdx=0; MyLcdOutIdx != MyLcdOutLen; ++MyLcdOutIdx) MOV #1, W1 MOV #lo_addr(_MyLcdOutIdx), W0 ADD W1, [W0], [W0] ;project.c,72 :: } GOTO L_MyLcd_Out0 L_MyLcd_Out1: ;project.c,73 :: } L_end_MyLcd_Out: POP W12 POP W11 RETURN ; end of _MyLcd_Out _Timer1Int: PUSH RCOUNT PUSH W0 MOV #2, W0 REPEAT #12 PUSH [W0++] ;project.c,76 :: void Timer1Int() iv IVT_ADDR_T1INTERRUPT { // Timer interrupt, sample with 40kHz ;project.c,77 :: LATC = ~PORTC; // invert PortC for generating signal MOV #lo_addr(LATC), W1 MOV PORTC, WREG COM W0, [W1] ;project.c,78 :: IFS0.T1IF = 0; // clear interrupt flag BCLR IFS0, #3 ;project.c,79 :: } L_end_Timer1Int: MOV #26, W0 REPEAT #12 POP [W0--] POP W0 POP RCOUNT RETFIE ; end of _Timer1Int _InitPort: ;project.c,81 :: void InitPort(void) { // function for initialization of I/O PORTS ;project.c,82 :: ADPCFG = 0xFEFF; // Configure AN pins as digital except PinB8 MOV #65279, W0 MOV WREG, ADPCFG ;project.c,83 :: TRISC = 0x0000; // set PORTC as output CLR TRISC ;project.c,84 :: PORTC = 0x2000; // default value of PORTC MOV #8192, W0 MOV WREG, PORTC ;project.c,85 :: TRISB.B8 = 1; // set PinB8 as input BSET TRISB, #8 ;project.c,86 :: } L_end_InitPort: RETURN ; end of _InitPort _InitTimer: ;project.c,88 :: void InitTimer(void) { // Initialization of Timer1 ;project.c,89 :: T1CON.B5 = 0; // prescaler 1:1 BCLR T1CON, #5 ;project.c,90 :: T1CON.B4 = 0; BCLR T1CON, #4 ;project.c,91 :: PR1 = (unsigned long)(Get_Fosc_kHz()) * 1000 / (8 * SAMPLE_FREQ); CALL _Get_Fosc_kHz MOV #1000, W2 MOV #0, W3 CALL __Multiply_32x32 MOV #57856, W2 MOV #4, W3 CLR W4 CALL __Divide_32x32 MOV W0, PR1 ;project.c,92 :: TON_bit = 1; // start Timer1 BSET TON_bit, #15 ;project.c,93 :: } L_end_InitTimer: RETURN ; end of _InitTimer _InitDelay: ;project.c,95 :: void InitDelay(void) { // Initialization of Timer2 ;project.c,96 :: T2CON.B5 = 0; // prescaler 1:8 BCLR T2CON, #5 ;project.c,97 :: T2CON.B4 = 1; BSET T2CON, #4 ;project.c,98 :: TMR2 = 0x0000; // Initial value of TMR2 register CLR TMR2 ;project.c,99 :: T2CON.TON = 1; // start Timer2 BSET T2CON, #15 ;project.c,100 :: } L_end_InitDelay: RETURN ; end of _InitDelay _InitADC: ;project.c,102 :: void InitADC(void) { // Initialization of ADC module ;project.c,103 :: ADC1_Init(); CALL _ADC1_Init ;project.c,104 :: } L_end_InitADC: RETURN ; end of _InitADC _InitVariable: ;project.c,106 :: void InitVariable(void) { // setting initial values ;project.c,107 :: abc = 0; CLR W0 MOV W0, _abc ;project.c,108 :: temp_old = 0; CLR W0 MOV W0, _temp_old ;project.c,109 :: distance = 0; CLR W0 MOV W0, _distance ;project.c,110 :: } L_end_InitVariable: RETURN ; end of _InitVariable _InitLCD: ;project.c,112 :: void InitLCD(void) { // Initialization of UART1 ;project.c,113 :: Lcd_Init(); PUSH W10 CALL _Lcd_Init ;project.c,114 :: Lcd_Cmd(_LCD_CLEAR); MOV.B #1, W10 CALL _Lcd_Cmd ;project.c,115 :: Lcd_Cmd(_LCD_CURSOR_OFF); MOV.B #12, W10 CALL _Lcd_Cmd ;project.c,116 :: } L_end_InitLCD: POP W10 RETURN ; end of _InitLCD _main: MOV #2048, W15 MOV #6142, W0 MOV WREG, 32 MOV #1, W0 MOV WREG, 52 MOV #4, W0 IOR 68 LNK #14 PUSH W4 PUSH W3 ;project.c,118 :: void main() { // Main Program ;project.c,120 :: InitPort(); // Initialization PUSH W10 PUSH W11 CALL _InitPort ;project.c,121 :: InitTimer(); CALL _InitTimer ;project.c,122 :: InitADC(); CALL _InitADC ;project.c,123 :: InitLCD(); CALL _InitLCD ;project.c,125 :: while(1) { // Unending loop L_main3: ;project.c,128 :: IEC0.T1IE = 1; // enable T1 interrupt BSET IEC0, #3 ;project.c,129 :: Delay_us(100); // Software PWM lasts 300us MOV #83, W7 L_main5: DEC W7 BRA NZ L_main5 NOP ;project.c,130 :: IEC0.T1IE = 0; // disable T1 interrupt BCLR IEC0, #3 ;project.c,133 :: Delay_ms(1); // wait 1ms so piezzo sattles down MOV #833, W7 L_main7: DEC W7 BRA NZ L_main7 NOP ;project.c,135 :: InitDelay(); // Start/initialize Timer2 to count Delay CALL _InitDelay ;project.c,137 :: temp = ADC1_Get_Sample(8); // get first two samples MOV #8, W10 CALL _ADC1_Get_Sample MOV W0, _temp ;project.c,138 :: Delay_us(1); NOP NOP ;project.c,139 :: temp_sec = ADC1_Get_Sample(8); MOV #8, W10 CALL _ADC1_Get_Sample MOV W0, _temp_sec ;project.c,141 :: InitVariable(); // Initialization of Variables CALL _InitVariable ;project.c,143 :: while (temp > temp_sec) { // check if returned wave is uprising L_main9: MOV _temp, W1 MOV #lo_addr(_temp_sec), W0 CP W1, [W0] BRA GTU L__main70 GOTO L_main10 L__main70: ;project.c,144 :: Delay_us(10); // if not check again in 10us MOV #8, W7 L_main11: DEC W7 BRA NZ L_main11 NOP ;project.c,145 :: temp = ADC1_Get_Sample(8); MOV #8, W10 CALL _ADC1_Get_Sample MOV W0, _temp ;project.c,146 :: Delay_us(1); NOP NOP ;project.c,147 :: temp_sec = ADC1_Get_Sample(8); MOV #8, W10 CALL _ADC1_Get_Sample MOV W0, _temp_sec ;project.c,148 :: } GOTO L_main9 L_main10: ;project.c,150 :: while(abc < 1000) { // Measure in lenght of 250ms L_main13: MOV _abc, W1 MOV #1000, W0 CP W1, W0 BRA LT L__main71 GOTO L_main14 L__main71: ;project.c,151 :: temp = ADC1_Get_Sample(8); // get sample MOV #8, W10 CALL _ADC1_Get_Sample MOV W0, _temp ;project.c,152 :: if (temp > temp_old) { // if new value is bigger then old MOV #lo_addr(_temp_old), W1 CP W0, [W1] BRA GTU L__main72 GOTO L_main15 L__main72: ;project.c,153 :: temp_old = temp; // set value of ADC into temporary variable MOV _temp, W0 MOV W0, _temp_old ;project.c,154 :: time = TMR2; // remember time when value was measured MOV TMR2, WREG MOV W0, _time ;project.c,155 :: } L_main15: ;project.c,156 :: abc++; MOV #1, W1 MOV #lo_addr(_abc), W0 ADD W1, [W0], [W0] ;project.c,157 :: Delay_us(50); MOV #41, W7 L_main16: DEC W7 BRA NZ L_main16 NOP NOP ;project.c,158 :: } GOTO L_main13 L_main14: ;project.c,159 :: T2CON.TON = 0; // Stop Timer2 BCLR T2CON, #15 ;project.c,161 :: if (time < 0) // absolute value of time MOV _time, W0 CP W0, #0 BRA LTU L__main73 GOTO L_main18 L__main73: ;project.c,162 :: time = - time; MOV _time, W1 MOV #lo_addr(_time), W0 SUBR W1, #0, [W0] L_main18: ;project.c,165 :: if (time < 600) MOV _time, W1 MOV #600, W0 CP W1, W0 BRA LTU L__main74 GOTO L_main19 L__main74: ;project.c,166 :: distance = time / 40; // 40 MOV #40, W2 MOV _time, W0 REPEAT #17 DIV.U W0, W2 MOV W0, _distance GOTO L_main20 L_main19: ;project.c,167 :: else if ((time > 599) && (time < 1200)) MOV _time, W1 MOV #599, W0 CP W1, W0 BRA GTU L__main75 GOTO L__main51 L__main75: MOV _time, W1 MOV #1200, W0 CP W1, W0 BRA LTU L__main76 GOTO L__main50 L__main76: L__main49: ;project.c,168 :: distance = time / 60; // 60 MOV #60, W2 MOV _time, W0 REPEAT #17 DIV.U W0, W2 MOV W0, _distance GOTO L_main24 ;project.c,167 :: else if ((time > 599) && (time < 1200)) L__main51: L__main50: ;project.c,169 :: else if ((time > 1199) && (time < 2800)) MOV _time, W1 MOV #1199, W0 CP W1, W0 BRA GTU L__main77 GOTO L__main53 L__main77: MOV _time, W1 MOV #2800, W0 CP W1, W0 BRA LTU L__main78 GOTO L__main52 L__main78: L__main48: ;project.c,170 :: distance = time / 90; // 90 MOV #90, W2 MOV _time, W0 REPEAT #17 DIV.U W0, W2 MOV W0, _distance GOTO L_main28 ;project.c,169 :: else if ((time > 1199) && (time < 2800)) L__main53: L__main52: ;project.c,171 :: else if ((time > 2799) && (time < 7200)) MOV _time, W1 MOV #2799, W0 CP W1, W0 BRA GTU L__main79 GOTO L__main55 L__main79: MOV _time, W1 MOV #7200, W0 CP W1, W0 BRA LTU L__main80 GOTO L__main54 L__main80: L__main47: ;project.c,172 :: distance = time / 110; // 110 MOV #110, W2 MOV _time, W0 REPEAT #17 DIV.U W0, W2 MOV W0, _distance GOTO L_main32 ;project.c,171 :: else if ((time > 2799) && (time < 7200)) L__main55: L__main54: ;project.c,173 :: else if ((time > 7199) && (time < 20000)) MOV _time, W1 MOV #7199, W0 CP W1, W0 BRA GTU L__main81 GOTO L__main57 L__main81: MOV _time, W1 MOV #20000, W0 CP W1, W0 BRA LTU L__main82 GOTO L__main56 L__main82: L__main46: ;project.c,174 :: distance = time / 125; // 125 MOV #125, W2 MOV _time, W0 REPEAT #17 DIV.U W0, W2 MOV W0, _distance GOTO L_main36 ;project.c,173 :: else if ((time > 7199) && (time < 20000)) L__main57: L__main56: ;project.c,175 :: else if ((time > 19999) && (time < 35000)) MOV _time, W1 MOV #19999, W0 CP W1, W0 BRA GTU L__main83 GOTO L__main59 L__main83: MOV _time, W1 MOV #35000, W0 CP W1, W0 BRA LTU L__main84 GOTO L__main58 L__main84: L__main45: ;project.c,176 :: distance = time / 135; // 135 MOV #135, W2 MOV _time, W0 REPEAT #17 DIV.U W0, W2 MOV W0, _distance GOTO L_main40 ;project.c,175 :: else if ((time > 19999) && (time < 35000)) L__main59: L__main58: ;project.c,178 :: distance = 0; CLR W0 MOV W0, _distance L_main40: L_main36: L_main32: L_main28: L_main24: L_main20: ;project.c,180 :: if (distance == 0) { // if distance is 0 the object is too far MOV _distance, W0 CP W0, #0 BRA Z L__main85 GOTO L_main41 L__main85: ;project.c,181 :: Lcd_Cmd(_LCD_CLEAR); MOV.B #1, W10 CALL _Lcd_Cmd ;project.c,182 :: MyLcd_Out ("Too Far!"); // send value over UART ADD W14, #0, W3 MOV #___Lib_System_DefaultPage, W4 MOV W4, 52 MOV #lo_addr(?ICS?lstr1_project), W4 REPEAT #8 MOV.B [W4++], [W3++] ADD W14, #0, W0 MOV W0, W10 CALL _MyLcd_Out ;project.c,183 :: } GOTO L_main42 L_main41: ;project.c,185 :: IntToStr(distance, txt); // converts time into string MOV #lo_addr(_txt), W11 MOV _distance, W10 CALL _IntToStr ;project.c,186 :: Lcd_Cmd(_LCD_CLEAR); MOV.B #1, W10 CALL _Lcd_Cmd ;project.c,187 :: MyLcd_Out(txt); // send value over UART MOV #lo_addr(_txt), W10 CALL _MyLcd_Out ;project.c,188 :: MyLcd_Out (" cm"); // send value over UART MOV #32, W3 MOV.B W3, [W14+9] MOV #99, W3 MOV.B W3, [W14+10] MOV #109, W3 MOV.B W3, [W14+11] MOV #0, W3 MOV.B W3, [W14+12] ADD W14, #9, W0 MOV W0, W10 CALL _MyLcd_Out ;project.c,189 :: } L_main42: ;project.c,191 :: Delay_ms(500); // delay before next measure MOV #7, W8 MOV #23451, W7 L_main43: DEC W7 BRA NZ L_main43 DEC W8 BRA NZ L_main43 NOP NOP ;project.c,192 :: } GOTO L_main3 ;project.c,193 :: } L_end_main: POP W3 POP W4 ULNK L__main86: BRA L__main86 ; end of _main
23.574181
110
0.601962
83f3afb9035c6ee70db0abc80387cf9b3258982a
4,171
asm
Assembly
src/asm_files/CCSCNE/showcaseShell.asm
zedth2/sunyat-c
cb036b32eff9e5e201d114c784b3198aa11d34d4
[ "MIT" ]
null
null
null
src/asm_files/CCSCNE/showcaseShell.asm
zedth2/sunyat-c
cb036b32eff9e5e201d114c784b3198aa11d34d4
[ "MIT" ]
null
null
null
src/asm_files/CCSCNE/showcaseShell.asm
zedth2/sunyat-c
cb036b32eff9e5e201d114c784b3198aa11d34d4
[ "MIT" ]
null
null
null
.constant TERM 0xFF .constant CR 0xD .constant LF 0xA jmp !main !cmdTable .variable cmdTable0 !incReg0 .variable cmdTable1 !incReg1 .variable cmdTable2 !incReg2 .variable cmdTable3 !incReg3 .variable cmdTable4 !incReg4 .variable cmdTable5 !incReg5 .variable cmdTable6 !incReg6 .variable cmdTable7 !incReg7 .variable cmdTable8 !awrdown .variable cmdTable9 !awrup .variable cmdTable10 !savestate ;a ;.variable cmdTable11 ! ;.variable cmdTable12 ! ;.variable cmdTable13 ! ;.variable cmdTable14 ! ;.variable cmdTable15 ! ;.variable cmdTable16 ! ;.variable cmdTable17 ! ;.variable cmdTable18 ! ;.variable cmdTable19 ! ;.variable cmdTable20 ! ;.variable cmdTable21 ! ;.variable cmdTable22 ! ;.variable cmdTable23 ! ;.variable cmdTable24 ! ;.variable cmdTable25 ! ;.variable cmdTable26 ! ;.variable cmdTable27 ! ;.variable cmdTable28 ! ;.variable cmdTable29 ! ;.variable cmdTable30 ! ;.variable cmdTable31 ! ;.variable cmdTable32 ! ;.variable cmdTable33 ! ;.variable cmdTable34 ! ;.variable cmdTable35 ! ;z !crlf .variable crlf0 CR .variable crlf1 LF .variable crlf2 0x00 !prompt .variable prompt0 '[' .variable prompt1 'm' .variable prompt2 'e' .variable prompt3 '@' .variable prompt4 'S' .variable prompt5 'U' .variable prompt6 'N' .variable prompt7 'Y' .variable prompt8 'A' .variable prompt9 'T' .variable prompt10 ']' .variable prompt11 0x00 ;-!main------------------------------------------------------------------------------------------ !main mov R0 !prompt call !print ;print the prompt call !get_character ;get a character (command) and executes it if it's 0-7 call !print_line jmp !main ;back to the top !quit_shell ret !main_end ;------------------------------------------------------------------------------------------------ ;-!get_character--------------------------------------------------------------------------------- !get_character ;gc load R0 TERM cmp R0 0xFF ;Not just ncurses dumping stuff jeq !get_character cmp R0 0x30 ;The character '0' jls !get_character cmp R0 0x3A ;The character ':' (direclyt after 9 in ascii) jls !numberCmd ;user entered a value 0 - 9 cmp R0 0x61 ;The character 'a' jls !get_character cmp R0 0x7A ;the character 'z' jls !letterCmd ;user entered a value a - z jgr !get_character !numberCmd add R0 -46 ;get the cmd location from !cmdTable (starts at mem loc 2) loadp R1 R0 push R1 ret ;go to the cmd location. Cmd executes and jumps back to get_character !letterCmd add R0 -85 ;get the cmd location from !cmdTable (starts at mem loc 2) loadp R1 R0 push R1 ret ;go to the cmd location !get_character_end ret ;------------------------------------------------------------------------------------------------ ;-!print----------------------------------------------------------------------------------------- !print !while_PP loadp R1 R0 ;Load character at address R0 into R1. R0 is an array pointer. cmp R1 0x00 jeq !while_PP_end ;If the character is 0x00 stop printing. stor TERM R1 ;print character add R0 1 ;Increment array pointer jmp !while_PP ;keep printing !while_PP_end ret !print_end ;------------------------------------------------------------------------------------------------ ;-!print_line------------------------------------------------------------------------------------ !print_line mov R0 !crlf call !print ret !print_line_end ;------------------------------------------------------------------------------------------------ ;-Command Execution------------------------------------------------------------------------------ ;0-9 !incReg0 add R0 1 jmp !get_character !incReg1 add R1 1 jmp !get_character !incReg2 add R2 1 jmp !get_character !incReg3 add R3 1 jmp !get_character !incReg4 add R4 1 jmp !get_character !incReg5 add R5 1 jmp !get_character !incReg6 add R6 1 jmp !get_character !incReg7 add R7 1 jmp !get_character !awrdown ;8 awr -1 jmp !get_character !awrup ;9 awr 1 jmp !get_character ;a-z !savestate ;a aux 0 ;savestate jmp !get_character ;------------------------------------------------------------------------------------------------
23.971264
97
0.566771
50a0d516e3461dd2a87a6f23bf3b7227fefca951
3,719
asm
Assembly
simd/i386/jsimdcpu.asm
1camper/libjpeg-turbo
f2729c983afbc093a5afea7dde9b469cf08aaa61
[ "BSD-3-Clause" ]
310
2015-08-27T05:29:07.000Z
2022-03-29T05:09:11.000Z
simd/i386/jsimdcpu.asm
1camper/libjpeg-turbo
f2729c983afbc093a5afea7dde9b469cf08aaa61
[ "BSD-3-Clause" ]
91
2015-08-28T14:48:12.000Z
2021-09-14T09:02:51.000Z
simd/i386/jsimdcpu.asm
1camper/libjpeg-turbo
f2729c983afbc093a5afea7dde9b469cf08aaa61
[ "BSD-3-Clause" ]
36
2015-10-25T10:01:07.000Z
2022-01-30T10:16:42.000Z
; ; jsimdcpu.asm - SIMD instruction support check ; ; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB ; Copyright (C) 2016, D. R. Commander. ; ; Based on the x86 SIMD extension for IJG JPEG library ; Copyright (C) 1999-2006, MIYASAKA Masaru. ; For conditions of distribution and use, see copyright notice in jsimdext.inc ; ; This file should be assembled with NASM (Netwide Assembler), ; can *not* be assembled with Microsoft's MASM or any compatible ; assembler (including Borland's Turbo Assembler). ; NASM is available from http://nasm.sourceforge.net/ or ; http://sourceforge.net/project/showfiles.php?group_id=6208 ; ; [TAB8] %include "jsimdext.inc" ; -------------------------------------------------------------------------- SECTION SEG_TEXT BITS 32 ; ; Check if the CPU supports SIMD instructions ; ; GLOBAL(unsigned int) ; jpeg_simd_cpu_support(void) ; align 32 GLOBAL_FUNCTION(jpeg_simd_cpu_support) EXTN(jpeg_simd_cpu_support): push ebx ; push ecx ; need not be preserved ; push edx ; need not be preserved ; push esi ; unused push edi xor edi, edi ; simd support flag pushfd pop eax mov edx, eax xor eax, 1<<21 ; flip ID bit in EFLAGS push eax popfd pushfd pop eax xor eax, edx jz near .return ; CPUID is not supported ; Check for MMX instruction support xor eax, eax cpuid test eax, eax jz near .return xor eax, eax inc eax cpuid mov eax, edx ; eax = Standard feature flags test eax, 1<<23 ; bit23:MMX jz short .no_mmx or edi, byte JSIMD_MMX .no_mmx: test eax, 1<<25 ; bit25:SSE jz short .no_sse or edi, byte JSIMD_SSE .no_sse: test eax, 1<<26 ; bit26:SSE2 jz short .no_sse2 or edi, byte JSIMD_SSE2 .no_sse2: ; Check for AVX2 instruction support mov eax, 7 xor ecx, ecx cpuid mov eax, ebx test eax, 1<<5 ; bit5:AVX2 jz short .no_avx2 ; Check for AVX2 O/S support mov eax, 1 xor ecx, ecx cpuid test ecx, 1<<27 jz short .no_avx2 ; O/S does not support XSAVE test ecx, 1<<28 jz short .no_avx2 ; CPU does not support AVX2 xor ecx, ecx xgetbv test eax, 6 ; O/S does not manage XMM/YMM state ; using XSAVE jz short .no_avx2 or edi, JSIMD_AVX2 .no_avx2: ; Check for 3DNow! instruction support mov eax, 0x80000000 cpuid cmp eax, 0x80000000 jbe short .return mov eax, 0x80000001 cpuid mov eax, edx ; eax = Extended feature flags test eax, 1<<31 ; bit31:3DNow!(vendor independent) jz short .no_3dnow or edi, byte JSIMD_3DNOW .no_3dnow: .return: mov eax, edi pop edi ; pop esi ; unused ; pop edx ; need not be preserved ; pop ecx ; need not be preserved pop ebx ret ; For some reason, the OS X linker does not honor the request to align the ; segment unless we do this. align 32
28.174242
78
0.505243
009a6eea034e2f86a60d67e369f642a5276a8426
1,059
asm
Assembly
programs/oeis/140/A140462.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/140/A140462.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/140/A140462.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A140462: Turan's upper bound on the number of triangles of a simplicial complex of dimension two for which every minimal non-face has three vertices. ; 0,0,0,1,3,7,14,23,36,54,75,102,136,174,220,275,335,405,486,573,672,784,903,1036,1184,1340,1512,1701,1899,2115,2350,2595,2860,3146,3443,3762,4104,4458,4836,5239,5655,6097,6566,7049,7560,8100,8655,9240,9856,10488,11152,11849,12563,13311,14094,14895,15732,16606,17499,18430,19400,20390,21420,22491,23583,24717,25894,27093,28336,29624,30935,32292,33696,35124,36600,38125,39675,41275,42926,44603,46332,48114,49923,51786,53704,55650,57652,59711,61799,63945,66150,68385,70680,73036,75423,77872,80384,82928,85536,88209 mov $6,$0 mov $8,$0 lpb $8 mov $0,$6 mov $4,0 sub $8,1 sub $0,$8 mov $3,$0 mov $5,$0 lpb $5 mov $0,$3 sub $5,1 sub $0,$5 mul $0,2 mov $2,$0 sub $2,2 mul $2,2 add $2,1 mov $7,$0 sub $7,2 div $7,3 lpb $0 mul $7,2 add $0,$7 div $2,3 sub $0,$2 lpe div $7,2 add $4,$7 lpe add $1,$4 lpe mov $0,$1
28.621622
512
0.650614
f22c57b8a2d6694a2734369251ecd7dba0f6616c
584
asm
Assembly
programs/oeis/040/A040003.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/040/A040003.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/040/A040003.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A040003: Continued fraction for sqrt(6). ; 2,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2,4,2 pow $1,$0 sub $1,2 gcd $1,$0 mul $1,2
73
501
0.517123
ce42740e44c6cc92e0444518ef8023bf550b1c12
112
asm
Assembly
guia15/q6.asm
RafaelAmauri/Arquitetura-de-Computadores-1
56b9b0b62ef3b2db558eee73da02177fc8442e85
[ "MIT" ]
null
null
null
guia15/q6.asm
RafaelAmauri/Arquitetura-de-Computadores-1
56b9b0b62ef3b2db558eee73da02177fc8442e85
[ "MIT" ]
null
null
null
guia15/q6.asm
RafaelAmauri/Arquitetura-de-Computadores-1
56b9b0b62ef3b2db558eee73da02177fc8442e85
[ "MIT" ]
null
null
null
# ORG 2000H # BEGIN 2000H LHLD 2501 MOV A, H SUB L ADD A SUB L STA 2503 HLT # ORG 2501H # DB 0AH, 05H
7.466667
13
0.616071
b5dda83bcd7277f06f145737beb6545aea64f982
120
asm
Assembly
Source Codes Testing/add2.asm
aravindvnair99/emu8086
1713febd30618f0d03f09c6a7f8eb6c4a68888b8
[ "MIT" ]
11
2018-12-31T08:56:38.000Z
2022-02-28T15:49:14.000Z
Source Codes Testing/add2.asm
aravindvnair99/emu8086
1713febd30618f0d03f09c6a7f8eb6c4a68888b8
[ "MIT" ]
null
null
null
Source Codes Testing/add2.asm
aravindvnair99/emu8086
1713febd30618f0d03f09c6a7f8eb6c4a68888b8
[ "MIT" ]
4
2020-11-10T01:29:54.000Z
2022-01-20T04:50:08.000Z
.MODEL small .STACK .DATA .CODE .STARTUP MOV ah, 04h MOV al, 05h MOV bh, 02h MOV bl, 03h add ah,al add ah,bh .EXIT end
9.230769
12
0.691667
7a552d4a1c53fd226a2607f7f781db82bed90d68
37,168
asm
Assembly
game/data/menu_online_mode/bg_tiles.asm
sgadrat/super-tilt-bro
f918731c63a32dc3d0c80f10e7b053d6fa218c50
[ "WTFPL" ]
91
2017-08-06T18:30:13.000Z
2022-02-17T00:26:45.000Z
game/data/menu_online_mode/bg_tiles.asm
sgadrat/super-tilt-bro
f918731c63a32dc3d0c80f10e7b053d6fa218c50
[ "WTFPL" ]
2
2018-10-12T04:34:13.000Z
2021-12-25T17:01:18.000Z
game/data/menu_online_mode/bg_tiles.asm
sgadrat/super-tilt-bro
f918731c63a32dc3d0c80f10e7b053d6fa218c50
[ "WTFPL" ]
9
2016-10-08T21:24:37.000Z
2022-02-05T00:13:31.000Z
.byt %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111 .byt %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111 .byt %11100000, %11111000, %11110111, %11101111, %11111111, %01011111, %10111111, %00011111 .byt %11111111, %10000000, %00000111, %00001111, %00011111, %10111111, %01011111, %11111111 .byt %00001111, %00111111, %11011111, %11101111, %11111111, %11110101, %11111011, %11110001 .byt %11111111, %00000011, %11000001, %11100001, %11110001, %11111011, %11110101, %11111111 .byt %00000111, %01111111, %11110111, %11111011, %11111101, %11011110, %10101111, %10001111 .byt %11111111, %00000011, %10000001, %10001000, %10001100, %10101110, %11011111, %11111111 .byt %11100000, %11101110, %11111111, %11111111, %11111111, %01110101, %00101011, %10000001 .byt %11111111, %11100000, %11110001, %11110001, %01110001, %10111011, %01010101, %10111111 .byt %00000111, %01110111, %11111111, %11111111, %11111111, %11011111, %10101111, %10001111 .byt %11111111, %00000111, %10001111, %10001111, %10001111, %10101111, %11011111, %11111111 .byt %11000001, %11011101, %11111111, %11111111, %11111111, %11110111, %11101011, %11100011 .byt %11111111, %11000001, %11100011, %11100011, %11100011, %11101011, %11110111, %11111111 .byt %00000000, %01110000, %11111111, %11111111, %11111111, %11011111, %10101111, %10000000 .byt %11111111, %00000000, %10001111, %10001111, %10001111, %10101111, %11011111, %11111111 .byt %00000001, %00000111, %11111011, %11111101, %11111111, %11011111, %10111111, %00011111 .byt %11111111, %00000001, %11111001, %11111101, %11111111, %11111111, %11011111, %11111111 .byt %00011111, %01011111, %11111111, %10111111, %11111111, %01111111, %10111111, %11000000 .byt %11111111, %10111111, %00011111, %01011111, %00001111, %00000111, %10000000, %11000000 .byt %11110001, %11110101, %11111111, %11111011, %11111111, %11111101, %11111011, %00000111 .byt %11111111, %11111011, %11110001, %11110101, %11100001, %11000001, %00000011, %00000111 .byt %10001111, %11011111, %11111111, %10101111, %11111111, %11111111, %11111111, %00000111 .byt %11111111, %10101111, %10001111, %11011111, %10001111, %10001111, %00000111, %00000111 .byt %11000001, %11100101, %11111111, %11111011, %11111111, %11111111, %11111111, %11100000 .byt %11011111, %11101011, %11110001, %11110101, %11110001, %11110001, %11100000, %11100000 .byt %10001111, %11011111, %11111111, %10101111, %11111111, %11111111, %11111111, %00000000 .byt %11111111, %10101111, %10001111, %11011111, %10001111, %10001111, %00000000, %00000000 .byt %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %00000001 .byt %11111111, %11111111, %11111111, %11111111, %11111101, %11111001, %00000001, %00000001 .byt %11100011, %11110111, %11111111, %11101011, %11111111, %11111111, %11111111, %11000001 .byt %11111111, %11101011, %11100011, %11110111, %11100011, %11100011, %11000001, %11000001 .byt %10000000, %11011111, %11111111, %10101111, %11111111, %11111111, %11111111, %00000000 .byt %11110000, %10101111, %10001111, %11011111, %10001111, %10001111, %00000000, %00000000 .byt %00011111, %10011111, %11011111, %11111111, %11111111, %11111111, %11111111, %00000001 .byt %01111111, %10111111, %11011111, %11111111, %11111101, %11111001, %00000001, %00000001 .byt %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111100, %11100000 .byt %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111100, %11100000 .byt %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %00001011, %00000001 .byt %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %00001011, %00000001 .byt %11111111, %11111111, %11111111, %11111111, %11111100, %11111000, %11110000, %10000000 .byt %11111111, %11111111, %11111111, %11111111, %11111100, %11111000, %11110000, %10000000 .byt %11111111, %11111111, %11111111, %11111111, %00000111, %00000010, %00000001, %00000000 .byt %11111111, %11111111, %11111111, %11111111, %00000111, %00000010, %00000001, %00000000 .byt %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11101101 .byt %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11101101 .byt %11111111, %11111111, %11111111, %11111111, %11111000, %11110000, %11100000, %00000000 .byt %11111111, %11111111, %11111111, %11111111, %11111000, %11110000, %11100000, %00000000 .byt %11101101, %01010111, %10101011, %11010101, %10000011, %10000100, %01001000, %00110000 .byt %11101101, %01000111, %10000011, %11000001, %10000011, %10000000, %00000000, %00000000 .byt %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11101101, %01010111 .byt %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11101101, %01000111 .byt %11110011, %10100000, %01000100, %10100000, %01000000, %00000000, %10000000, %00000000 .byt %11110011, %10100000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %11111111, %10000000, %10000000, %10000000, %10000000, %10000000, %10000000, %10000000 .byt %00000000, %01111111, %01111111, %01111111, %01111111, %01111111, %01111111, %01111111 .byt %11111111, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %00000000, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111 .byt %00000011, %11111100, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %00000000, %00000011, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111 .byt %11111110, %00000001, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %00000000, %11111110, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111 .byt %01111111, %10000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %00000000, %01111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111 .byt %11110000, %00001111, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %00000000, %11110000, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111 .byt %00011111, %11100000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %00000000, %00011111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111 .byt %11101111, %00010000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %00000000, %11101111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111 .byt %11000000, %00111111, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %00000000, %11000000, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111 .byt %00011111, %11100000, %00000000, %00000000, %00000000, %00000000, %00000011, %00010101 .byt %00000000, %00011111, %11111111, %11111111, %11111111, %11111111, %11111100, %11101000 .byt %11111111, %00000001, %00000001, %00000001, %00000001, %00000001, %00000001, %00000001 .byt %00000000, %11111110, %11111110, %11111110, %11111110, %11111110, %00111110, %00111110 .byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %11111111, %10111111, %01010011, %00100000, %00001000, %00000000, %00000000, %00000000 .byt %11111111, %10111111, %00010011, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %00000000, %00001000, %01110010, %10001000, %10010100, %10101000, %00010100, %01000000 .byt %00000000, %00000000, %00000000, %01100000, %01100000, %00000000, %00000000, %00000000 .byt %10000000, %10000001, %10000001, %10000001, %10000001, %10000001, %10000001, %10000001 .byt %01111110, %01111100, %01111100, %01111100, %01111100, %01111100, %01111100, %01111100 .byt %10101000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %00000111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111 .byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111 .byt %10000001, %10000001, %10000001, %10000001, %00000010, %00000010, %00000010, %00000010 .byt %00111110, %00111110, %00111110, %00111110, %01111100, %01111100, %01111100, %01111100 .byt %10000001, %10000000, %10011001, %10100000, %10000000, %01000000, %01000000, %01000000 .byt %01111100, %01111101, %01100100, %00011001, %01111100, %00111110, %00111110, %00111110 .byt %00000000, %00001000, %00011000, %01010000, %00100000, %00000000, %00000000, %00000000 .byt %11111111, %11110111, %11100111, %10001111, %00011111, %11111111, %11111111, %11111111 .byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000011, %00000111 .byt %11111111, %11111111, %11111111, %11111111, %11111111, %11111100, %11111000, %11111000 .byt %00000000, %00000000, %00000000, %01100000, %00011000, %00001000, %00000110, %00000011 .byt %11111111, %11111111, %11111111, %10011111, %11100111, %11110111, %11111001, %11111100 .byt %10000011, %10000001, %00000001, %10000001, %01000001, %01000001, %00000001, %01000001 .byt %01111100, %01111110, %11111110, %01111110, %10111110, %10111110, %11111110, %10111110 .byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000011, %00000011 .byt %11111111, %11111111, %11111111, %11111111, %11111111, %11111100, %11111100, %11111100 .byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %11111111, %11111111, %11111111, %11111111, %11111111, %00000000, %11111111, %01100000 .byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000101, %00000101 .byt %11111111, %11111111, %11111111, %11111111, %11111111, %00000000, %11111010, %00000000 .byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %10000000, %10000000 .byt %11111111, %11111111, %11111111, %11111111, %11111111, %01111111, %01111111, %01111111 .byt %01000000, %01000000, %01000000, %01000000, %01000000, %10000000, %10000000, %10000000 .byt %00111110, %00111110, %00111111, %00111111, %00111111, %01111111, %01111111, %01111111 .byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000001 .byt %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111110, %11111110 .byt %00000111, %00000111, %00000111, %00000011, %00000011, %00000011, %10111111, %10111111 .byt %11111000, %11111000, %11111000, %11111100, %11111100, %00000000, %01000000, %01000000 .byt %00000000, %00000000, %10000000, %10000000, %11000000, %11111000, %11111100, %11111100 .byt %11111111, %01111111, %01111111, %00111111, %00000111, %00000011, %00000000, %00000011 .byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %01111111, %10111111 .byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %11111110, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111 .byt %10000000, %01000000, %01000000, %10000000, %00111000, %01001110, %01000010, %01000001 .byt %01111111, %00111111, %00111111, %00111111, %10000111, %10110001, %10111100, %10111110 .byt %00000001, %00000001, %00000001, %00000001, %00000001, %00011101, %00010010, %00000010 .byt %11111110, %11111110, %11111110, %11111110, %11111110, %11100000, %00001100, %01111100 .byt %00000001, %00000000, %00000000, %00000101, %00001000, %00011000, %00011000, %00011000 .byt %11111110, %11111111, %11111000, %11110010, %11100111, %11100111, %11100111, %11100111 .byt %10001111, %11000111, %11000111, %11000111, %11000111, %01000111, %01000111, %01000111 .byt %00110000, %00101000, %00110000, %00101000, %00110000, %10101000, %10110000, %10101000 .byt %11111111, %11111010, %11111010, %11111011, %11110010, %11110100, %11110100, %11110100 .byt %00000000, %00000101, %00000100, %00000100, %00001001, %00001011, %00001011, %00001011 .byt %00000000, %00000000, %00000000, %01000000, %00100000, %00110000, %00110000, %00110000 .byt %11111111, %11111111, %00111111, %10011111, %11001111, %11001111, %11001111, %11001111 .byt %10000000, %10000000, %10000000, %10000000, %10000000, %01000000, %01000000, %01000000 .byt %01111111, %01111111, %01111111, %01111111, %01111111, %00111111, %00111111, %00111111 .byt %00001100, %00001000, %00010000, %00010000, %00010000, %00100000, %00100000, %01000000 .byt %11110011, %11100111, %11101111, %11101111, %11101111, %11011111, %11011111, %10011111 .byt %00000001, %00000000, %00000000, %00000001, %00000001, %00000000, %00000000, %00000001 .byt %11111110, %11111111, %11111110, %11111110, %11111110, %11111111, %11111110, %11111110 .byt %10111111, %10111111, %10111111, %10111111, %10111111, %10111111, %10111111, %10111111 .byt %01000000, %00000000, %01000000, %01000000, %01000000, %00000000, %01000000, %01000000 .byt %11111100, %11111100, %11111100, %11111100, %11111100, %11111100, %11111100, %11111100 .byt %00000011, %00000011, %00000011, %00000011, %00000011, %00000011, %00000011, %00000011 .byt %01000000, %01000000, %01000000, %01000000, %01000000, %01000000, %01000000, %01000000 .byt %10111111, %10111111, %10111111, %10111111, %10111111, %10111111, %10111111, %10111111 .byt %01000000, %01100000, %00100000, %00011000, %00000100, %00000010, %00000001, %00000000 .byt %10111111, %10011111, %11011111, %11100111, %11110011, %11111001, %11111100, %11111110 .byt %00000010, %00000010, %00000010, %00000010, %00000010, %00000010, %00000010, %01001010 .byt %11111100, %11111100, %11111100, %11111100, %11111100, %11111100, %11111100, %00110100 .byt %00000000, %00000000, %00000101, %00101010, %01010101, %10101111, %01111111, %11111111 .byt %00000000, %00000111, %00000111, %00111111, %11111111, %11111111, %11111010, %11000101 .byt %00000000, %00111111, %11111111, %10101111, %01010101, %10101010, %11010101, %10101010 .byt %01111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %01111111 .byt %00000000, %11111100, %11111111, %11111010, %01010101, %10101010, %01010101, %10101010 .byt %11111110, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111 .byt %00000000, %00000000, %11000000, %10101000, %01010101, %10101010, %01010101, %10101110 .byt %00000000, %11110000, %11111100, %11111100, %11111111, %11111111, %11111111, %11111101 .byt %00001000, %00001100, %00000100, %00000010, %00000000, %00000000, %00000000, %00000000 .byt %11110011, %11110011, %11111001, %11111100, %11111111, %11111111, %11111111, %11111111 .byt %01000111, %01001111, %01100111, %10100111, %00010111, %00011111, %00000111, %00000011 .byt %10110000, %10010000, %00011000, %01001000, %11100000, %11100000, %11111000, %11111100 .byt %11110100, %11110100, %11100100, %11001010, %11010000, %11010000, %11000000, %10000000 .byt %00001011, %00001011, %00010001, %00100100, %00101111, %00001111, %00111111, %01111111 .byt %00100000, %01100000, %01000000, %10000000, %00000000, %00000000, %00000000, %00000000 .byt %10011111, %10011111, %00111111, %01111111, %11111111, %11111111, %11111111, %11111111 .byt %01000000, %00000000, %10010000, %10011100, %10001001, %10000100, %10000001, %10000000 .byt %00111111, %00011111, %01001111, %01100001, %01110000, %01111000, %01111100, %01111101 .byt %00000000, %00000001, %00000010, %00000101, %10011100, %00100000, %10000000, %00000000 .byt %11111111, %11111110, %11111100, %11111000, %01100011, %00011111, %01111111, %11111111 .byt %10100000, %01000000, %01000000, %10000000, %01100000, %00010000, %00001110, %00000000 .byt %00011111, %00111111, %00111111, %00111111, %10011111, %11101111, %11110000, %11111111 .byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %01000000 .byt %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %00111111 .byt %00000001, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %11111110, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111 .byt %10111111, %10111111, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %01000000, %00000000, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111 .byt %11111100, %11111000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %00000000, %00000111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111 .byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %01111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111 .byt %00111111, %00000001, %00000001, %10000001, %01000001, %01000001, %01000001, %00000001 .byt %10000000, %11111110, %11111110, %01111110, %10111110, %10111110, %10111110, %10111110 .byt %11110000, %11000010, %10000000, %00000111, %01111111, %11111111, %11111111, %11111111 .byt %10010000, %00001111, %00111111, %01111111, %11111110, %11010101, %10101010, %00000000 .byt %01010100, %10100000, %00000000, %11100000, %11100000, %11111000, %11110000, %10010000 .byt %01111111, %11111111, %11111111, %11111111, %11111111, %01011111, %10011111, %00001111 .byt %00010101, %00000110, %00000001, %10000000, %00000000, %00000000, %00000000, %10000010 .byt %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111 .byt %01011111, %10101111, %01011111, %00101111, %00010000, %00000000, %00000000, %00001111 .byt %11111010, %11111001, %11110000, %11110000, %11111100, %11111111, %11111110, %11111100 .byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111110, %11111111 .byt %00000011, %00000011, %00000011, %00000011, %00000010, %00000000, %11110101, %00000000 .byt %11111100, %11111100, %11111100, %11111000, %11110101, %00001010, %00000000, %11111111 .byt %10000000, %10000000, %10000000, %10000000, %01000000, %00100000, %10111110, %00000000 .byt %01111111, %01111111, %01111111, %00111111, %10011111, %01000001, %00000000, %11111111 .byt %10000000, %10000000, %00000000, %01000000, %10000001, %10000001, %10000001, %10000001 .byt %01111101, %01111101, %01111101, %00111110, %01111100, %01111100, %01111100, %01111100 .byt %00100000, %00010000, %00000100, %00001000, %00000100, %00001000, %00011000, %00100000 .byt %11011111, %11101111, %11110011, %11110000, %11111001, %11110011, %11100111, %11001111 .byt %00000000, %00000010, %00011100, %11100000, %00000000, %00000000, %00000000, %00000000 .byt %11111111, %11111101, %11100011, %00011111, %11111111, %11111111, %11111111, %11111111 .byt %00000000, %00000000, %00000000, %00000000, %01000001, %00001110, %00000000, %00110000 .byt %11111111, %11111111, %11111111, %11111111, %10111110, %11000001, %11101111, %11001111 .byt %00000000, %00000000, %00000000, %11000000, %00000000, %00000000, %00000000, %00000000 .byt %11111111, %11111111, %11111111, %00111111, %11111111, %11111111, %11111111, %11111111 .byt %00000001, %00000001, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %10111110, %10111110, %01111100, %01111100, %01111100, %01111100, %01111100, %01111100 .byt %11111000, %11100000, %11000000, %10000000, %00000000, %00000000, %00000000, %00000000 .byt %00000000, %00000011, %01001111, %10011111, %00111111, %01111111, %01111111, %11111111 .byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000010, %00000000 .byt %00111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111 .byt %00001000, %00000000, %00000000, %00001000, %00000011, %10000111, %00000111, %00000011 .byt %11111111, %11111111, %11111111, %11111111, %11111111, %11111100, %11111000, %11111011 .byt %01111111, %11111111, %11111111, %11111111, %11111100, %11110000, %11000000, %00000000 .byt %11111000, %11010000, %10101000, %11010001, %10000000, %00110001, %11000111, %00111111 .byt %10000001, %10000001, %00000000, %10000000, %00000000, %10000000, %00000000, %00000000 .byt %01111100, %01111100, %01111111, %01111111, %01111111, %01111111, %01111111, %00000000 .byt %00000000, %11110000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %11111111, %00001111, %11111111, %11111111, %11111111, %11111111, %11110000, %00000000 .byt %00000000, %01100000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %11111111, %10011111, %11111111, %11111111, %11111111, %11111111, %11111111, %00000000 .byt %00000000, %00001010, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %11111111, %11110101, %11111111, %11111111, %11111111, %11111111, %11111111, %00000000 .byt %00000000, %10000000, %00000000, %00000000, %00000000, %00000000, %00000010, %00000000 .byt %11111111, %01111111, %11111111, %11111111, %11111111, %11111111, %11111100, %00000000 .byt %00000000, %00000000, %10000000, %11000000, %01100000, %00000000, %00001000, %00000000 .byt %00111111, %01111111, %01111111, %00111111, %10011111, %11011111, %00000111, %00000000 .byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000100, %00000000 .byt %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111000, %00000000 .byt %00000000, %00000001, %00000000, %00000000, %00000000, %00000000, %00000100, %00000000 .byt %11111111, %11111110, %11111111, %11111111, %11111111, %11111111, %00000011, %00000000 .byt %00000000, %00010101, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %11111111, %11101010, %11111111, %11111111, %11111111, %11111111, %11111111, %00000000 .byt %01000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %10111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %00000000 .byt %00000000, %11000111, %00000000, %00000000, %00000000, %00000000, %01000100, %00000000 .byt %11111111, %00111000, %11111111, %11111111, %11111111, %11111111, %10000011, %00000000 .byt %00000011, %10000001, %00000001, %00000001, %00000001, %00000001, %00000001, %00010100 .byt %01111100, %01111110, %11111110, %11111110, %11111110, %11111110, %11111110, %00000000 .byt %00000000, %00000000, %00000011, %00001111, %10111111, %00111111, %11111111, %11111111 .byt %11111100, %11111111, %11111111, %11111111, %11111010, %11100101, %11100000, %10000000 .byt %00000000, %00000000, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111 .byt %11111111, %11111111, %11111111, %01111101, %10101010, %01010101, %00000000, %00000000 .byt %00000000, %10000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %00000000, %10000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %00000101, %00001011, %00000101, %00001011, %00010111, %00001011, %00010111, %00001011 .byt %00001010, %00010100, %00011010, %00010100, %00101000, %00110100, %00101000, %00110100 .byt %11110000, %11100000, %11000000, %11000000, %10000000, %10000000, %10000000, %10000000 .byt %00000000, %00000000, %00000111, %00011111, %00011111, %00111111, %00111111, %00111111 .byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %00011111, %01111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111 .byt %00000001, %00000011, %00000011, %00000011, %00000111, %00000111, %00001111, %00001111 .byt %11111111, %11111111, %11111110, %11111110, %11111100, %11111000, %11111000, %11110000 .byt %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111 .byt %10000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111 .byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %11011111, %10101110, %11010001, %11101000, %11010000, %11111100, %11110100, %11111000 .byt %00100000, %01010001, %00101000, %00010001, %00101000, %00000000, %00001001, %00000101 .byt %01000000, %10100000, %01010000, %10100000, %01010000, %00101000, %01010000, %00101000 .byt %10110000, %01011000, %10101000, %01011000, %10101000, %01010100, %00101100, %10010000 .byt %00000101, %00001010, %00000101, %00000011, %00000001, %00000000, %00000000, %00000000 .byt %00111010, %01110101, %01111010, %01111100, %00111100, %01111101, %00111110, %01111111 .byt %11110000, %11111000, %11111000, %11111000, %11111000, %11111000, %11111100, %00111100 .byt %00111111, %01011111, %00101111, %00011111, %00000111, %00000111, %00000011, %01000011 .byt %00001111, %00001111, %00001111, %00000111, %00000111, %00000011, %00000001, %00000001 .byt %11110000, %11110000, %11110000, %11111000, %11111000, %11111010, %11111100, %11111101 .byt %11110110, %11111010, %11111101, %11111010, %11110111, %11111010, %11111111, %11111110 .byt %00001000, %00000101, %00000010, %00000101, %00001000, %00000101, %00000000, %00000001 .byt %00010000, %00000000, %00000000, %10000000, %01000000, %10000000, %01000000, %10100000 .byt %10101000, %01010000, %10100100, %00111010, %10011100, %01001110, %10100100, %01010110 .byt %00010000, %00000000, %00000000, %10010010, %00000000, %00000000, %00010000, %00000000 .byt %00000000, %00010000, %00010000, %01111100, %00010000, %00010000, %00000000, %00000000 .byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %01111111, %00111111, %00111111, %00111111, %00111111, %00111111, %00111111, %00011111 .byt %01010100, %00101111, %00010111, %00001111, %00010111, %00101111, %01011111, %10101111 .byt %00101001, %10010001, %11001000, %11010000, %11001000, %11110000, %11100000, %01010000 .byt %00111100, %11111110, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111 .byt %11111111, %11010111, %00101011, %00010101, %00001010, %00000001, %00000000, %00000000 .byt %00000000, %00000000, %10000000, %11000000, %11100000, %11110000, %11111000, %11111100 .byt %11111111, %11111111, %11111111, %11111111, %11111111, %01111111, %10011111, %00001111 .byt %11111111, %00011111, %00000111, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %11000000, %00010000, %11000111, %11110000, %11111111, %11111111, %11111111, %11111111 .byt %11111111, %11111111, %11110000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %00000000, %00001111, %11110000, %00000000, %11111111, %11111111, %11111111, %11111111 .byt %11111111, %11111111, %00001111, %00001111, %00000111, %00000111, %00000111, %00001111 .byt %00000000, %11110000, %00001000, %00001000, %11000100, %11000100, %11100100, %11101000 .byt %11111111, %11111111, %11111111, %11111111, %11111101, %11111110, %11110101, %11111010 .byt %00000000, %00000000, %00000000, %00000000, %00000010, %00000001, %00001010, %00000101 .byt %01010000, %10100000, %01000000, %10100000, %01000000, %10000000, %01000000, %10000000 .byt %10100110, %01010110, %10100110, %01001100, %10101100, %01001100, %10011100, %01011000 .byt %00000000, %00000000, %00100000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %00000000, %00100000, %01110000, %00100000, %00000000, %00000000, %00000000, %00000000 .byt %00000001, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %00011111, %00011111, %00011111, %00011111, %00001111, %00001111, %00001111, %00000111 .byt %01011111, %10101111, %01010111, %00101111, %00010101, %00001011, %00000101, %00000010 .byt %10100000, %01010000, %11101000, %00110000, %10101010, %10010100, %11001010, %11100101 .byt %11111110, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111 .byt %00000111, %00000011, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %00000000, %10000000, %11111100, %11111111, %11111111, %11111111, %11111111, %11111111 .byt %11111111, %11111111, %11111111, %00000111, %00000000, %00000000, %00000000, %00000000 .byt %00000000, %00000000, %00000000, %10000000, %11000000, %11000000, %10000000, %10000000 .byt %11111111, %11111111, %11111111, %11111111, %11111111, %01111111, %10111111, %11111111 .byt %00000111, %00000111, %00000011, %00000011, %00000001, %00000001, %00000001, %00000001 .byt %11100100, %11110100, %11110010, %11111010, %11111000, %11111100, %11111100, %11111100 .byt %11110101, %11101110, %11110111, %11101110, %11010101, %11101010, %11011100, %11111010 .byt %00001010, %00010001, %00001000, %00010001, %00101010, %00010101, %00100010, %00000100 .byt %00000000, %10000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %10011000, %00111000, %10111000, %00111000, %01110000, %01110000, %01010000, %10100000 .byt %11110011, %00111111, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %00000000, %11000000, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111 .byt %11111111, %00000000, %00000000, %00000000, %00000000, %00000000, %00000011, %00010101 .byt %00000000, %11111111, %11111111, %11111111, %11111111, %11111111, %11111100, %11101000 .byt %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111110 .byt %00000000, %00000000, %00000001, %00000001, %00000001, %00000001, %00000001, %00000010 .byt %10000000, %10000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %11111111, %11111111, %01111111, %01111111, %01111111, %01111111, %01111111, %11111111 .byt %10000001, %10000001, %10000001, %10000001, %00000011, %00000010, %00000010, %00000010 .byt %00111110, %00111110, %00111110, %00111110, %01111100, %01111100, %01111100, %01111100 .byt %11111110, %11111000, %11110000, %11100000, %11000000, %11000000, %10000000, %10000000 .byt %00000110, %00001001, %00010111, %00101111, %01011111, %01011111, %10111111, %10111111 .byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111000 .byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %00011111 .byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %01111111, %01111111, %11111111, %11111111, %11111111, %11111111, %01011111, %00101111 .byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111110 .byt %10000001, %10000000, %10011001, %10100000, %10000000, %11000000, %01000000, %11000000 .byt %01111100, %01111101, %01100100, %00011001, %01111100, %00111110, %00111110, %00111110 .byt %00000000, %00000000, %00000000, %00000000, %00000001, %00000001, %00100001, %01110011 .byt %11111111, %11111111, %11111111, %11111110, %11111110, %11011110, %10001100, %00000000 .byt %00000000, %00000000, %00000000, %00000000, %11100000, %11100000, %11100001, %11110011 .byt %11111111, %11111111, %11111111, %00011111, %00011111, %00011110, %00001100, %00000000 .byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %10000000 .byt %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %01111111, %00111111 .byt %00000111, %00001100, %00011000, %00010011, %00110111, %00110111, %00110111, %00110111 .byt %11110000, %11100011, %11100100, %11001000, %11001000, %11001000, %11001000, %11000000 .byt %11100000, %01110000, %01111000, %11111000, %11111100, %11111100, %11111100, %11111100 .byt %00001111, %10000111, %00000111, %00000011, %00000011, %00000011, %00000011, %00000011 .byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %00010101, %00001010, %00000101, %10100010, %00010101, %00000010, %00000000, %00000000 .byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %01111111, %10111110, %01010101, %10101010, %01010101, %10101010, %00010101, %00000000 .byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %11111101, %10101010, %01010101, %10101010, %01010101, %10101010, %01010100, %00000000 .byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %01110101, %10101010, %01010101, %10101010, %01010100, %10100000, %00000000, %00000000 .byt %01000000, %11000000, %01000000, %11000000, %01000000, %10000000, %10000000, %10000000 .byt %00111110, %00111110, %00111111, %00111111, %00111111, %01111111, %01111111, %01111111 .byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000011, %00000011, %00000011 .byt %11111111, %11111111, %11111111, %11111111, %11111100, %11111100, %11111100, %11111100 .byt %01111111, %00111110, %00111100, %00111001, %01110010, %11110100, %11110100, %11110100 .byt %10000000, %11000001, %11000010, %10000100, %00001001, %00001011, %00001011, %00000001 .byt %11111111, %00111111, %00111111, %00111111, %00011111, %00001111, %00001111, %00001111 .byt %00000000, %11000000, %00000000, %11000000, %11100000, %11110000, %11110000, %11100000 .byt %10000000, %00000000, %00000000, %00000000, %10000000, %11110000, %11110000, %10000000 .byt %01111111, %11111111, %11111111, %01111111, %00001111, %00001111, %00001111, %01111111 .byt %00011111, %00011111, %00001111, %00001111, %00000111, %00000111, %00000111, %00001111 .byt %11100000, %11100000, %11110000, %11110000, %11111000, %11111000, %11110000, %00000000 .byt %11111000, %11111000, %11110000, %11110000, %11100000, %11100000, %11100000, %11110000 .byt %00000111, %00000111, %00001111, %00001111, %00011111, %00011111, %00001111, %00000000 .byt %01111110, %00111111, %00111111, %00111111, %01111111, %01110011, %00100001, %00000001 .byt %10000000, %11000000, %11000000, %10000000, %00000000, %10001100, %11011110, %11111110 .byt %00010111, %00100111, %11101111, %11111111, %11111111, %11110011, %11100001, %11100000 .byt %11001000, %00010000, %00000000, %00000000, %00000000, %00001100, %00011110, %00011111 .byt %00000000, %00011000, %00111100, %00011111, %10001110, %10001100, %00001101, %01111110 .byt %11100111, %11000011, %11000000, %01100000, %00110001, %01110010, %10000000, %10000001 .byt %11100000, %11100011, %11100111, %11111111, %11111110, %10111110, %00011110, %00001011 .byt %00011100, %00011000, %00000000, %00000000, %00000001, %01000001, %11100000, %11110100 .byt %00000000, %00000000, %10000000, %00000000, %00000000, %00000000, %00000000, %11000000 .byt %11111111, %01111111, %01111111, %11111111, %11111111, %11111111, %00111111, %00111111 .byt %00000000, %00000111, %00001100, %00011000, %00011011, %00011011, %00111111, %00000000 .byt %11111000, %11110000, %11100011, %11100100, %11100100, %11000000, %11000000, %11111111 .byt %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %00000000 .byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %11111111 .byt %00000000, %11100000, %11110000, %11111000, %11111000, %11111000, %11111100, %00000000 .byt %00011111, %00001111, %00000111, %00000111, %00000111, %00000011, %00000011, %11111111 .byt %11100000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000 .byt %00011111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111 .byt %01111110, %00001111, %00001111, %00001111, %00011111, %00111100, %00011000, %00000000 .byt %10000000, %11110000, %11110000, %11100000, %11000000, %11000011, %11100111, %11111111 .byt %00001011, %00010010, %10100110, %10001110, %10011111, %11100111, %11100011, %11100000 .byt %11100100, %01001001, %00010001, %01100000, %00000000, %00011000, %00011100, %00011111 .byt %11000000, %00000000, %00000000, %00000000, %00000000, %10000000, %00000000, %00000000 .byt %00111111, %11111111, %11111111, %11111111, %01111111, %01111111, %11111111, %11111111 .byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000111, %00111111 .byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000111, %00111111 .byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %11110100, %11111010 .byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %11110000, %11111010 .byt %00000000, %00000000, %00000000, %00000000, %00000011, %00000101, %00001011, %01111111 .byt %00000000, %00000000, %00000000, %00000000, %00000011, %00000001, %00001011, %01111111 .byt %00000000, %00000000, %00000000, %00000000, %11111000, %11110101, %11111010, %11111111 .byt %00000000, %00000000, %00000000, %00000000, %11111000, %11110000, %11111010, %11111111 .byt %00010010, %10101000, %01010100, %00101010, %01110100, %01111011, %10110111, %11001111 .byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000011, %10000111, %11001111 .byt %00010010, %10101000, %01010100, %00101010, %01111100, %01111011, %10110111, %11001111 .byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000011, %10000111, %11001111 .byt %00001100, %01011111, %10111011, %01011111, %10111111, %11111111, %01111111, %11111111 .byt %00001100, %00011111, %00111011, %00011111, %10111111, %11111111, %01111111, %11111111 .byt %00000000, %01000000, %10101100, %11011111, %11110111, %11111111, %11111111, %11111111 .byt %00000000, %00000000, %10001100, %11011111, %11110111, %11111111, %11111111, %11111111
91.77284
91
0.728261
d785ccd2b46b9357d93a6131447c66bb95a4495f
263
asm
Assembly
programs/oeis/145/A145594.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/145/A145594.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/145/A145594.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A145594: A145593(n) mod 9. ; 8,3,4,2,6,7,5,0,1,8,3,4,2,6,7,5,0,1,8,3,4,2,6,7,5,0,1,8,3,4,2,6,7,5,0,1,8,3,4,2,6,7,5,0,1 mov $2,$0 mov $0,3 mov $1,15 mul $2,3 add $2,8 mov $3,$2 sub $3,3 pow $3,2 mod $3,27 lpb $0,1 sub $0,$0 add $1,$3 lpe sub $1,16 div $1,3
13.842105
91
0.532319
084c5e679ce020bad40f8271a6ae33d66baaf610
3,952
asm
Assembly
2_game_init.asm
chriswyatt/znake
4a5a95107b4658b5eb77fa207758bee0bc6ea9e7
[ "Apache-2.0" ]
8
2016-11-11T22:01:17.000Z
2021-05-03T02:23:21.000Z
2_game_init.asm
chriswyatt/znake
4a5a95107b4658b5eb77fa207758bee0bc6ea9e7
[ "Apache-2.0" ]
null
null
null
2_game_init.asm
chriswyatt/znake
4a5a95107b4658b5eb77fa207758bee0bc6ea9e7
[ "Apache-2.0" ]
1
2020-11-28T10:47:33.000Z
2020-11-28T10:47:33.000Z
; ///////////////////////////////////////////////////////////////////////////// ; Znake (ZX Spectrum 48K) ; ----------------------------------------------------------------------------- ; 2_game_init.asm ; ----------------------------------------------------------------------------- ; Copyright (C) 2016, Chris Wyatt ; All rights reserved ; Distributed under the Apache 2 license (see LICENSE) ; ///////////////////////////////////////////////////////////////////////////// init: ; Clear screen ld hl,0x4000 ld de,0x4001 ld bc,0x17ff ld (hl),0 ldir ld iy,draw_line ; Push col/row and memory locations of graphics to stack, ready to draw ; later ; Push top border ld b,16 ; Column/row ld de,0x0803 ; Location of border top ld hl,0x8180 push_top_border_next: push hl push de inc d djnz push_top_border_next ; Push right border ld b,16 ; Location of border right ld hl,0x8188 ; Column/row ld de,0x1804 push_right_border_next: push hl push de inc e djnz push_right_border_next ; Push bottom border ld b,16 ; Location of border top ld hl,0x8190 ; Column/row ld de,0x0814 push_bottom_border_next: push hl push de inc d djnz push_bottom_border_next ; Push left border ld b,16 ; Location of border right ld hl,0x8198 ; Column/row ld de,0x0704 push_left_border_next: push hl push de inc e djnz push_left_border_next ; Push border corners ; Location of border top-right ld hl,0x81a0 ; Column/row ld de,0x1803 push hl push de ; Location of border bottom-right ld hl,0x81a8 ; Column/row ld de,0x1814 push hl push de ; Location of border bottom-left ld hl,0x81b0 ; Column/row ld de,0x0714 push hl push de ; Location of border top-left ld hl,0x81b8 ; Column/row ld de,0x0703 push hl push de ld c,16 + 16 + 16 + 16 + 4 halt draw_border_char: pop de pop hl call draw_char dec c jr nz,draw_border_char ; Initialise snake xor a ; a = 0x00 ld (last_input),a ld (snake_direction_queue),a ld (snake_history_tail_offset),a inc a ; a = 0x01 ld (snake_history_head_offset),a inc a ; a = 0x02 ld (snake_direction_current),a ld a,0x87 ld (TBL_SNAKE_HISTORY),a ld a,0x67 ld (TBL_SNAKE_HISTORY + 1),a ld de,DIFFICULTIES_ROW_LENGTH ld ix,difficulties - DIFFICULTIES_ROW_LENGTH ld a,(difficulty) inc a ld b,a inc_difficulty: add ix,de djnz inc_difficulty ; Set snake speed ld a,(ix + 4) ld (no_of_frames_per_update),a ; Set high score string from value in difficulties table push ix pop hl ld de,5 add hl,de ld de,str_hi_score call gen_score_str ld a,3 ld (snake_length),a ; Reset score ld hl,0x0000 ld (score),hl ; Reset score string ld hl,0x3030 ; '00' ld (str_score),hl ld (str_score + 2),hl ; Score label ld de,0x0802 ld hl,str_score_lbl call print ; High score label ld de,0x1102 ld hl,str_hi_score_lbl call print ; High score ld de,0x1402 ld hl,str_hi_score call print ld a,(flags) ; Set food eaten flag set 0,a ; Invalidate all free squares tables or 0xf0 ld (flags),a ; Initialise previous frame count ld a,(23672) ld (previous_frame_count),a ; Draw initial snake graphics ; Location of snake head left ld hl,0x8120 ; Column/row ld de,0x0e0b ; 6 + 8, 7 + 4 call draw_char ; Location of snake body left/right ld hl,0x8130 ; Column/row ld de,0x0f0b ; 7 + 8, 7 + 4 call draw_char ; Location of snake tail right ld hl,0x8160 ; Column/row ld de,0x100b ; 8 + 8, 7 + 4 call draw_char
15.083969
79
0.565283
0c49b22c05826bd09cf17f2be32b08e9402736e8
195
asm
Assembly
tests/roms/roberto.asm
ValerioMerli/aiv_gb
1698dc52f530d43100baaa2034206f4552524b7a
[ "MIT" ]
null
null
null
tests/roms/roberto.asm
ValerioMerli/aiv_gb
1698dc52f530d43100baaa2034206f4552524b7a
[ "MIT" ]
null
null
null
tests/roms/roberto.asm
ValerioMerli/aiv_gb
1698dc52f530d43100baaa2034206f4552524b7a
[ "MIT" ]
null
null
null
section "code", rom0 nop nop ld bc, var000 ld a, 17 ld [bc], a ld h, b ld l, c ld d, [hl] ld a, 22 add a, d cp 39 jr z, success halt success: ld e, d halt section "ram", wram0 var000: ds 1
7.5
20
0.620513
c505c48be72ef944b3052a7eb9738802af07d5b1
2,238
asm
Assembly
tp/libs/asmlib/strcpy64.asm
pg83/zm
ef9027bd9ee260118fdf80e8b53361da1b7892f3
[ "MIT" ]
null
null
null
tp/libs/asmlib/strcpy64.asm
pg83/zm
ef9027bd9ee260118fdf80e8b53361da1b7892f3
[ "MIT" ]
null
null
null
tp/libs/asmlib/strcpy64.asm
pg83/zm
ef9027bd9ee260118fdf80e8b53361da1b7892f3
[ "MIT" ]
null
null
null
%include "defs.asm" ;************************* strcpy64.asm ************************************ ; Author: Agner Fog ; Date created: 2008-07-19 ; Last modified: 2011-07-01 ; Description: ; Faster version of the standard strcpy function: ; char * A_strcpy(char * dest, const char * src); ; Copies zero-terminated string from src to dest, including terminating zero. ; ; Overriding standard function memcpy: ; The alias ?OVR_strcpy is changed to _strcpy in the object file if ; it is desired to override the standard library function strcpy. ; ; Optimization: ; Uses optimized functions A_strlen and A_memcpy. These functions allow ; calling without proper stack alignment. ; ; Copyright (c) 2011 GNU General Public License www.gnu.org/licenses ;****************************************************************************** default rel global A_strcpy: function ; Function A_strcpy global EXP(strcpy): function ; ?OVR removed if standard function memcpy overridden ; Imported from strlen64.asm extern A_strlen ; Imported from memcpy64.asm extern A_memcpy SECTION .text align=16 ; extern "C" char * A_strcpy(char * dest, const char * src) { ; return memcpy(dest, src, strlen(src)+1); ; } ; Function entry: A_strcpy: EXP(strcpy): %IFDEF WINDOWS %define Rpar1 rcx ; function parameter 1 %define Rpar2 rdx ; function parameter 2 %define Rpar3 r8 ; function parameter 3 %ENDIF %IFDEF UNIX %define Rpar1 rdi ; function parameter 1 %define Rpar2 rsi ; function parameter 2 %define Rpar3 rdx ; function parameter 3 %ENDIF push Rpar1 ; dest push Rpar2 ; src mov Rpar1, Rpar2 ; (A_strlen does not require stack alignment) call A_strlen ; length of src lea Rpar3,[rax+1] ; include terminating zero in length pop Rpar2 ; src pop Rpar1 ; dest jmp A_memcpy ; copy and return ;A_strcpy ENDP
33.402985
96
0.557194
8fe7edd90a89e2117c91cf56e89912b9690b7852
104
asm
Assembly
Engine Hacks/DragonVeins/asm/DrawingDragonVein_1.asm
sme23/MekkahRestrictedHackComp1
1cc9d2fec557424f358b6bfa21f9f3bb6faf2978
[ "CC0-1.0" ]
3
2020-06-15T14:22:38.000Z
2020-06-28T19:44:52.000Z
Wizardry/SmeHax/TrapRework/Modules/DragonVeins/asm/DrawingDragonVein_1.s
sme23/WhatHeck
746a2be83358aaa4e855182176b47c4808f2587a
[ "CC0-1.0" ]
null
null
null
Wizardry/SmeHax/TrapRework/Modules/DragonVeins/asm/DrawingDragonVein_1.s
sme23/WhatHeck
746a2be83358aaa4e855182176b47c4808f2587a
[ "CC0-1.0" ]
null
null
null
.thumb @.org 0x27318 ldr r1, ExternalRoutine bx r1 ExternalRoutine: @overwrite in EA install file.
13
34
0.75
79896483834bcfdc12440f1352739cf652f0ad5d
159
asm
Assembly
ASM/src/truth_spinner_fix.asm
scaramangado/Better-OoT
ac9d7ac329010614eb2801a6e6e500f0cc2a35e0
[ "MIT" ]
null
null
null
ASM/src/truth_spinner_fix.asm
scaramangado/Better-OoT
ac9d7ac329010614eb2801a6e6e500f0cc2a35e0
[ "MIT" ]
null
null
null
ASM/src/truth_spinner_fix.asm
scaramangado/Better-OoT
ac9d7ac329010614eb2801a6e6e500f0cc2a35e0
[ "MIT" ]
null
null
null
; set the angle for the solution to the puzzle to 0x5555 (first try) truth_spinner_fix: addiu t5, r0, 0x5555 ;facing angle for first try jr ra nop
26.5
68
0.710692
bd1f7e72fb3cb5eabb176afb6d5737ce8a35f20d
1,104
asm
Assembly
src/util/oli/app/alar.asm
olifink/qspread
d6403d210bdad9966af5d2a0358d4eed3f1e1c02
[ "MIT" ]
null
null
null
src/util/oli/app/alar.asm
olifink/qspread
d6403d210bdad9966af5d2a0358d4eed3f1e1c02
[ "MIT" ]
null
null
null
src/util/oli/app/alar.asm
olifink/qspread
d6403d210bdad9966af5d2a0358d4eed3f1e1c02
[ "MIT" ]
null
null
null
; allocate a new array include win1_mac_oli section utility xdef ut_alar ;+++ ; allocate a new array (type abs.) ; ; Entry Exit ; d1.l nr. of elements 0 (=type absolute) ; d2.w multiplicator preserved ; a0 array descriptor ; ; errors: imem ; cc set ;--- ut_alar subr d2 bsr.s aloc bne.s exit move.l a0,-(sp) moveq #14,d0 add.l a0,d0 move.l d0,(a0)+ ; array contents pointer move.w #2,(a0)+ ; 2 dimensions subq.l #1,d1 move.w d1,(a0)+ ; nr of elements move.w d2,(a0)+ ; multiplicator subq.w #2,d2 move.w d2,(a0)+ ; length move.w #1,(a0) move.l (sp)+,a0 moveq #0,d1 moveq #0,d0 exit subend aloc subr d1 mulu.w d2,d1 add.l #14,d1 xjsr ut_alchp subend end
24
66
0.404891
2f76667002069b3f849b81a52aee2cbe84c34143
391
asm
Assembly
programs/oeis/096/A096946.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/096/A096946.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/096/A096946.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A096946: Ninth column of (1,5)-Pascal triangle A096940. ; 5,41,189,645,1815,4455,9867,20163,38610,70070,121550,202878,327522,513570,784890,1172490,1716099,2465991,3485075,4851275,6660225,9028305,12096045,16031925,21036600,27347580,35244396,45054284,57158420 lpb $0 mov $2,$0 sub $0,1 seq $2,96945 ; Eighth column of (1,5)-Pascal triangle A096940. add $1,$2 lpe add $1,5 mov $0,$1
32.583333
201
0.746803
25c106752dc5d5549dab41f6e442ab043bed0c13
5,188
asm
Assembly
ee/hk/fitem.asm
olifink/smsqe
c546d882b26566a46d71820d1539bed9ea8af108
[ "BSD-2-Clause" ]
null
null
null
ee/hk/fitem.asm
olifink/smsqe
c546d882b26566a46d71820d1539bed9ea8af108
[ "BSD-2-Clause" ]
null
null
null
ee/hk/fitem.asm
olifink/smsqe
c546d882b26566a46d71820d1539bed9ea8af108
[ "BSD-2-Clause" ]
null
null
null
; HOTKEY Find ITEM V2.01  1988 Tony Tebby QJUMP ; first revision provides optional case independence section hotkey xdef hk_fitem ; find item (a1) name or char xdef hk_fitmu ; find item (a1) name or char (case) xdef hk_fitrm ; find item (a1) and remove xdef hk_fitmc ; find item d1 char xdef hk_fitrc ; find item d1 and remove xdef hk_fitmk ; find item d1 key (case optional) xref hk_cname xref cv_lctab include 'dev8_keys_k' include 'dev8_keys_err' include 'dev8_ee_hk_data' include 'dev8_mac_assert' ;+++ ; This routine finds a hotkey item given a pointer to a name or key string ; and removes references from the hotkey table and pointer list ; ; d1 r (word) hotkey ; d2 r (word) hotkey number (-ve if off) ; a1 cr hotkey item name / pointer to hotkey item ; a3 c p linkage block ; error returns 0 or err.fdnf ;--- hk_fitrm reglist reg d3/a0/a2/a4 movem.l reglist,-(sp) bsr.s hkf_itmu bra.s hkf_remv ;+++ ; This routine finds a hotkey item given a character ; and removes references from the hotkey table and pointer list ; ; d1 cr (word) hotkey ; d2 r (word) hotkey number (-ve if off) ; a1 r pointer to hotkey item ; a3 c p linkage block ; error returns 0 or err.fdnf ;--- hk_fitrc movem.l reglist,-(sp) bsr.s hkf_index hkf_remv bne.s hkf_exit clr.b (a2) ; clear key clr.l (a4) ; and pointer bra.s hkf_exit ;+++ ; This routine finds a hotkey item given a pointer to a name or key string ; Uppercase key is significant ; d1 r (word) hotkey ; d2 r (word) hotkey number (-ve if off) ; a1 cr hotkey item name / pointer to hotkey item ; a3 c p linkage block ; error returns 0 or err.fdnf ;--- hk_fitmu movem.l reglist,-(sp) bsr.s hkf_itmu bra.s hkf_exit ;+++ ; This routine finds a hotkey item given a pointer to a name or key string ; ; d1 r (word) hotkey ; d2 r (word) hotkey number (-ve if off) ; a1 cr hotkey item name / pointer to hotkey item ; a3 c p linkage block ; error returns 0 or err.fdnf ;--- hk_fitem movem.l reglist,-(sp) moveq #-1,d0 ; case insignificant bsr.s hkf_item hkf_exit movem.l (sp)+,reglist rts hkf_itmu moveq #0,d0 hkf_item move.l a1,a0 move.w (a1)+,d1 cmp.w #1,d1 ; one character? beq.s hkf_key ; ... just one moveq #0,d1 hkf_loop bsr.s hkf_index ; index table bne.s hkf_next ; ... next addq.l #hki_name,a1 jsr hk_cname ; and compare subq.l #hki_name,a1 beq.s hkfi_rts ; that's it hkf_next addq.b #1,d1 ; next bne.s hkf_loop moveq #err.fdnf,d0 ; not found hkfi_rts rts ;+++ ; This routine finds a hotkey item given a hotkey character ; ; d1 cr (word) hotkey ; d2 r (word) hotkey number (-ve if off, 0 not found) ; a1 r pointer to hotkey item ; a3 c p linkage block ; error returns 0 or err.fdnf ;--- hk_fitmc movem.l reglist,-(sp) bsr.s hkf_index bra.s hkf_exit ;+++ ; This routine finds a hotkey item given a hotkey keystroke ; ; d1 cr (word) hotkey (may be lower cased) ; d2 r (word) hotkey number (-ve if off, 0 not found) ; a1 r pointer to hotkey item ; a3 c p linkage block ; error returns 0 or err.fdnf ;--- hk_fitmk movem.l reglist,-(sp) bsr.s hkf_kyck bra.s hkf_exit hkf_key move.b (a1)+,d1 ; key character tst.b d0 ; case significant? beq.s hkf_index ; ... yes hkf_kyck and.w #$00ff,d1 bsr.s hkf_index ; try this case beq.s hkfi_rts ; ... OK lea cv_lctab,a2 ; try move.b (a2,d1.w),d1 ; ... lowercased page hkf_index lea hkd_tabl(a3),a2 ; index the table add.w d1,a2 move.b (a2),d2 ext.w d2 ; a word move.w d2,d0 beq.s hkf_nf ; ... not set bgt.s hkf_pitem ; ... ok neg.w d0 ; ... off hkf_pitem lsl.w #2,d0 ; index the pointers lea hkd_ptrb-4(a3),a4 add.w d0,a4 move.l (a4),a1 ; pointer to item cmp.w #hki.id,hki_id(a1) ; is it item? bne.s hkf_nf moveq #0,d0 rts hkf_nf moveq #err.fdnf,d0 rts end
29.477273
77
0.500386
3599ee9b2b3f12ee33fececcc4069e6626625757
1,115
asm
Assembly
_maps/obj2F.asm
NatsumiFox/AMPS-Sonic-1-2005
ac8730799f1b96291358c77a4b64529de94ce8a4
[ "Apache-2.0" ]
2
2020-04-09T19:36:35.000Z
2021-01-05T14:20:17.000Z
_maps/obj2F.asm
NatsumiFox/AMPS-Sonic-1-2005
ac8730799f1b96291358c77a4b64529de94ce8a4
[ "Apache-2.0" ]
null
null
null
_maps/obj2F.asm
NatsumiFox/AMPS-Sonic-1-2005
ac8730799f1b96291358c77a4b64529de94ce8a4
[ "Apache-2.0" ]
1
2020-06-17T14:16:35.000Z
2020-06-17T14:16:35.000Z
; --------------------------------------------------------------------------- ; Sprite mappings - large moving platforms (MZ) ; --------------------------------------------------------------------------- dc.w byte_B2DA-Map_obj2F dc.w byte_B31C-Map_obj2F dc.w byte_B34F-Map_obj2F byte_B2DA: dc.b $D dc.b $D8, 6, 0, $57, $C0 dc.b $F0, 5, 0, $53, $C0 dc.b 0, $F, 0, 1, $C0 dc.b $D0, $F, 0, $27, $D0 dc.b $F0, $D, 0, $37, $D0 dc.b $F0, $F, 0, 1, $E0 dc.b $D0, $F, 0, $11, $F0 dc.b $D0, $F, 0, $3F, $10 dc.b $F0, $D, 0, $4F, $10 dc.b $F0, $F, 0, 1, 0 dc.b 0, $F, 0, 1, $20 dc.b $D8, 6, 0, $57, $30 dc.b $F0, 5, 0, $53, $30 byte_B31C: dc.b $A dc.b $D0, $F, 0, $27, $C0 dc.b $F0, $D, 0, $37, $C0 dc.b 0, $F, 0, 1, $C0 dc.b $C0, $F, 0, $27, $E0 dc.b $E0, $D, 0, $37, $E0 dc.b $F0, $F, 0, 1, $E0 dc.b $C0, $F, 0, $11, 0 dc.b $E0, $F, 0, 1, 0 dc.b $C0, $F, 0, $3F, $20 dc.b $E0, $D, 0, $4F, $20 byte_B34F: dc.b 6 dc.b $D0, $F, 0, $11, $E0 dc.b $F0, $F, 0, 1, $E0 dc.b $10, $F, 0, 1, $E0 dc.b $D0, $F, 0, $11, 0 dc.b $F0, $F, 0, 1, 0 dc.b $10, $F, 0, 1, 0 even
28.589744
77
0.395516
e6d195d36298a0f90dd12cfb3bf4c85e63e07941
16,727
asm
Assembly
src/player.asm
santiontanon/talesofpopolon-ext
a7c7fd1164d506d6b0c6245fdf3ad0b634facd84
[ "Apache-2.0" ]
4
2019-10-20T08:14:01.000Z
2021-09-24T19:41:47.000Z
src/player.asm
santiontanon/talesofpopolon-ext
a7c7fd1164d506d6b0c6245fdf3ad0b634facd84
[ "Apache-2.0" ]
1
2019-10-20T12:21:06.000Z
2019-10-21T21:52:35.000Z
src/player.asm
santiontanon/talesofpopolon-ext
a7c7fd1164d506d6b0c6245fdf3ad0b634facd84
[ "Apache-2.0" ]
null
null
null
;----------------------------------------------- ; executes one update cycle of the player (Called at each game cycle) updatePlayer: ld a,(player_hit_timmer) or a jp z,updatePlayer_continue dec a ld (player_hit_timmer),a and #01 jr z,updatePlayer_flashin updatePlayer_flashout: ld a,8 ;; flash the knight red color ld (knight_sprite_attributes+3),a jr updatePlayer_continue updatePlayer_flashin: ld a,(current_armor_color) ld (knight_sprite_attributes+3),a updatePlayer_continue: ld a,(player_state) or a jr z,updatePlayer_walking dec a jr z,updatePlayer_attack jr updatePlayer_cooldown updatePlayer_walking: ld a,(player_state_cycle) inc a ld (player_state_cycle),a and #03 ret nz ld a,(knight_animation_frame) and 32 xor 32*1 ld (knight_animation_frame),a ret updatePlayer_attack: ld a,32*2 ld (knight_animation_frame),a ld a,(current_weapon) dec a call z,updatePlayer_attack_sword dec a call z,updatePlayer_attack_goldsword ld a,(player_state_cycle) inc a ld (player_state_cycle),a cp 3 jp m,updatePlayer_sword_continue ld a,PLAYER_STATE_COOLDOWN ld (player_state),a xor a ld (player_state_cycle),a updatePlayer_sword_continue: ret updatePlayer_attack_sword: ld a,SWORD_COLOR ld (knight_sprite_attributes+11),a updatePlayer_attack_sword_2: ld a,127-40 ld (knight_sprite_attributes+8),a ret updatePlayer_attack_goldsword: ld a,GOLDSWORD_COLOR ld (knight_sprite_attributes+11),a jr updatePlayer_attack_sword_2 updatePlayer_cooldown: ld a,(player_state_cycle) inc a ld (player_state_cycle),a and #01 ret z ld a,(knight_animation_frame) and 32 xor 32*1 ld (knight_animation_frame),a ld a,200 ld (knight_sprite_attributes+8),a ; place the sword sprites somewhere outside of the screen ld (knight_sprite_attributes+12),a ; place the sword sprites somewhere outside of the screen ld a,PLAYER_STATE_WALKING ld (player_state),a ret ;----------------------------------------------- ; movement functions of the player TurnLeft: push af ld a,(previous_trigger1) or a jp nz,MoveLeft_nopush ld a,(player_angle) add a,-4 ld (player_angle),a pop af ret TurnRight: push af ld a,(previous_trigger1) or a jp nz,MoveRight_nopush ld a,(player_angle) add a,4 ld (player_angle),a pop af ret MoveForward: push af ld hl,cos_table ld b,0 ld a,(player_angle) ld c,a add hl,bc add hl,bc push hl ld c,(hl) inc hl ld b,(hl) ld hl,(player_precision_x) add hl,bc ld a,(player_y) ld b,a ld c,h call getMapPosition cp MAP_TILE_DOOR call z,openDoor ; after this call, "a" contains the new value of the map position (0 if the door was open, or MAP_TILE_DOOR otherwise) cp MAP_TILE_EXIT jr z,popHLAndJumpToWalkedIntoAnExit cp MAP_TILE_EXIT2 jr z,popHLAndJumpToWalkedIntoAnExit cp MAP_TILE_MIRROR_WALL call z,walkedIntoAMirrorWall or a jr nz,MoveForward_skip_x ld (player_precision_x),hl ld a,h ld (player_x),a MoveForward_skip_x: pop hl ld bc,sin_table-cos_table add hl,bc ; ld hl,sin_table ; ld b,0 ; ld a,(player_angle) ; ld c,a ; add hl,bc ; add hl,bc ld c,(hl) inc hl ld b,(hl) ld hl,(player_precision_y) add hl,bc ld a,(player_x) ld c,a ld b,h call getMapPosition cp MAP_TILE_DOOR call z,openDoor ; after this call, "a" contains the new value of the map position (0 if the door was open, or MAP_TILE_DOOR otherwise) cp MAP_TILE_EXIT jp z,walkedIntoAnExit cp MAP_TILE_EXIT2 jp z,walkedIntoAnExit cp MAP_TILE_MIRROR_WALL call z,walkedIntoAMirrorWall or a jr nz,MoveForward_skip_y ld (player_precision_y),hl ld a,h ld (player_y),a MoveForward_skip_y: call checkPickups pop af ret popHLAndJumpToWalkedIntoAnExit: pop hl jp walkedIntoAnExit MoveBackwards: push af ld a,(player_angle) add a,128 ld (player_angle),a call MoveForward ld a,(player_angle) add a,128 ld (player_angle),a MoveBackwards_do_not_reset_angle: pop af ret MoveRight: push af MoveRight_nopush: ld a,(player_angle) add a,64 ld (player_angle),a call MoveForward ld a,(player_angle) add a,-64 ld (player_angle),a pop af ret MoveLeft: push af MoveLeft_nopush: ld a,(player_angle) add a,-64 ld (player_angle),a call MoveForward ld a,(player_angle) add a,64 ld (player_angle),a pop af ret fireArrow: push af ld a,(player_mana) or a jr z,fireArrow_continue ld hl,arrow_data ; since there can be at most 2 arrows in screen at a time, we just unroll the search loop: ld a,(hl) or a jr z,fireArrow_slot_found ld hl,arrow_data+ARROW_STRUCT_SIZE ld a,(hl) or a jr z,fireArrow_slot_found jr fireArrow_continue fireArrow_slot_found: ld a,(player_mana) ;; use up one heart: dec a ld (player_mana),a ld (hl),ITEM_ARROW ; state: arrow fireArrow_slot_found_continue: call update_UI_mana ; actually fire the arrow: arrow type, low bytes of x,y, precision x,y direction, high bytes of x,y, sprite (10 bytes) inc hl ld de,player_precision_x ex de,hl ldi ; player_precision_x ; ldi inc hl ldi ; player_precision_y ; ldi ld hl,cos_table ld b,0 ld a,(player_angle) ld c,a add hl,bc add hl,bc push hl ldi ; direction_vector_x ldi pop hl ld bc,sin_table-cos_table add hl,bc ldi ; direction_vector_y ldi ld a,(player_x) ld (de),a inc de ld a,(player_y) ld (de),a inc de ld a,(current_secondary_weapon) dec a jr nz,fireArrow_setIceArrowSprite ld a,SPRITE_PATTERN_ARROW jr fireArrow_spriteSet fireArrow_setIceArrowSprite: ld a,SPRITE_PATTERN_ICEARROW fireArrow_spriteSet: ld (de),a ; play SFX: ld hl,SFX_fire_arrow call play_ingame_SFX fireArrow_continue: pop af ret fireIceArrow: push af ld a,(player_mana) cp 2 jp m,fireArrow_continue ld hl,arrow_data ; since there can be at most 2 arrows in screen at a time, we just unroll the search loop: ld a,(hl) or a jr z,fireIceArrow_slot_found ld hl,arrow_data+ARROW_STRUCT_SIZE ld a,(hl) or a jr z,fireIceArrow_slot_found jr fireArrow_continue fireIceArrow_slot_found: ld a,(player_mana) ;; use up two hearts: dec a dec a ld (player_mana),a ld (hl),ITEM_ICEARROW ; state: ice arrow jr fireArrow_slot_found_continue triggerHourglass: push af ld a,(player_mana) cp 4 jp m,triggerHourglass_continue ld a,(hourglass_timer) or a jr nz,triggerHourglass_continue ; call pauseMusic ld a,HOURGLASS_TIME ld (hourglass_timer),a ld a,(player_mana) sub 4 ld (player_mana),a call update_UI_mana triggerHourglass_continue: pop af ret ;----------------------------------------------- ; Changes the current weapon of the player to the next available one ; Specifically, this function: ; - sets (current_weapon) to the next available weapon ; - updates the UI to reflect the change ChangeWeapon: ;; find the next available weapon: ld hl,SFX_weapon_switch call play_ingame_SFX ld de,current_weapon ld a,(de) inc a ChangeWeapon_next_loop: ld (de),a cp N_WEAPONS jr z,ChangeWeapon_overflow ld hl,available_weapons ADD_HL_A ld a,(hl) or a jr nz,ChangeWeapon_next_found jr ChangeWeapon ChangeWeapon_overflow: xor a jr ChangeWeapon_next_loop ChangeWeapon_next_found: ld a,(current_weapon) or a jr z,ChangeWeapon_barehands dec a jr z,ChangeWeapon_sword ; dec a jr ChangeWeapon_goldsword ;; we should never reach here ; ret ChangeWeapon_barehands: ld hl,UI_message_equip_barehand ld c,UI_message_equip_barehand_end-UI_message_equip_barehand call displayUIMessage ld hl,ROM_barehand_weapon_patterns jr ChangeWeapon_change_ui ChangeWeapon_sword: ld hl,UI_message_equip_sword ld c,UI_message_equip_sword_end-UI_message_equip_sword call displayUIMessage ld hl,ROM_sword_weapon_patterns call ChangeWeapon_change_ui ld hl,sword_sprite ld de,SPRTBL2+SWORD_SPRITE*32 ld bc,32 jp LDIRVM ChangeWeapon_goldsword: ld hl,UI_message_equip_goldsword ld c,UI_message_equip_goldsword_end-UI_message_equip_goldsword call displayUIMessage ld hl,ROM_goldsword_weapon_patterns call ChangeWeapon_change_ui ld hl,goldsword_sprite ld de,SPRTBL2+SWORD_SPRITE*32 ld bc,32 jp LDIRVM ChangeWeapon_change_ui: ld de,NAMTBL2+256*2+17+3*32 ; jp ChangeWeapon_change_ui_generic ChangeWeapon_change_ui_generic: push hl push de ld bc,3 call LDIRVM ld bc,3 pop de pop hl add hl,bc ld a,e add a,32 ld e,a push hl push de call LDIRVM ld bc,3 pop de pop hl add hl,bc ld a,e add a,32 ld e,a jp LDIRVM ChangeSecondaryWeapon_change_ui: ld de,NAMTBL2+256*2+21+3*32 jr ChangeWeapon_change_ui_generic ;----------------------------------------------- ; Changes the current secondary weapon of the player to the next available one ; Specifically, this function: ; - sets (current_secondary_weapon) to the next available weapon ; - updates the UI to reflect the change ChangeSecondaryWeapon: ld hl,SFX_weapon_switch call play_ingame_SFX ;; find the next available secondary weapon: ld de,current_secondary_weapon ld a,(de) inc a ChangeSecondaryWeapon_next_loop: ld (de),a cp N_SECONDARY_WEAPONS jr z,ChangeSecondaryWeapon_overflow ld hl,available_secondary_weapons ADD_HL_A ld a,(hl) or a jr nz,ChangeSecondaryWeapon_next_found jr ChangeSecondaryWeapon ChangeSecondaryWeapon_overflow: xor a jr ChangeSecondaryWeapon_next_loop ChangeSecondaryWeapon_next_found: ld a,(current_secondary_weapon) or a jr z,ChangeSecondaryWeapon_barehands dec a jr z,ChangeSecondaryWeapon_arrow dec a jr z,ChangeSecondaryWeapon_icearrow jr ChangeSecondaryWeapon_hourglass ChangeSecondaryWeapon_barehands: ld hl,UI_message_equip_barehand ld c,UI_message_equip_barehand_end-UI_message_equip_barehand call displayUIMessage ld hl,ROM_barehand_secondaryweapon_patterns jr ChangeSecondaryWeapon_change_ui ChangeSecondaryWeapon_arrow: ld hl,UI_message_equip_secondary_arrow ld c,UI_message_equip_secondary_arrow_end-UI_message_equip_secondary_arrow call displayUIMessage ld hl,ROM_arrow_secondaryweapon_patterns jr ChangeSecondaryWeapon_change_ui ChangeSecondaryWeapon_icearrow: ld hl,UI_message_equip_secondary_icearrow ld c,UI_message_equip_secondary_icearrow_end-UI_message_equip_secondary_icearrow call displayUIMessage ld hl,ROM_icearrow_secondaryweapon_patterns jr ChangeSecondaryWeapon_change_ui ChangeSecondaryWeapon_hourglass: ld hl,UI_message_equip_secondary_hourglass ld c,UI_message_equip_secondary_hourglass_end-UI_message_equip_secondary_hourglass call displayUIMessage ld hl,ROM_hourglass_secondaryweapon_patterns jr ChangeSecondaryWeapon_change_ui ;----------------------------------------------- ; Changes the current armor of the player to the next available one ; Specifically, this function: ; - sets (current_armor) to the next available weapon ; - updates the knight sprite color to reflect the change ChangeArmor: ld hl,SFX_weapon_switch call play_ingame_SFX ;; find the next available armor: ld de,current_armor ld a,(de) inc a ChangeArmor_next_loop: ld (de),a cp N_ARMORS jr z,ChangeArmor_overflow ld hl,available_armors ADD_HL_A ld a,(hl) or a jr nz,ChangeArmor_next_found jr ChangeArmor ChangeArmor_overflow: xor a jr ChangeArmor_next_loop ChangeArmor_next_found: ld a,(current_armor) ;; I do not reuse "de" here, since "ChangeArmor_next_found" can be called by the password decoding code or a jr z,ChangeArmor_default dec a jr z,ChangeArmor_silver jr ChangeArmor_gold ChangeArmor_default: ld hl,UI_message_equip_armor_iron ld c,UI_message_equip_armor_iron_end-UI_message_equip_armor_iron call displayUIMessage ld a,KNIGHT_COLOR ld (knight_sprite_attributes+3),a ld (current_armor_color),a ret ChangeArmor_silver: ld hl,UI_message_equip_armor_silver ld c,UI_message_equip_armor_silver_end-UI_message_equip_armor_silver call displayUIMessage ld a,KNIGHT_SILVER_COLOR ld (knight_sprite_attributes+3),a ld (current_armor_color),a ret ChangeArmor_gold: ld hl,UI_message_equip_armor_gold ld c,UI_message_equip_armor_gold_end-UI_message_equip_armor_gold call displayUIMessage ld a,KNIGHT_GOLD_COLOR ld (knight_sprite_attributes+3),a ld (current_armor_color),a ret ;----------------------------------------------- ; checks if there is an enemy in range of the main weapon, and deals damage ; enemy structures are: (type, x, y, sprite, color, hit points, state1, state2) playerWeaponSwing: ld hl,SFX_sword_swing call play_ingame_SFX ld a,(current_weapon) or a jp z,playerWeaponSwing_barehands dec a jp z,playerWeaponSwing_sword ; gold sword: ld c,14 ;; long range jp playerWeaponSwing_continue playerWeaponSwing_barehands: ld c,8 jp playerWeaponSwing_continue playerWeaponSwing_sword: ld c,11 playerWeaponSwing_continue: ld hl,currentMapEnemies ld b,(hl) inc hl playerWeaponSwing_loop: ld a,(hl) or a jp z,playerWeaponSwing_next cp ENEMY_EXPLOSION jp z,playerWeaponSwing_next ld a,(player_x) inc hl sub (hl) ld e,a jp p,playerWeaponSwing_positive_xdiff neg playerWeaponSwing_positive_xdiff: cp c ;; compare with the weapon range jp p,playerWeaponSwing_next_x ld a,(player_y) inc hl sub (hl) ld d,a jp p,playerWeaponSwing_positive_ydiff neg playerWeaponSwing_positive_ydiff: cp c ;; compare with the weapon range jp p,playerWeaponSwing_next_y ;; check the angle: push bc push hl ld b,e ; xdiff ld c,d ; ydiff call atan2 add a,128 ld b,a ld a,(player_angle) sub b pop hl pop bc jp p,playerWeaponSwing_positive_anglediff neg playerWeaponSwing_positive_anglediff: cp 24 ; a +-24 angle degree range jp p,playerWeaponSwing_next_y dec hl dec hl ld a,(hl) ;; we get the enemy type again cp ENEMY_MEDUSA_STONE jp z,playerWeaponSwing_deflect ; medusa is invulnerable! (play SFX though) cp ENEMY_SWITCH jp z,playerWeaponSwing_activateSwitch cp ENEMY_BULLET jp z,playerWeaponSwing_next jp playerWeaponSwing_hitEnemy playerWeaponSwing_next: inc hl playerWeaponSwing_next_x: inc hl playerWeaponSwing_next_y: ld de,ENEMY_STRUCT_SIZE-2 add hl,de djnz playerWeaponSwing_loop ret playerWeaponSwing_hitEnemy: ;; enemy hit! push hl ;; play enemy hit SFX (this will overwrite any previous SFX played): ld hl,SFX_hit_enemy call play_ingame_SFX pop hl push hl pop iy ld a,(iy+5) dec a ld (iy+5),a jp nz,playerWeaponSwing_next call killedEnemy ld (iy),ENEMY_EXPLOSION ld (iy+3),ENEMY_EXPLOSION_SPRITE_PATTERN ld (iy+4),ENEMY_EXPLOSION_COLOR ld (iy+6),8 ; duration of the explosion jp playerWeaponSwing_next playerWeaponSwing_deflect: ;; play enemy deflect SFX (this will overwrite any previous SFX played): push hl ld hl,SFX_hit_deflected call play_ingame_SFX pop hl jp playerWeaponSwing_next playerWeaponSwing_activateSwitch: push hl ld hl,SFX_door_open call play_ingame_SFX pop hl push hl pop iy ld a,(iy+6) or a jp z,playerWeaponSwing_activateSwitch_switch_to_1 playerWeaponSwing_activateSwitch_switch_to_0: ld (iy+6),0 ld (iy+3),ENEMY_SWITCH_RIGHT_SPRITE_PATTERN ld a,(iy+7) push bc ld c,(iy+8) call triggerEvent pop bc jp playerWeaponSwing_next playerWeaponSwing_activateSwitch_switch_to_1: ld (iy+6),1 ld (iy+3),ENEMY_SWITCH_LEFT_SPRITE_PATTERN ld a,(iy+7) push bc ld c,(iy+8) call triggerEvent pop bc jp playerWeaponSwing_next
23.559155
140
0.69618
1e9468fe0471b6c3253613af2fad31b419ac1222
639
asm
Assembly
oeis/116/A116971.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/116/A116971.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/116/A116971.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A116971: a(n) = (35*2^((2*(3*n+2) + 2)/3) - 2*(3*n+2) - 46)/9. ; 10,56,242,988,3974,15920,63706,254852,1019438,4077784,16311170,65244716,260978902,1043915648,4175662634,16702650580,66810602366,267242409512,1068969638098,4275878552444,17103514209830,68414056839376,273656227357562,1094624909430308,4378499637721294,17513998550885240,70055994203541026,280223976814164172,1120895907256656758,4483583629026627104,17934334516106508490,71737338064426034036,286949352257704136222,1147797409030816544968,4591189636123266179954,18364758544493064719900 add $0,1 mov $1,3 lpb $0 sub $0,1 mul $1,4 add $2,2 add $1,$2 lpe sub $1,4 mov $0,$1
45.642857
479
0.804382
1e9852b77ef81aa96ac2eddbedb3eaa878e6b82f
610
asm
Assembly
P5/P5_TestCode/P5_L1_testcase11/P5_L1_testcase11/mips11.asm
alxzzhou/BUAA_CO_2020
b54bf367081a5a11701ebc3fc78a23494aecca9e
[ "Apache-2.0" ]
1
2022-01-23T09:24:47.000Z
2022-01-23T09:24:47.000Z
P5/P5_TestCode/P5_L1_testcase11/mips11.asm
alxzzhou/BUAA_CO_2020
b54bf367081a5a11701ebc3fc78a23494aecca9e
[ "Apache-2.0" ]
null
null
null
P5/P5_TestCode/P5_L1_testcase11/mips11.asm
alxzzhou/BUAA_CO_2020
b54bf367081a5a11701ebc3fc78a23494aecca9e
[ "Apache-2.0" ]
null
null
null
jal loop ori $t0, $ra, 0 loop: beq $t0, $ra, loop2 nop loop2: jal loop3 ori $t1, $ra, 0 loop3: beq $ra, $t1, loop4 nop loop4: jal loop5 ori $t2, $ra, 0 loop5: nop beq $ra, $t2, loop6 nop loop6: jal loop7 ori $t3, $ra, 0 loop7: nop beq $t3, $ra, loop8 nop loop8: jal loop9 ori $t4, $ra, 0 loop9: nop beq $ra, $t4, loop10 nop loop10: jal loop11 ori $t5, $ra, 0 loop11: nop beq $t5, $ra, loop12 nop loop12: jal loop13 ori $t6, $ra, 0 loop13: nop nop beq $t6, $ra, loop14 nop loop14: jal loop15 ori $t7, $ra, 0 loop15: nop nop beq $ra, $t7, loop16 nop loop16: ori $t0, $0, 12
10.701754
21
0.609836
147955b5ed0c11ab56fc515b06ec9a9f27dbbecf
4,570
asm
Assembly
Transynther/x86/_processed/NC/_st_sm_/i3-7100_9_0x84_notsx.log_149_446.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NC/_st_sm_/i3-7100_9_0x84_notsx.log_149_446.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NC/_st_sm_/i3-7100_9_0x84_notsx.log_149_446.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 %r13 push %r8 push %r9 push %rcx push %rdi push %rsi lea addresses_UC_ht+0x1f6c, %r13 clflush (%r13) nop nop cmp %rdi, %rdi mov (%r13), %r12 cmp $24138, %r8 lea addresses_WC_ht+0x15f0, %rsi clflush (%rsi) nop nop nop nop add $20121, %r9 and $0xffffffffffffffc0, %rsi vmovaps (%rsi), %ymm7 vextracti128 $1, %ymm7, %xmm7 vpextrq $1, %xmm7, %r10 and %r9, %r9 lea addresses_WC_ht+0x12270, %rdi nop nop nop nop and %r12, %r12 movups (%rdi), %xmm0 vpextrq $0, %xmm0, %rsi and $9953, %r10 lea addresses_WT_ht+0x1194, %rsi nop nop nop nop xor $9033, %r9 vmovups (%rsi), %ymm6 vextracti128 $1, %ymm6, %xmm6 vpextrq $0, %xmm6, %r12 nop nop nop cmp $38506, %r13 lea addresses_WT_ht+0xe7ec, %r12 clflush (%r12) nop nop nop nop cmp $8071, %r8 movups (%r12), %xmm4 vpextrq $0, %xmm4, %r13 nop and $59691, %r12 lea addresses_WC_ht+0xd16c, %r10 nop xor $16134, %r9 and $0xffffffffffffffc0, %r10 movaps (%r10), %xmm0 vpextrq $0, %xmm0, %rdi nop nop nop add %r8, %r8 lea addresses_D_ht+0x37ec, %rdi nop nop nop nop add $10892, %r13 mov $0x6162636465666768, %r12 movq %r12, (%rdi) nop nop nop cmp %r9, %r9 lea addresses_UC_ht+0x1416c, %rsi lea addresses_A_ht+0x136ec, %rdi nop nop nop nop nop cmp %r8, %r8 mov $27, %rcx rep movsb nop nop nop xor %rdi, %rdi pop %rsi pop %rdi pop %rcx pop %r9 pop %r8 pop %r13 pop %r12 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r13 push %r9 push %rbp push %rcx push %rsi // Store mov $0x6fe5220000000fec, %r13 nop nop nop add %rcx, %rcx movw $0x5152, (%r13) nop nop nop nop nop xor %rbp, %rbp // Store lea addresses_normal+0x1196c, %r11 dec %r9 mov $0x5152535455565758, %rbp movq %rbp, %xmm3 vmovups %ymm3, (%r11) nop nop and $17496, %r11 // Load lea addresses_US+0xcf90, %rcx clflush (%rcx) nop nop nop nop nop xor $18921, %rsi movb (%rcx), %r13b nop nop nop cmp %rbp, %rbp // Store lea addresses_normal+0x1404c, %r13 and $10192, %r12 movl $0x51525354, (%r13) add $21300, %r9 // Faulty Load mov $0x6fe5220000000fec, %rsi and $52664, %r9 vmovups (%rsi), %ymm3 vextracti128 $0, %ymm3, %xmm3 vpextrq $0, %xmm3, %rcx lea oracles, %r12 and $0xff, %rcx shlq $12, %rcx mov (%r12,%rcx,1), %rcx pop %rsi pop %rcx pop %rbp pop %r9 pop %r13 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_NC', 'same': False, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_NC', 'same': True, 'size': 2, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_normal', 'same': False, 'size': 32, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_US', 'same': False, 'size': 1, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_normal', 'same': False, 'size': 4, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} [Faulty Load] {'src': {'type': 'addresses_NC', 'same': True, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_UC_ht', 'same': False, 'size': 8, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WC_ht', 'same': True, 'size': 32, 'congruent': 1, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 16, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 32, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 16, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 16, 'congruent': 6, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 8, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM'} {'52': 149} 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 */
22.292683
446
0.647265
da1c6c2b01370754ffaaaee22a1881800da03771
344
asm
Assembly
text/maps/celadon_house.asm
longlostsoul/EvoYellow
fe5d0d372c4e90d384c4005a93f19d7968f2ff13
[ "Unlicense" ]
16
2018-08-28T21:47:01.000Z
2022-02-20T20:29:59.000Z
text/maps/celadon_house.asm
longlostsoul/EvoYellow
fe5d0d372c4e90d384c4005a93f19d7968f2ff13
[ "Unlicense" ]
5
2019-04-03T19:53:11.000Z
2022-03-11T22:49:34.000Z
text/maps/celadon_house.asm
longlostsoul/EvoYellow
fe5d0d372c4e90d384c4005a93f19d7968f2ff13
[ "Unlicense" ]
2
2019-12-09T19:46:02.000Z
2020-12-05T21:36:30.000Z
_CeladonHouseText1:: text "Heheh! Gambler's" line "fallacy brings" cont "dough, big time!" done _CeladonHouseText2:: text "CHIEF!" para "We just shipped" line "2000 #MON as" cont "slot prizes!" done _CeladonHouseText3:: text "Do touch the" line "poster at the" cont "GAME CORNER!" para "Fear reverse" line "psychology!" done
14.956522
24
0.700581
f8c1a3093f4362f17f1caf84e0ad8e0f043e2f8d
3,687
asm
Assembly
programs/oeis/175/A175605.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/175/A175605.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/175/A175605.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A175605: a(n) = concatenation of n^3 with itself. ; 11,88,2727,6464,125125,216216,343343,512512,729729,10001000,13311331,17281728,21972197,27442744,33753375,40964096,49134913,58325832,68596859,80008000,92619261,1064810648,1216712167,1382413824,1562515625,1757617576,1968319683,2195221952,2438924389,2700027000,2979129791,3276832768,3593735937,3930439304,4287542875,4665646656,5065350653,5487254872,5931959319,6400064000,6892168921,7408874088,7950779507,8518485184,9112591125,9733697336,103823103823,110592110592,117649117649,125000125000,132651132651,140608140608,148877148877,157464157464,166375166375,175616175616,185193185193,195112195112,205379205379,216000216000,226981226981,238328238328,250047250047,262144262144,274625274625,287496287496,300763300763,314432314432,328509328509,343000343000,357911357911,373248373248,389017389017,405224405224,421875421875,438976438976,456533456533,474552474552,493039493039,512000512000,531441531441,551368551368,571787571787,592704592704,614125614125,636056636056,658503658503,681472681472,704969704969,729000729000,753571753571,778688778688,804357804357,830584830584,857375857375,884736884736,912673912673,941192941192,970299970299,10000001000000,10303011030301,10612081061208,10927271092727,11248641124864,11576251157625,11910161191016,12250431225043,12597121259712,12950291295029,13310001331000,13676311367631,14049281404928,14428971442897,14815441481544,15208751520875,15608961560896,16016131601613,16430321643032,16851591685159,17280001728000,17715611771561,18158481815848,18608671860867,19066241906624,19531251953125,20003762000376,20483832048383,20971522097152,21466892146689,21970002197000,22480912248091,22999682299968,23526372352637,24061042406104,24603752460375,25154562515456,25713532571353,26280722628072,26856192685619,27440002744000,28032212803221,28632882863288,29242072924207,29859842985984,30486253048625,31121363112136,31765233176523,32417923241792,33079493307949,33750003375000,34429513442951,35118083511808,35815773581577,36522643652264,37238753723875,37964163796416,38698933869893,39443123944312,40196794019679,40960004096000,41732814173281,42515284251528,43307474330747,44109444410944,44921254492125,45742964574296,46574634657463,47416324741632,48268094826809,49130004913000,50002115000211,50884485088448,51777175177717,52680245268024,53593755359375,54517765451776,55452335545233,56397525639752,57353395735339,58320005832000,59297415929741,60285686028568,61284876128487,62295046229504,63316256331625,64348566434856,65392036539203,66446726644672,67512696751269,68590006859000,69678716967871,70778887077888,71890577189057,73013847301384,74148757414875,75295367529536,76453737645373,77623927762392,78805997880599,80000008000000,81206018120601,82424088242408,83654278365427,84896648489664,86151258615125,87418168741816,88697438869743,89989128998912,91293299129329,92610009261000,93939319393931,95281289528128,96635979663597,98003449800344,99383759938375,1007769610077696,1021831310218313,1036023210360232,1050345910503459,1064800010648000,1079386110793861,1094104810941048,1108956711089567,1123942411239424,1139062511390625,1154317611543176,1169708311697083,1185235211852352,1200898912008989,1216700012167000,1232639112326391,1248716812487168,1264933712649337,1281290412812904,1297787512977875,1314425613144256,1331205313312053,1348127213481272,1365191913651919,1382400013824000,1399752113997521,1417248814172488,1434890714348907,1452678414526784,1470612514706125,1488693614886936,1506922315069223,1525299215252992,1543824915438249,1562500015625000 add $0,1 mov $2,$0 mul $2,$0 mul $0,$2 cal $0,127421 ; Numbers whose decimal expansion is a concatenation of 2 consecutive increasing nonnegative numbers. sub $0,1 mov $1,$0
335.181818
3,459
0.914022
c4b9137b36c60b7c3f6644013e0e0d1937bfe9a4
229
asm
Assembly
libsrc/_DEVELOPMENT/adt/p_forward_list_alt/c/sccz80/p_forward_list_alt_back.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/_DEVELOPMENT/adt/p_forward_list_alt/c/sccz80/p_forward_list_alt_back.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/_DEVELOPMENT/adt/p_forward_list_alt/c/sccz80/p_forward_list_alt_back.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
; void *p_forward_list_alt_back(p_forward_list_alt_t *list) SECTION code_adt_p_forward_list_alt PUBLIC p_forward_list_alt_back p_forward_list_alt_back: INCLUDE "adt/p_forward_list_alt/z80/asm_p_forward_list_alt_back.asm"
20.818182
71
0.864629
f2461fee9cce17464fdc2af26feefda0d2107cc9
1,820
asm
Assembly
ch12/LossOfPrecision.asm
William0Friend/my_masm
e8073266c03c01424ad84b9ed9cf13e9da1eabb1
[ "Apache-2.0" ]
null
null
null
ch12/LossOfPrecision.asm
William0Friend/my_masm
e8073266c03c01424ad84b9ed9cf13e9da1eabb1
[ "Apache-2.0" ]
null
null
null
ch12/LossOfPrecision.asm
William0Friend/my_masm
e8073266c03c01424ad84b9ed9cf13e9da1eabb1
[ "Apache-2.0" ]
null
null
null
; Floating-Point PrecisionLoss (LossOfPrecision.asm) ; This program demonstrates a simple rounding error in ; often encountered in floating-point operations. Also, the ; program shows how to compare real numbers by examining the ; epsilon (absolute value of the difference) between the numbers. INCLUDE Irvine32.inc INCLUDE macros.inc .code main PROC finit call show_rounding_error call comparing_reals exit main ENDP ;------------------------------------------ show_rounding_error PROC ;------------------------------------------ .data val1 REAL8 2.0 result REAL8 ? .code ; multiply sqrt(2.0) * sqrt(2.0) fld val1 ; load val1 onto stack fsqrt ; calculate its square root call ShowFPUStack fmul ST(0),ST(0) ; st(0) contains the product, call ShowFPUStack ; which appears to equal 2.0 ; subtract 2.0 from ST(0) fsub val1 call ShowFPUStack fst result ; Result should be 0.0, but it really equals +4.4408921E-016 ret show_rounding_error ENDP ;----------------------------------------------------------- comparing_reals PROC ; ; Proper way to compare to reals for equality by subtracting ; them from each other and examining the remainder. ;----------------------------------------------------------- .data epsilon REAL8 1.0E-12 val2 REAL8 0.0 val3 REAL8 1.001E-13 ; equal to val2 ;val3 REAL8 1.001E-12 ; not equal to val2 .code ; if( val2 == val3 ), display "equal". ; method: ; if( abs(val2 - val3) < epsilon ), the values are equal. fld epsilon ; ST(0) = epsilon fld val2 ; ST(0) = val2 fsub val3 ; ST(0) = val2 - val3 call ShowFPUStack fabs ; ST(0) = ABS(ST(0)) fcomi ST(0),ST(1) ja skip mWrite <"equal",0dh,0ah> skip: ret comparing_reals ENDP END main
23.636364
66
0.597802
72e0b7d123b06e6a13a036224f1cea7866fba992
1,568
asm
Assembly
ch07/test7.asm
zzb610/asm-learn
d8a603347d608eb448dd605941376d6b763ee917
[ "MIT" ]
null
null
null
ch07/test7.asm
zzb610/asm-learn
d8a603347d608eb448dd605941376d6b763ee917
[ "MIT" ]
null
null
null
ch07/test7.asm
zzb610/asm-learn
d8a603347d608eb448dd605941376d6b763ee917
[ "MIT" ]
null
null
null
assume cs:codesg, ds:data data segment db '1975', '1976', '1977', '1978', '1979', '1980', '1981', '1982', '1983' db '1984', '1985', '1986', '1987', '1988', '1989', '1990', '1991', '1992' db '1993', '1944', '1995' ; dd 16, 22, 382, 1356, 2390, 8000, 16000, 24486, 50065, 97479, 140417, 197514 dd 345980, 590827, 803530, 11830000, 1843000, 2759000, 3753000, 4649000, 5937000 ; dw 3, 7, 9, 13, 28, 38, 130, 220, 476, 778, 1001, 1442, 2258, 2793, 4037, 5635, 8226 dw 11542, 14430, 15257, 17800 data ends table segment db 21 dup ('year summ ne ?? ') table ends stacksg segment dw 8 dup (0) stacksg ends codesg segment start: mov ax, data mov ds, ax mov ax, table mov es, ax mov ax, stacksg mov ss, ax mov sp, 16 mov cx, 21 mov bx, 0 mov si, 0 mov di, 0 s: ; year mov ax, ds:[0 + si] mov es:[bx + 0], ax mov ax, ds:[2 + si] mov es:[bx + 2], ax ; income mov ax, ds:[84 + si] mov es:[bx + 5], ax mov ax, ds:[86 + si] mov es:[bx + 7], ax ; employee number mov ax, ds:[168 + di] mov es:[bx + 10], ax ; avg income mov ax, ds:[84 + si] mov dx, ds:[86 + si] push bx mov bx, ds:[168 + di] div bx pop bx mov es:[bx + 13], ax add di, 2 add si, 4 add bx, 16 loop s mov ax, 4c00h int 21h codesg ends end start
21.479452
88
0.477041
711539205957767f59dba72633ae26d3e20b9992
464
asm
Assembly
oeis/062/A062111.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/062/A062111.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/062/A062111.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A062111: Upper-right triangle resulting from binomial transform calculation for nonnegative integers. ; Submitted by Christian Krause ; 0,1,1,4,3,2,12,8,5,3,32,20,12,7,4,80,48,28,16,9,5,192,112,64,36,20,11,6,448,256,144,80,44,24,13,7,1024,576,320,176,96,52,28,15,8,2304,1280,704,384,208,112,60,32,17,9,5120,2816,1536,832,448,240,128,68,36,19,10 lpb $0 add $1,1 sub $0,$1 mov $2,$1 sub $2,$0 lpe add $1,$0 mov $0,2 pow $0,$2 mul $1,$0 mov $0,$1 div $0,2
27.294118
210
0.676724
74a8b2c3facbd5f0e85c65b13199b747bbe16be8
831
asm
Assembly
programs/oeis/026/A026121.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/026/A026121.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/026/A026121.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A026121: a(n) = 3^n*(3^n-1)/2. ; 0,3,36,351,3240,29403,265356,2390391,21520080,193700403,1743362676,15690441231,141214502520,1270932117003,11438393835996,102945558872871,926510072902560,8338590785263203,75047317454789316,675425858255365311,6078832727785072200,54709494560526003003,492385451076115086636,4431469059779178958551,39883221538295040163440,358948993845502650080403,3230540944612065716551956,29074868501516217046452591,261673816513668830210528280,2355064348623088102272119403,21195579137607998811581169276,190760212238472606977626807431,1716841910146255315818830118720,15451577191316303401430037624003,139064194721846747290052038282596,1251577752496620775642013443543071,11264199772469587130872756288886760,101377797952226284628138712490978203,912400181570036563004100130091795916 mov $1,3 pow $1,$0 bin $1,2 mov $0,$1
103.875
758
0.906137
9f8b506b340886b7f035ca66dcc2f0c05407016c
612
asm
Assembly
programs/oeis/001/A001725.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/001/A001725.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/001/A001725.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A001725: a(n) = n!/5!. ; 1,6,42,336,3024,30240,332640,3991680,51891840,726485760,10897286400,174356582400,2964061900800,53353114214400,1013709170073600,20274183401472000,425757851430912000,9366672731480064000,215433472824041472000,5170403347776995328000,129260083694424883200000,3360762176055046963200000,90740578753486268006400000,2540736205097615504179200000,73681349947830849621196800000,2210440498434925488635904000000,68523655451482690147713024000000,2192756974447446084726816768000000,72360980156765720795984953344000000 add $0,5 mov $1,1 lpb $0 mul $1,$0 sub $0,1 lpe mul $1,8 div $1,960 mov $0,$1
47.076923
503
0.862745
3aec800a8a3f3a2dd78a5fa8312f953580677656
789
asm
Assembly
asm/6502/tools/xex_loader.asm
fcatrin/clc88
2af19c3c72ffbbb67eedc347080579acac2c5594
[ "MIT" ]
6
2019-04-23T03:32:29.000Z
2021-05-03T22:24:05.000Z
asm/6502/tools/xex_loader.asm
fcatrin/clc88
2af19c3c72ffbbb67eedc347080579acac2c5594
[ "MIT" ]
1
2019-06-16T16:21:54.000Z
2019-06-16T16:21:54.000Z
asm/6502/tools/xex_loader.asm
fcatrin/clc88
2af19c3c72ffbbb67eedc347080579acac2c5594
[ "MIT" ]
3
2019-04-23T03:32:35.000Z
2021-04-20T22:53:11.000Z
icl '../os/symbols.asm' block_start = $C8 ; ROS0 block_end = $CA ; ROS2 org BOOTADDR .proc xex_load jsr serial_init next_block: jsr xex_get_byte sta block_start jsr xex_get_byte sta block_start+1 and block_start cmp #$ff beq next_block jsr xex_get_byte sta block_end jsr xex_get_byte sta block_end+1 next_byte: jsr xex_get_byte ldy #0 sta (block_start), y cpw block_start block_end beq block_complete inw block_start jmp next_byte block_complete: cpw #EXECADDR+1 block_end bne next_block jsr xex_exec jmp next_block .endp .proc xex_get_byte jsr serial_get bpl no_eof pla pla no_eof: rts .endp .proc xex_exec jmp (EXECADDR) .endp icl '../os/serial.asm'
14.089286
28
0.662864
dea18a90c539338deba7ea5969ba9aaa8b4522a1
219
asm
Assembly
src/kernel/entry.asm
basic60/Bridge
3fcbd0523053c6c7c4dd7c98ce1a2c51ad4d7518
[ "MIT" ]
null
null
null
src/kernel/entry.asm
basic60/Bridge
3fcbd0523053c6c7c4dd7c98ce1a2c51ad4d7518
[ "MIT" ]
null
null
null
src/kernel/entry.asm
basic60/Bridge
3fcbd0523053c6c7c4dd7c98ce1a2c51ad4d7518
[ "MIT" ]
1
2020-09-21T11:04:44.000Z
2020-09-21T11:04:44.000Z
[BITS 64] section .text [GLOBAL _start] [EXTERN _init] [EXTERN kernel_entry] _start: mov rsp, STACK_TOP call _init call kernel_entry hlt section .bss stack: resb 32768 ; 内核栈 STACK_TOP equ $-1
12.882353
25
0.671233
b50775c19e52226be99f659742e83d5e4f9d451a
3,717
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1468.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1468.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1468.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 %r10 push %r11 push %r12 push %r14 push %r8 push %r9 // Faulty Load lea addresses_UC+0xf6e3, %r10 nop nop and $38238, %r9 movups (%r10), %xmm7 vpextrq $0, %xmm7, %r14 lea oracles, %r11 and $0xff, %r14 shlq $12, %r14 mov (%r11,%r14,1), %r14 pop %r9 pop %r8 pop %r14 pop %r12 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_UC', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'} [Faulty Load] {'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_UC', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'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 */
86.44186
2,999
0.663438
b0e9df813e5c55f9d3b8db54e6af0a5dcc0ad62e
496
asm
Assembly
dev/display/lcd/font-r3.asm
minblock/msdos
479ffd237d9bb7cc83cb06361db2c4ef42dfbac0
[ "Apache-2.0" ]
null
null
null
dev/display/lcd/font-r3.asm
minblock/msdos
479ffd237d9bb7cc83cb06361db2c4ef42dfbac0
[ "Apache-2.0" ]
null
null
null
dev/display/lcd/font-r3.asm
minblock/msdos
479ffd237d9bb7cc83cb06361db2c4ef42dfbac0
[ "Apache-2.0" ]
null
null
null
;/* ; * Microsoft Confidential ; * Copyright (C) Microsoft Corporation 1991 ; * All Rights Reserved. ; */ CODE SEGMENT BYTE PUBLIC 'CODE' ASSUME CS:CODE,DS:CODE BEGIN: ORG 0 FNTHEAD:DB 0FFH,"FONT " ;FILE TAG DB 8 DUP(0) ;RESERVED DW 1 ;CNT OF POINTERS IN HEADER DB 1 ;TYPE FOR INFO POINTER DW OFFSET INFO,0 ;POINTER TO INFO IN FILE INFO: DW 5 ;COUNT OF ENTRIES CODE ENDS END 
24.8
65
0.548387
4b6e4069931d980b43599fcfcb8cd4f154e1a35f
572
asm
Assembly
lc4programs/simple2.asm
ArmaanT/yallc
9de5bf51025221454212410c14bae02b7b7dd5f3
[ "MIT" ]
2
2020-12-17T17:27:06.000Z
2020-12-18T18:44:43.000Z
lc4programs/simple2.asm
ArmaanT/yallc
9de5bf51025221454212410c14bae02b7b7dd5f3
[ "MIT" ]
null
null
null
lc4programs/simple2.asm
ArmaanT/yallc
9de5bf51025221454212410c14bae02b7b7dd5f3
[ "MIT" ]
null
null
null
;; Expected: 1 main ADD R6, R6, #-3 STR R7, R6, #1 STR R5, R6, #0 ADD R5, R6, #0 CONST R0, #88 HICONST R0, #27 ADD R6, R6, #-1 STR R0, R6, #0 CONST R0, #190 HICONST R0, #252 ADD R6, R6, #-1 STR R0, R6, #0 LDR R0, R6, #0 LDR R1, R6, #1 CMP R0, R1 BRn main_test_simple2_j_cmp_true_0 CONST R0, #0 STR R0, R6, #1 BRnzp main_test_simple2_j_cmp_end_0 main_test_simple2_j_cmp_true_0 CONST R0, #1 STR R0, R6, #1 main_test_simple2_j_cmp_end_0 ADD R6, R6, #1 LDR R7, R6, #0 STR R7, R5, #2 ADD R6, R5, #0 LDR R5, R6, #0 LDR R7, R6, #1 ADD R6, R6, #3 RET
16.823529
36
0.627622
c283989a64f5cd91f3b3d21341c020b2132b352f
1,050
asm
Assembly
programs/oeis/100/A100163.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/100/A100163.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/100/A100163.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A100163: Structured disdyakis dodecahedral numbers (vertex structure 5). ; 1,26,119,324,685,1246,2051,3144,4569,6370,8591,11276,14469,18214,22555,27536,33201,39594,46759,54740,63581,73326,84019,95704,108425,122226,137151,153244,170549,189110,208971,230176,252769,276794,302295,329316,357901,388094,419939,453480,488761,525826,564719,605484,648165,692806,739451,788144,838929,891850,946951,1004276,1063869,1125774,1190035,1256696,1325801,1397394,1471519,1548220,1627541,1709526,1794219,1881664,1971905,2064986,2160951,2259844,2361709,2466590,2574531,2685576,2799769,2917154,3037775,3161676,3288901,3419494,3553499,3690960,3831921,3976426,4124519,4276244,4431645,4590766,4753651,4920344,5090889,5265330,5443711,5626076,5812469,6002934,6197515,6396256,6599201,6806394,7017879,7233700 mov $6,$0 lpb $0 add $2,$0 sub $0,1 add $1,5 add $2,$1 add $1,4 add $5,$2 lpe mov $1,$5 add $1,4 add $3,3 add $1,$3 add $1,2 mul $1,2 mov $2,$1 mov $1,2 add $5,1 mov $4,$5 mul $4,2 add $2,$4 add $1,$2 lpb $6 add $1,1 sub $6,1 lpe sub $1,21 mov $0,$1
32.8125
707
0.76381
858e078a66e606a2a0f3cdc3d3ffd4473598d028
439
asm
Assembly
oeis/071/A071790.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/071/A071790.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/071/A071790.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A071790: Decimal expansion of the second (of 10) decimal selvage numbers; the n-th digit of a decimal selvage number, x, is equal to the tenths digit of n*x. ; Submitted by Jon Maiga ; 2,4,7,9,2,4,7,9,2,4,7,9,2,4,7,9,2,4,7,9,2,4,7,9,1,4,6,9,1,4,6,9,1,4,6,9,1,4,6,9,1,4,6,9,1,4,6,9,1,3,6,8,1,3,6,8,1,3,6,8,1,3,6,8,1,3,6,8,1,3,6,8,0,3,5,8,0,3,5,8,0,3,5,8,0,3,5,8,0,3,5,8,0,3,5,8,0,2,5,7 mul $0,300 add $0,57 div $0,121 add $0,2 mod $0,10
43.9
201
0.617312
e57c835d535f61e7b3edda985e71cbc24a0eae95
339
asm
Assembly
programs/oeis/309/A309083.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/309/A309083.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/309/A309083.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A309083: a(n) = n - floor(n/2^4) + floor(n/3^4) - floor(n/4^4) + ... ; 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,60,61,62,63,64,65,66,67,68,69,70,71 add $0,1 mov $1,$0 mov $2,$0 div $2,16 sub $1,$2
37.666667
217
0.59292
c9abbcc61205c7c4999b7d462704de829a395d2c
507
asm
Assembly
oeis/118/A118445.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/118/A118445.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/118/A118445.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A118445: Number of tree-rooted maps of genus 1 with n edges: rooted maps on the torus with a distinguished spanning tree. ; Submitted by Jamie Morken(s3.) ; 1,25,490,8820,152460,2576574,42942900,709171320,11636856660,190068658780,3093732938296,50222937310000,813611584422000,13158602740363500,212528020730913000,3428785401125396400,55266606794455402500,890117467077758188500 add $0,1 mov $2,$0 seq $2,135389 ; Number of walks of length 2*n+2 from origin to (1,1) in a square lattice. mul $0,$2 div $0,24
50.7
219
0.800789
bf375e6cbd58dc4c9cd8b6ba3a891400f7d85537
8,251
asm
Assembly
Transynther/x86/_processed/NC/_zr_/i7-7700_9_0xca.log_16317_1009.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_0xca.log_16317_1009.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_0xca.log_16317_1009.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 %r15 push %r9 push %rbp push %rcx push %rdi push %rsi lea addresses_D_ht+0x37c, %rsi lea addresses_D_ht+0x1d09c, %rdi add $24096, %r9 mov $85, %rcx rep movsw nop nop nop nop nop and $32448, %r15 lea addresses_UC_ht+0x1469c, %r11 nop nop nop and $44946, %rbp movw $0x6162, (%r11) xor %rsi, %rsi lea addresses_WT_ht+0x9564, %rsi lea addresses_D_ht+0x3a9c, %rdi nop nop nop nop and %r12, %r12 mov $119, %rcx rep movsq nop xor $54145, %r15 lea addresses_normal_ht+0x152c, %rcx nop nop nop nop nop add %rbp, %rbp mov $0x6162636465666768, %rsi movq %rsi, (%rcx) nop lfence lea addresses_WT_ht+0x6e9c, %rsi lea addresses_WT_ht+0x1ee9c, %rdi nop nop nop sub $1113, %r9 mov $11, %rcx rep movsb nop nop nop nop inc %rsi lea addresses_D_ht+0xe59c, %r15 nop nop nop nop nop xor %rbp, %rbp mov (%r15), %r11w nop nop nop nop cmp $4237, %rbp lea addresses_A_ht+0x194d4, %rsi lea addresses_UC_ht+0xa29c, %rdi inc %r15 mov $106, %rcx rep movsw nop nop xor $55, %r15 lea addresses_WC_ht+0x25d0, %r12 and %r11, %r11 mov $0x6162636465666768, %rdi movq %rdi, (%r12) nop sub %rbp, %rbp lea addresses_A_ht+0xed9c, %rsi lea addresses_UC_ht+0x1cc6c, %rdi nop nop nop cmp $33618, %r15 mov $2, %rcx rep movsl dec %rsi lea addresses_A_ht+0x168f2, %rsi lea addresses_WC_ht+0x13d4, %rdi nop nop nop dec %r12 mov $46, %rcx rep movsl xor $41300, %rbp pop %rsi pop %rdi pop %rcx pop %rbp pop %r9 pop %r15 pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r10 push %r12 push %r15 push %r9 push %rbp push %rdx push %rsi // Store lea addresses_RW+0x1699c, %r9 nop and %rdx, %rdx movw $0x5152, (%r9) and $24260, %rdx // Store mov $0x29c, %r15 clflush (%r15) nop xor $25144, %rsi mov $0x5152535455565758, %rbp movq %rbp, %xmm2 vmovaps %ymm2, (%r15) cmp %rbp, %rbp // Store lea addresses_US+0x10214, %r9 nop nop nop nop cmp $14077, %rdx movl $0x51525354, (%r9) nop nop nop nop nop sub $56880, %r10 // Load mov $0xa9a210000000a9c, %rsi nop nop add %r12, %r12 mov (%rsi), %ebp add %r15, %r15 // Store mov $0xa9a210000000a9c, %r10 nop nop nop nop sub %r12, %r12 mov $0x5152535455565758, %rbp movq %rbp, %xmm6 vmovups %ymm6, (%r10) nop nop xor %rsi, %rsi // Load mov $0xc64, %rbp nop add %rdx, %rdx movb (%rbp), %r9b nop nop nop nop and %rbp, %rbp // Store lea addresses_WT+0x8010, %rdx nop dec %rsi movb $0x51, (%rdx) nop nop and %rbp, %rbp // Faulty Load mov $0xa9a210000000a9c, %rbp nop nop nop nop cmp $60633, %r12 vmovups (%rbp), %ymm0 vextracti128 $0, %ymm0, %xmm0 vpextrq $1, %xmm0, %r9 lea oracles, %r12 and $0xff, %r9 shlq $12, %r9 mov (%r12,%r9,1), %r9 pop %rsi pop %rdx pop %rbp pop %r9 pop %r15 pop %r12 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_NC'}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_RW'}} {'OP': 'STOR', 'dst': {'congruent': 10, 'AVXalign': True, 'same': False, 'size': 32, 'NT': True, 'type': 'addresses_P'}} {'OP': 'STOR', 'dst': {'congruent': 3, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_US'}} {'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 4, 'NT': False, 'type': 'addresses_NC'}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 32, 'NT': False, 'type': 'addresses_NC'}} {'src': {'congruent': 3, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_P'}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'congruent': 2, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_WT'}} [Faulty Load] {'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 32, 'NT': False, 'type': 'addresses_NC'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'congruent': 3, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'congruent': 7, 'same': True, 'type': 'addresses_D_ht'}} {'OP': 'STOR', 'dst': {'congruent': 10, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_UC_ht'}} {'src': {'congruent': 1, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 11, 'same': False, 'type': 'addresses_D_ht'}} {'OP': 'STOR', 'dst': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_normal_ht'}} {'src': {'congruent': 10, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 8, 'same': False, 'type': 'addresses_WT_ht'}} {'src': {'congruent': 7, 'AVXalign': False, 'same': False, 'size': 2, 'NT': True, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 3, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'congruent': 11, 'same': False, 'type': 'addresses_UC_ht'}} {'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 8, 'NT': False, 'type': 'addresses_WC_ht'}} {'src': {'congruent': 8, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'congruent': 4, 'same': False, 'type': 'addresses_UC_ht'}} {'src': {'congruent': 1, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'congruent': 2, 'same': False, 'type': 'addresses_WC_ht'}} {'00': 16317} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
32.612648
2,999
0.652163
e2da785779a79d5e0e71f72c5640e6127b8ba176
206
asm
Assembly
home/compare.asm
opiter09/ASM-Machina
75d8e457b3e82cc7a99b8e70ada643ab02863ada
[ "CC0-1.0" ]
1
2022-02-15T00:19:44.000Z
2022-02-15T00:19:44.000Z
home/compare.asm
opiter09/ASM-Machina
75d8e457b3e82cc7a99b8e70ada643ab02863ada
[ "CC0-1.0" ]
null
null
null
home/compare.asm
opiter09/ASM-Machina
75d8e457b3e82cc7a99b8e70ada643ab02863ada
[ "CC0-1.0" ]
null
null
null
; Compare strings, c bytes in length, at de and hl. ; Often used to compare big endian numbers in battle calculations. StringCmp:: ld a, [de] cp [hl] ret nz inc de inc hl dec c jr nz, StringCmp ret
17.166667
66
0.699029
e0fa71bb5ba8a4c19aa09247db29943eeec91257
565
nasm
Assembly
OvmfPkg/Library/XenHypercallLib/Ia32/hypercall.nasm
CEOALT1/RefindPlusUDK
116b957ad735f96fbb6d80a0ba582046960ba164
[ "BSD-2-Clause" ]
3,012
2015-01-01T19:58:18.000Z
2022-03-31T22:07:14.000Z
OvmfPkg/Library/XenHypercallLib/Ia32/hypercall.nasm
CEOALT1/RefindPlusUDK
116b957ad735f96fbb6d80a0ba582046960ba164
[ "BSD-2-Clause" ]
1,199
2015-01-12T08:00:01.000Z
2022-03-29T18:14:42.000Z
OvmfPkg/Library/XenHypercallLib/Ia32/hypercall.nasm
CEOALT1/RefindPlusUDK
116b957ad735f96fbb6d80a0ba582046960ba164
[ "BSD-2-Clause" ]
1,850
2015-01-01T11:28:12.000Z
2022-03-31T18:10:59.000Z
SECTION .text ; INTN ; EFIAPI ; __XenHypercall2 ( ; IN VOID *HypercallAddr, ; IN OUT INTN Arg1, ; IN OUT INTN Arg2 ; ); global ASM_PFX(__XenHypercall2) ASM_PFX(__XenHypercall2): ; Save only ebx, ecx is supposed to be a scratch register and needs to be ; saved by the caller push ebx ; Copy HypercallAddr to eax mov eax, [esp + 8] ; Copy Arg1 to the register expected by Xen mov ebx, [esp + 12] ; Copy Arg2 to the register expected by Xen mov ecx, [esp + 16] ; Call HypercallAddr call eax pop ebx ret
21.730769
76
0.646018
f9d64fb6a73213565d62f38f16f6d883f13a3312
670
asm
Assembly
programs/oeis/139/A139185.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/139/A139185.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/139/A139185.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A139185: a(n) = (n! - 10)/10. ; 11,71,503,4031,36287,362879,3991679,47900159,622702079,8717829119,130767436799,2092278988799,35568742809599,640237370572799,12164510040883199,243290200817663999,5109094217170943999,112400072777760767999,2585201673888497663999,62044840173323943935999,1551121004333098598399999,40329146112660563558399999,1088886945041835216076799999,30488834461171386050150399999,884176199373970195454361599999,26525285981219105863630847999999,822283865417792281772556287999999,26313083693369353016721801215999999,868331761881188649551819440127999999 add $0,5 mov $1,1 lpb $0 mul $1,$0 sub $0,1 lpe mul $1,8 sub $1,960 div $1,80 add $1,11 mov $0,$1
44.666667
534
0.856716
f20fd1d0ecf486ae4638d6c18a0f8e76f691f17b
532
asm
Assembly
oeis/053/A053644.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/053/A053644.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/053/A053644.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A053644: Most significant bit of n, msb(n); largest power of 2 less than or equal to n; write n in binary and change all but the first digit to zero. ; Submitted by Jon Maiga ; 0,1,2,2,4,4,4,4,8,8,8,8,8,8,8,8,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64 lpb $0 mov $1,2 pow $1,$0 gcd $1,$0 sub $0,$1 lpe mov $0,$1
44.333333
285
0.654135
724282337d1528456bc23c142d0a386f2351a184
322
asm
Assembly
mgblib/src/serial/SerialSendByte.asm
jbshelton/CGB_APU_Tester
c544685903a6eb163906667b4ae8d0157670c918
[ "MIT" ]
2
2020-09-12T14:22:37.000Z
2022-02-11T08:55:17.000Z
src/serial/SerialSendByte.asm
mattcurrie/mgblib
1d9045a4b4cbd1ec5223e672a1cef965e9fcd194
[ "MIT" ]
null
null
null
src/serial/SerialSendByte.asm
mattcurrie/mgblib
1d9045a4b4cbd1ec5223e672a1cef965e9fcd194
[ "MIT" ]
null
null
null
IF !DEF(INC_SerialSendByte) INC_SerialSendByte = 1 ; Send a byte over the serial connection as master. ; Waits until the send has completed. ; ; @param a the value to send ; @destroys af SerialSendByte:: ldh [rSB], a ld a, $81 ldh [rSC],a .loop: ldh a, [rSC] bit 7, a jr nz, .loop ret ENDC
16.1
52
0.636646
bd71c7c6f71694e0590ed77fefddb4277184a88a
470
asm
Assembly
programs/oeis/027/A027005.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/027/A027005.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/027/A027005.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A027005: a(n) = T(2*n+1,n+2), T given by A026998. ; 1,19,101,370,1148,3278,8967,23993,63483,167040,438346,1148844,3009181,7879855,20631713,54016798,141420392,370246298,969320643,2537718005,6643835991,17393792844,45537545686,119218847640,312119000953,817138159243,2139295481117,5600748288778,14662949390228,38388099887270,100501350277311,263115950950769,688846502581491,1803423556800600,4721424167827618 mul $0,2 cal $0,27963 ; T(n,n+3), T given by A027960. mov $1,$0
67.142857
352
0.817021
cc23dcdb1242242647bd176f635564a1a8151c02
6,070
asm
Assembly
Transynther/x86/_processed/NONE/_zr_/i3-7100_9_0x84_notsx.log_66_745.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_zr_/i3-7100_9_0x84_notsx.log_66_745.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_zr_/i3-7100_9_0x84_notsx.log_66_745.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 %r14 push %r15 push %rcx push %rdi push %rdx push %rsi lea addresses_WT_ht+0x7ff0, %rcx nop nop sub $5676, %r15 movl $0x61626364, (%rcx) nop nop nop cmp %r14, %r14 lea addresses_WT_ht+0xebb0, %rsi lea addresses_normal_ht+0x19f90, %rdi nop nop nop nop nop and $57413, %r11 mov $92, %rcx rep movsl nop sub %rsi, %rsi lea addresses_WT_ht+0xffb0, %r11 cmp $37834, %rdx mov (%r11), %edi nop nop nop nop sub $35458, %rsi lea addresses_normal_ht+0x10520, %rsi lea addresses_WT_ht+0x1a6b3, %rdi nop nop nop nop cmp $38103, %r12 mov $114, %rcx rep movsb nop nop nop nop nop lfence lea addresses_D_ht+0x10850, %rsi lea addresses_WC_ht+0x13710, %rdi nop nop nop nop nop add %rdx, %rdx mov $63, %rcx rep movsb nop nop nop nop nop mfence lea addresses_normal_ht+0x1b3c8, %rdx clflush (%rdx) nop nop nop nop nop add $51453, %r14 mov (%rdx), %r15 nop nop nop nop nop inc %r15 lea addresses_UC_ht+0xaf10, %rsi nop dec %r14 mov (%rsi), %ecx nop xor $40127, %rcx lea addresses_A_ht+0x17e10, %rdi nop nop dec %r11 movl $0x61626364, (%rdi) nop nop add $56789, %r14 lea addresses_WC_ht+0x11910, %r11 nop nop cmp $46956, %rsi mov $0x6162636465666768, %rcx movq %rcx, %xmm4 vmovups %ymm4, (%r11) nop nop and %r12, %r12 lea addresses_UC_ht+0xaa90, %rsi lea addresses_WC_ht+0x76ec, %rdi nop nop nop nop nop sub $44925, %r11 mov $41, %rcx rep movsq nop nop nop nop nop sub %r15, %r15 lea addresses_WT_ht+0x1b310, %rsi lea addresses_UC_ht+0x17686, %rdi nop nop nop nop nop cmp $65423, %r11 mov $65, %rcx rep movsb nop sub $29412, %rcx lea addresses_normal_ht+0x1c7e0, %rsi lea addresses_A_ht+0x10110, %rdi clflush (%rdi) nop nop nop nop nop add $2146, %r15 mov $117, %rcx rep movsb add %r15, %r15 lea addresses_WC_ht+0x1c9ca, %r12 nop nop nop nop nop xor $27559, %r14 movups (%r12), %xmm5 vpextrq $0, %xmm5, %r11 nop add $19959, %r15 lea addresses_normal_ht+0x10808, %r15 nop nop cmp $11617, %rcx movups (%r15), %xmm4 vpextrq $0, %xmm4, %r14 nop nop nop nop inc %r11 pop %rsi pop %rdx pop %rdi pop %rcx pop %r15 pop %r14 pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %rax push %rbp push %rcx push %rdi push %rdx // Load lea addresses_US+0x1a510, %rdx add $18080, %rbp mov (%rdx), %rcx nop nop and $39770, %rcx // Load lea addresses_A+0x6b70, %r11 nop xor $22946, %rdi mov (%r11), %cx nop add $40288, %rax // Store mov $0x3d6, %rax clflush (%rax) nop nop and %r11, %r11 mov $0x5152535455565758, %rbp movq %rbp, %xmm2 movups %xmm2, (%rax) nop nop add %r11, %r11 // Store lea addresses_RW+0x9610, %r11 add %r12, %r12 movb $0x51, (%r11) xor $34013, %r12 // Store mov $0x124e810000000810, %r11 nop nop add $45013, %r12 mov $0x5152535455565758, %rdx movq %rdx, %xmm5 vmovups %ymm5, (%r11) nop nop nop xor %rcx, %rcx // Faulty Load lea addresses_A+0x13710, %rax nop nop nop sub %rdi, %rdi movb (%rax), %cl lea oracles, %rdi and $0xff, %rcx shlq $12, %rcx mov (%rdi,%rcx,1), %rcx pop %rdx pop %rdi pop %rcx pop %rbp pop %rax pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_A', 'same': False, 'size': 2, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_US', 'same': False, 'size': 8, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_A', 'same': False, 'size': 2, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_P', 'same': False, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_RW', 'same': False, 'size': 1, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_NC', 'same': False, 'size': 32, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} [Faulty Load] {'src': {'type': 'addresses_A', 'same': True, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 4, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_WT_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 4, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_D_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 8, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_UC_ht', 'same': False, 'size': 4, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 4, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_WC_ht', 'same': True, 'size': 32, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': True}, 'OP': 'REPM'} {'src': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_normal_ht', 'same': True, 'size': 16, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'00': 66} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
21.00346
197
0.650741
ffd2e3c4bcb85ba96a2a476da4e19058ece320a2
39,477
asm
Assembly
zombie.asm
TusharGupta01/XV6
d365413bcf8fbb190063548c0fa477dc57f2b98b
[ "MIT" ]
null
null
null
zombie.asm
TusharGupta01/XV6
d365413bcf8fbb190063548c0fa477dc57f2b98b
[ "MIT" ]
null
null
null
zombie.asm
TusharGupta01/XV6
d365413bcf8fbb190063548c0fa477dc57f2b98b
[ "MIT" ]
1
2018-03-14T14:09:08.000Z
2018-03-14T14:09:08.000Z
_zombie: file format elf32-i386 Disassembly of section .text: 00000000 <main>: #include "stat.h" #include "user.h" int main(void) { 0: 55 push %ebp 1: 89 e5 mov %esp,%ebp 3: 83 e4 f0 and $0xfffffff0,%esp 6: 83 ec 10 sub $0x10,%esp if(fork() > 0) 9: e8 75 02 00 00 call 283 <fork> e: 85 c0 test %eax,%eax 10: 7e 0c jle 1e <main+0x1e> sleep(5); // Let child exit before parent. 12: c7 04 24 05 00 00 00 movl $0x5,(%esp) 19: e8 fd 02 00 00 call 31b <sleep> exit(); 1e: e8 68 02 00 00 call 28b <exit> 00000023 <stosb>: "cc"); } static inline void stosb(void *addr, int data, int cnt) { 23: 55 push %ebp 24: 89 e5 mov %esp,%ebp 26: 57 push %edi 27: 53 push %ebx asm volatile("cld; rep stosb" : 28: 8b 4d 08 mov 0x8(%ebp),%ecx 2b: 8b 55 10 mov 0x10(%ebp),%edx 2e: 8b 45 0c mov 0xc(%ebp),%eax 31: 89 cb mov %ecx,%ebx 33: 89 df mov %ebx,%edi 35: 89 d1 mov %edx,%ecx 37: fc cld 38: f3 aa rep stos %al,%es:(%edi) 3a: 89 ca mov %ecx,%edx 3c: 89 fb mov %edi,%ebx 3e: 89 5d 08 mov %ebx,0x8(%ebp) 41: 89 55 10 mov %edx,0x10(%ebp) "=D" (addr), "=c" (cnt) : "0" (addr), "1" (cnt), "a" (data) : "memory", "cc"); } 44: 5b pop %ebx 45: 5f pop %edi 46: 5d pop %ebp 47: c3 ret 00000048 <strcpy>: #include "user.h" #include "x86.h" char* strcpy(char *s, char *t) { 48: 55 push %ebp 49: 89 e5 mov %esp,%ebp 4b: 83 ec 10 sub $0x10,%esp char *os; os = s; 4e: 8b 45 08 mov 0x8(%ebp),%eax 51: 89 45 fc mov %eax,-0x4(%ebp) while((*s++ = *t++) != 0) 54: 90 nop 55: 8b 45 08 mov 0x8(%ebp),%eax 58: 8d 50 01 lea 0x1(%eax),%edx 5b: 89 55 08 mov %edx,0x8(%ebp) 5e: 8b 55 0c mov 0xc(%ebp),%edx 61: 8d 4a 01 lea 0x1(%edx),%ecx 64: 89 4d 0c mov %ecx,0xc(%ebp) 67: 0f b6 12 movzbl (%edx),%edx 6a: 88 10 mov %dl,(%eax) 6c: 0f b6 00 movzbl (%eax),%eax 6f: 84 c0 test %al,%al 71: 75 e2 jne 55 <strcpy+0xd> ; return os; 73: 8b 45 fc mov -0x4(%ebp),%eax } 76: c9 leave 77: c3 ret 00000078 <strcmp>: int strcmp(const char *p, const char *q) { 78: 55 push %ebp 79: 89 e5 mov %esp,%ebp while(*p && *p == *q) 7b: eb 08 jmp 85 <strcmp+0xd> p++, q++; 7d: 83 45 08 01 addl $0x1,0x8(%ebp) 81: 83 45 0c 01 addl $0x1,0xc(%ebp) } int strcmp(const char *p, const char *q) { while(*p && *p == *q) 85: 8b 45 08 mov 0x8(%ebp),%eax 88: 0f b6 00 movzbl (%eax),%eax 8b: 84 c0 test %al,%al 8d: 74 10 je 9f <strcmp+0x27> 8f: 8b 45 08 mov 0x8(%ebp),%eax 92: 0f b6 10 movzbl (%eax),%edx 95: 8b 45 0c mov 0xc(%ebp),%eax 98: 0f b6 00 movzbl (%eax),%eax 9b: 38 c2 cmp %al,%dl 9d: 74 de je 7d <strcmp+0x5> p++, q++; return (uchar)*p - (uchar)*q; 9f: 8b 45 08 mov 0x8(%ebp),%eax a2: 0f b6 00 movzbl (%eax),%eax a5: 0f b6 d0 movzbl %al,%edx a8: 8b 45 0c mov 0xc(%ebp),%eax ab: 0f b6 00 movzbl (%eax),%eax ae: 0f b6 c0 movzbl %al,%eax b1: 29 c2 sub %eax,%edx b3: 89 d0 mov %edx,%eax } b5: 5d pop %ebp b6: c3 ret 000000b7 <strlen>: uint strlen(char *s) { b7: 55 push %ebp b8: 89 e5 mov %esp,%ebp ba: 83 ec 10 sub $0x10,%esp int n; for(n = 0; s[n]; n++) bd: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) c4: eb 04 jmp ca <strlen+0x13> c6: 83 45 fc 01 addl $0x1,-0x4(%ebp) ca: 8b 55 fc mov -0x4(%ebp),%edx cd: 8b 45 08 mov 0x8(%ebp),%eax d0: 01 d0 add %edx,%eax d2: 0f b6 00 movzbl (%eax),%eax d5: 84 c0 test %al,%al d7: 75 ed jne c6 <strlen+0xf> ; return n; d9: 8b 45 fc mov -0x4(%ebp),%eax } dc: c9 leave dd: c3 ret 000000de <memset>: void* memset(void *dst, int c, uint n) { de: 55 push %ebp df: 89 e5 mov %esp,%ebp e1: 83 ec 0c sub $0xc,%esp stosb(dst, c, n); e4: 8b 45 10 mov 0x10(%ebp),%eax e7: 89 44 24 08 mov %eax,0x8(%esp) eb: 8b 45 0c mov 0xc(%ebp),%eax ee: 89 44 24 04 mov %eax,0x4(%esp) f2: 8b 45 08 mov 0x8(%ebp),%eax f5: 89 04 24 mov %eax,(%esp) f8: e8 26 ff ff ff call 23 <stosb> return dst; fd: 8b 45 08 mov 0x8(%ebp),%eax } 100: c9 leave 101: c3 ret 00000102 <strchr>: char* strchr(const char *s, char c) { 102: 55 push %ebp 103: 89 e5 mov %esp,%ebp 105: 83 ec 04 sub $0x4,%esp 108: 8b 45 0c mov 0xc(%ebp),%eax 10b: 88 45 fc mov %al,-0x4(%ebp) for(; *s; s++) 10e: eb 14 jmp 124 <strchr+0x22> if(*s == c) 110: 8b 45 08 mov 0x8(%ebp),%eax 113: 0f b6 00 movzbl (%eax),%eax 116: 3a 45 fc cmp -0x4(%ebp),%al 119: 75 05 jne 120 <strchr+0x1e> return (char*)s; 11b: 8b 45 08 mov 0x8(%ebp),%eax 11e: eb 13 jmp 133 <strchr+0x31> } char* strchr(const char *s, char c) { for(; *s; s++) 120: 83 45 08 01 addl $0x1,0x8(%ebp) 124: 8b 45 08 mov 0x8(%ebp),%eax 127: 0f b6 00 movzbl (%eax),%eax 12a: 84 c0 test %al,%al 12c: 75 e2 jne 110 <strchr+0xe> if(*s == c) return (char*)s; return 0; 12e: b8 00 00 00 00 mov $0x0,%eax } 133: c9 leave 134: c3 ret 00000135 <gets>: char* gets(char *buf, int max) { 135: 55 push %ebp 136: 89 e5 mov %esp,%ebp 138: 83 ec 28 sub $0x28,%esp int i, cc; char c; for(i=0; i+1 < max; ){ 13b: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) 142: eb 4c jmp 190 <gets+0x5b> cc = read(0, &c, 1); 144: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 14b: 00 14c: 8d 45 ef lea -0x11(%ebp),%eax 14f: 89 44 24 04 mov %eax,0x4(%esp) 153: c7 04 24 00 00 00 00 movl $0x0,(%esp) 15a: e8 44 01 00 00 call 2a3 <read> 15f: 89 45 f0 mov %eax,-0x10(%ebp) if(cc < 1) 162: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 166: 7f 02 jg 16a <gets+0x35> break; 168: eb 31 jmp 19b <gets+0x66> buf[i++] = c; 16a: 8b 45 f4 mov -0xc(%ebp),%eax 16d: 8d 50 01 lea 0x1(%eax),%edx 170: 89 55 f4 mov %edx,-0xc(%ebp) 173: 89 c2 mov %eax,%edx 175: 8b 45 08 mov 0x8(%ebp),%eax 178: 01 c2 add %eax,%edx 17a: 0f b6 45 ef movzbl -0x11(%ebp),%eax 17e: 88 02 mov %al,(%edx) if(c == '\n' || c == '\r') 180: 0f b6 45 ef movzbl -0x11(%ebp),%eax 184: 3c 0a cmp $0xa,%al 186: 74 13 je 19b <gets+0x66> 188: 0f b6 45 ef movzbl -0x11(%ebp),%eax 18c: 3c 0d cmp $0xd,%al 18e: 74 0b je 19b <gets+0x66> gets(char *buf, int max) { int i, cc; char c; for(i=0; i+1 < max; ){ 190: 8b 45 f4 mov -0xc(%ebp),%eax 193: 83 c0 01 add $0x1,%eax 196: 3b 45 0c cmp 0xc(%ebp),%eax 199: 7c a9 jl 144 <gets+0xf> break; buf[i++] = c; if(c == '\n' || c == '\r') break; } buf[i] = '\0'; 19b: 8b 55 f4 mov -0xc(%ebp),%edx 19e: 8b 45 08 mov 0x8(%ebp),%eax 1a1: 01 d0 add %edx,%eax 1a3: c6 00 00 movb $0x0,(%eax) return buf; 1a6: 8b 45 08 mov 0x8(%ebp),%eax } 1a9: c9 leave 1aa: c3 ret 000001ab <stat>: int stat(char *n, struct stat *st) { 1ab: 55 push %ebp 1ac: 89 e5 mov %esp,%ebp 1ae: 83 ec 28 sub $0x28,%esp int fd; int r; fd = open(n, O_RDONLY); 1b1: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 1b8: 00 1b9: 8b 45 08 mov 0x8(%ebp),%eax 1bc: 89 04 24 mov %eax,(%esp) 1bf: e8 07 01 00 00 call 2cb <open> 1c4: 89 45 f4 mov %eax,-0xc(%ebp) if(fd < 0) 1c7: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 1cb: 79 07 jns 1d4 <stat+0x29> return -1; 1cd: b8 ff ff ff ff mov $0xffffffff,%eax 1d2: eb 23 jmp 1f7 <stat+0x4c> r = fstat(fd, st); 1d4: 8b 45 0c mov 0xc(%ebp),%eax 1d7: 89 44 24 04 mov %eax,0x4(%esp) 1db: 8b 45 f4 mov -0xc(%ebp),%eax 1de: 89 04 24 mov %eax,(%esp) 1e1: e8 fd 00 00 00 call 2e3 <fstat> 1e6: 89 45 f0 mov %eax,-0x10(%ebp) close(fd); 1e9: 8b 45 f4 mov -0xc(%ebp),%eax 1ec: 89 04 24 mov %eax,(%esp) 1ef: e8 bf 00 00 00 call 2b3 <close> return r; 1f4: 8b 45 f0 mov -0x10(%ebp),%eax } 1f7: c9 leave 1f8: c3 ret 000001f9 <atoi>: int atoi(const char *s) { 1f9: 55 push %ebp 1fa: 89 e5 mov %esp,%ebp 1fc: 83 ec 10 sub $0x10,%esp int n; n = 0; 1ff: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) while('0' <= *s && *s <= '9') 206: eb 25 jmp 22d <atoi+0x34> n = n*10 + *s++ - '0'; 208: 8b 55 fc mov -0x4(%ebp),%edx 20b: 89 d0 mov %edx,%eax 20d: c1 e0 02 shl $0x2,%eax 210: 01 d0 add %edx,%eax 212: 01 c0 add %eax,%eax 214: 89 c1 mov %eax,%ecx 216: 8b 45 08 mov 0x8(%ebp),%eax 219: 8d 50 01 lea 0x1(%eax),%edx 21c: 89 55 08 mov %edx,0x8(%ebp) 21f: 0f b6 00 movzbl (%eax),%eax 222: 0f be c0 movsbl %al,%eax 225: 01 c8 add %ecx,%eax 227: 83 e8 30 sub $0x30,%eax 22a: 89 45 fc mov %eax,-0x4(%ebp) atoi(const char *s) { int n; n = 0; while('0' <= *s && *s <= '9') 22d: 8b 45 08 mov 0x8(%ebp),%eax 230: 0f b6 00 movzbl (%eax),%eax 233: 3c 2f cmp $0x2f,%al 235: 7e 0a jle 241 <atoi+0x48> 237: 8b 45 08 mov 0x8(%ebp),%eax 23a: 0f b6 00 movzbl (%eax),%eax 23d: 3c 39 cmp $0x39,%al 23f: 7e c7 jle 208 <atoi+0xf> n = n*10 + *s++ - '0'; return n; 241: 8b 45 fc mov -0x4(%ebp),%eax } 244: c9 leave 245: c3 ret 00000246 <memmove>: void* memmove(void *vdst, void *vsrc, int n) { 246: 55 push %ebp 247: 89 e5 mov %esp,%ebp 249: 83 ec 10 sub $0x10,%esp char *dst, *src; dst = vdst; 24c: 8b 45 08 mov 0x8(%ebp),%eax 24f: 89 45 fc mov %eax,-0x4(%ebp) src = vsrc; 252: 8b 45 0c mov 0xc(%ebp),%eax 255: 89 45 f8 mov %eax,-0x8(%ebp) while(n-- > 0) 258: eb 17 jmp 271 <memmove+0x2b> *dst++ = *src++; 25a: 8b 45 fc mov -0x4(%ebp),%eax 25d: 8d 50 01 lea 0x1(%eax),%edx 260: 89 55 fc mov %edx,-0x4(%ebp) 263: 8b 55 f8 mov -0x8(%ebp),%edx 266: 8d 4a 01 lea 0x1(%edx),%ecx 269: 89 4d f8 mov %ecx,-0x8(%ebp) 26c: 0f b6 12 movzbl (%edx),%edx 26f: 88 10 mov %dl,(%eax) { char *dst, *src; dst = vdst; src = vsrc; while(n-- > 0) 271: 8b 45 10 mov 0x10(%ebp),%eax 274: 8d 50 ff lea -0x1(%eax),%edx 277: 89 55 10 mov %edx,0x10(%ebp) 27a: 85 c0 test %eax,%eax 27c: 7f dc jg 25a <memmove+0x14> *dst++ = *src++; return vdst; 27e: 8b 45 08 mov 0x8(%ebp),%eax } 281: c9 leave 282: c3 ret 00000283 <fork>: name: \ movl $SYS_ ## name, %eax; \ int $T_SYSCALL; \ ret SYSCALL(fork) 283: b8 01 00 00 00 mov $0x1,%eax 288: cd 40 int $0x40 28a: c3 ret 0000028b <exit>: SYSCALL(exit) 28b: b8 02 00 00 00 mov $0x2,%eax 290: cd 40 int $0x40 292: c3 ret 00000293 <wait>: SYSCALL(wait) 293: b8 03 00 00 00 mov $0x3,%eax 298: cd 40 int $0x40 29a: c3 ret 0000029b <pipe>: SYSCALL(pipe) 29b: b8 04 00 00 00 mov $0x4,%eax 2a0: cd 40 int $0x40 2a2: c3 ret 000002a3 <read>: SYSCALL(read) 2a3: b8 05 00 00 00 mov $0x5,%eax 2a8: cd 40 int $0x40 2aa: c3 ret 000002ab <write>: SYSCALL(write) 2ab: b8 10 00 00 00 mov $0x10,%eax 2b0: cd 40 int $0x40 2b2: c3 ret 000002b3 <close>: SYSCALL(close) 2b3: b8 15 00 00 00 mov $0x15,%eax 2b8: cd 40 int $0x40 2ba: c3 ret 000002bb <kill>: SYSCALL(kill) 2bb: b8 06 00 00 00 mov $0x6,%eax 2c0: cd 40 int $0x40 2c2: c3 ret 000002c3 <exec>: SYSCALL(exec) 2c3: b8 07 00 00 00 mov $0x7,%eax 2c8: cd 40 int $0x40 2ca: c3 ret 000002cb <open>: SYSCALL(open) 2cb: b8 0f 00 00 00 mov $0xf,%eax 2d0: cd 40 int $0x40 2d2: c3 ret 000002d3 <mknod>: SYSCALL(mknod) 2d3: b8 11 00 00 00 mov $0x11,%eax 2d8: cd 40 int $0x40 2da: c3 ret 000002db <unlink>: SYSCALL(unlink) 2db: b8 12 00 00 00 mov $0x12,%eax 2e0: cd 40 int $0x40 2e2: c3 ret 000002e3 <fstat>: SYSCALL(fstat) 2e3: b8 08 00 00 00 mov $0x8,%eax 2e8: cd 40 int $0x40 2ea: c3 ret 000002eb <link>: SYSCALL(link) 2eb: b8 13 00 00 00 mov $0x13,%eax 2f0: cd 40 int $0x40 2f2: c3 ret 000002f3 <mkdir>: SYSCALL(mkdir) 2f3: b8 14 00 00 00 mov $0x14,%eax 2f8: cd 40 int $0x40 2fa: c3 ret 000002fb <chdir>: SYSCALL(chdir) 2fb: b8 09 00 00 00 mov $0x9,%eax 300: cd 40 int $0x40 302: c3 ret 00000303 <dup>: SYSCALL(dup) 303: b8 0a 00 00 00 mov $0xa,%eax 308: cd 40 int $0x40 30a: c3 ret 0000030b <getpid>: SYSCALL(getpid) 30b: b8 0b 00 00 00 mov $0xb,%eax 310: cd 40 int $0x40 312: c3 ret 00000313 <sbrk>: SYSCALL(sbrk) 313: b8 0c 00 00 00 mov $0xc,%eax 318: cd 40 int $0x40 31a: c3 ret 0000031b <sleep>: SYSCALL(sleep) 31b: b8 0d 00 00 00 mov $0xd,%eax 320: cd 40 int $0x40 322: c3 ret 00000323 <uptime>: SYSCALL(uptime) 323: b8 0e 00 00 00 mov $0xe,%eax 328: cd 40 int $0x40 32a: c3 ret 0000032b <getcwd>: SYSCALL(getcwd) 32b: b8 16 00 00 00 mov $0x16,%eax 330: cd 40 int $0x40 332: c3 ret 00000333 <putc>: #include "stat.h" #include "user.h" static void putc(int fd, char c) { 333: 55 push %ebp 334: 89 e5 mov %esp,%ebp 336: 83 ec 18 sub $0x18,%esp 339: 8b 45 0c mov 0xc(%ebp),%eax 33c: 88 45 f4 mov %al,-0xc(%ebp) write(fd, &c, 1); 33f: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 346: 00 347: 8d 45 f4 lea -0xc(%ebp),%eax 34a: 89 44 24 04 mov %eax,0x4(%esp) 34e: 8b 45 08 mov 0x8(%ebp),%eax 351: 89 04 24 mov %eax,(%esp) 354: e8 52 ff ff ff call 2ab <write> } 359: c9 leave 35a: c3 ret 0000035b <printint>: static void printint(int fd, int xx, int base, int sgn) { 35b: 55 push %ebp 35c: 89 e5 mov %esp,%ebp 35e: 56 push %esi 35f: 53 push %ebx 360: 83 ec 30 sub $0x30,%esp static char digits[] = "0123456789ABCDEF"; char buf[16]; int i, neg; uint x; neg = 0; 363: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) if(sgn && xx < 0){ 36a: 83 7d 14 00 cmpl $0x0,0x14(%ebp) 36e: 74 17 je 387 <printint+0x2c> 370: 83 7d 0c 00 cmpl $0x0,0xc(%ebp) 374: 79 11 jns 387 <printint+0x2c> neg = 1; 376: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp) x = -xx; 37d: 8b 45 0c mov 0xc(%ebp),%eax 380: f7 d8 neg %eax 382: 89 45 ec mov %eax,-0x14(%ebp) 385: eb 06 jmp 38d <printint+0x32> } else { x = xx; 387: 8b 45 0c mov 0xc(%ebp),%eax 38a: 89 45 ec mov %eax,-0x14(%ebp) } i = 0; 38d: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) do{ buf[i++] = digits[x % base]; 394: 8b 4d f4 mov -0xc(%ebp),%ecx 397: 8d 41 01 lea 0x1(%ecx),%eax 39a: 89 45 f4 mov %eax,-0xc(%ebp) 39d: 8b 5d 10 mov 0x10(%ebp),%ebx 3a0: 8b 45 ec mov -0x14(%ebp),%eax 3a3: ba 00 00 00 00 mov $0x0,%edx 3a8: f7 f3 div %ebx 3aa: 89 d0 mov %edx,%eax 3ac: 0f b6 80 2c 0a 00 00 movzbl 0xa2c(%eax),%eax 3b3: 88 44 0d dc mov %al,-0x24(%ebp,%ecx,1) }while((x /= base) != 0); 3b7: 8b 75 10 mov 0x10(%ebp),%esi 3ba: 8b 45 ec mov -0x14(%ebp),%eax 3bd: ba 00 00 00 00 mov $0x0,%edx 3c2: f7 f6 div %esi 3c4: 89 45 ec mov %eax,-0x14(%ebp) 3c7: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 3cb: 75 c7 jne 394 <printint+0x39> if(neg) 3cd: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 3d1: 74 10 je 3e3 <printint+0x88> buf[i++] = '-'; 3d3: 8b 45 f4 mov -0xc(%ebp),%eax 3d6: 8d 50 01 lea 0x1(%eax),%edx 3d9: 89 55 f4 mov %edx,-0xc(%ebp) 3dc: c6 44 05 dc 2d movb $0x2d,-0x24(%ebp,%eax,1) while(--i >= 0) 3e1: eb 1f jmp 402 <printint+0xa7> 3e3: eb 1d jmp 402 <printint+0xa7> putc(fd, buf[i]); 3e5: 8d 55 dc lea -0x24(%ebp),%edx 3e8: 8b 45 f4 mov -0xc(%ebp),%eax 3eb: 01 d0 add %edx,%eax 3ed: 0f b6 00 movzbl (%eax),%eax 3f0: 0f be c0 movsbl %al,%eax 3f3: 89 44 24 04 mov %eax,0x4(%esp) 3f7: 8b 45 08 mov 0x8(%ebp),%eax 3fa: 89 04 24 mov %eax,(%esp) 3fd: e8 31 ff ff ff call 333 <putc> buf[i++] = digits[x % base]; }while((x /= base) != 0); if(neg) buf[i++] = '-'; while(--i >= 0) 402: 83 6d f4 01 subl $0x1,-0xc(%ebp) 406: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 40a: 79 d9 jns 3e5 <printint+0x8a> putc(fd, buf[i]); } 40c: 83 c4 30 add $0x30,%esp 40f: 5b pop %ebx 410: 5e pop %esi 411: 5d pop %ebp 412: c3 ret 00000413 <printf>: // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, char *fmt, ...) { 413: 55 push %ebp 414: 89 e5 mov %esp,%ebp 416: 83 ec 38 sub $0x38,%esp char *s; int c, i, state; uint *ap; state = 0; 419: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) ap = (uint*)(void*)&fmt + 1; 420: 8d 45 0c lea 0xc(%ebp),%eax 423: 83 c0 04 add $0x4,%eax 426: 89 45 e8 mov %eax,-0x18(%ebp) for(i = 0; fmt[i]; i++){ 429: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) 430: e9 7c 01 00 00 jmp 5b1 <printf+0x19e> c = fmt[i] & 0xff; 435: 8b 55 0c mov 0xc(%ebp),%edx 438: 8b 45 f0 mov -0x10(%ebp),%eax 43b: 01 d0 add %edx,%eax 43d: 0f b6 00 movzbl (%eax),%eax 440: 0f be c0 movsbl %al,%eax 443: 25 ff 00 00 00 and $0xff,%eax 448: 89 45 e4 mov %eax,-0x1c(%ebp) if(state == 0){ 44b: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 44f: 75 2c jne 47d <printf+0x6a> if(c == '%'){ 451: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp) 455: 75 0c jne 463 <printf+0x50> state = '%'; 457: c7 45 ec 25 00 00 00 movl $0x25,-0x14(%ebp) 45e: e9 4a 01 00 00 jmp 5ad <printf+0x19a> } else { putc(fd, c); 463: 8b 45 e4 mov -0x1c(%ebp),%eax 466: 0f be c0 movsbl %al,%eax 469: 89 44 24 04 mov %eax,0x4(%esp) 46d: 8b 45 08 mov 0x8(%ebp),%eax 470: 89 04 24 mov %eax,(%esp) 473: e8 bb fe ff ff call 333 <putc> 478: e9 30 01 00 00 jmp 5ad <printf+0x19a> } } else if(state == '%'){ 47d: 83 7d ec 25 cmpl $0x25,-0x14(%ebp) 481: 0f 85 26 01 00 00 jne 5ad <printf+0x19a> if(c == 'd'){ 487: 83 7d e4 64 cmpl $0x64,-0x1c(%ebp) 48b: 75 2d jne 4ba <printf+0xa7> printint(fd, *ap, 10, 1); 48d: 8b 45 e8 mov -0x18(%ebp),%eax 490: 8b 00 mov (%eax),%eax 492: c7 44 24 0c 01 00 00 movl $0x1,0xc(%esp) 499: 00 49a: c7 44 24 08 0a 00 00 movl $0xa,0x8(%esp) 4a1: 00 4a2: 89 44 24 04 mov %eax,0x4(%esp) 4a6: 8b 45 08 mov 0x8(%ebp),%eax 4a9: 89 04 24 mov %eax,(%esp) 4ac: e8 aa fe ff ff call 35b <printint> ap++; 4b1: 83 45 e8 04 addl $0x4,-0x18(%ebp) 4b5: e9 ec 00 00 00 jmp 5a6 <printf+0x193> } else if(c == 'x' || c == 'p'){ 4ba: 83 7d e4 78 cmpl $0x78,-0x1c(%ebp) 4be: 74 06 je 4c6 <printf+0xb3> 4c0: 83 7d e4 70 cmpl $0x70,-0x1c(%ebp) 4c4: 75 2d jne 4f3 <printf+0xe0> printint(fd, *ap, 16, 0); 4c6: 8b 45 e8 mov -0x18(%ebp),%eax 4c9: 8b 00 mov (%eax),%eax 4cb: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp) 4d2: 00 4d3: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp) 4da: 00 4db: 89 44 24 04 mov %eax,0x4(%esp) 4df: 8b 45 08 mov 0x8(%ebp),%eax 4e2: 89 04 24 mov %eax,(%esp) 4e5: e8 71 fe ff ff call 35b <printint> ap++; 4ea: 83 45 e8 04 addl $0x4,-0x18(%ebp) 4ee: e9 b3 00 00 00 jmp 5a6 <printf+0x193> } else if(c == 's'){ 4f3: 83 7d e4 73 cmpl $0x73,-0x1c(%ebp) 4f7: 75 45 jne 53e <printf+0x12b> s = (char*)*ap; 4f9: 8b 45 e8 mov -0x18(%ebp),%eax 4fc: 8b 00 mov (%eax),%eax 4fe: 89 45 f4 mov %eax,-0xc(%ebp) ap++; 501: 83 45 e8 04 addl $0x4,-0x18(%ebp) if(s == 0) 505: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 509: 75 09 jne 514 <printf+0x101> s = "(null)"; 50b: c7 45 f4 df 07 00 00 movl $0x7df,-0xc(%ebp) while(*s != 0){ 512: eb 1e jmp 532 <printf+0x11f> 514: eb 1c jmp 532 <printf+0x11f> putc(fd, *s); 516: 8b 45 f4 mov -0xc(%ebp),%eax 519: 0f b6 00 movzbl (%eax),%eax 51c: 0f be c0 movsbl %al,%eax 51f: 89 44 24 04 mov %eax,0x4(%esp) 523: 8b 45 08 mov 0x8(%ebp),%eax 526: 89 04 24 mov %eax,(%esp) 529: e8 05 fe ff ff call 333 <putc> s++; 52e: 83 45 f4 01 addl $0x1,-0xc(%ebp) } else if(c == 's'){ s = (char*)*ap; ap++; if(s == 0) s = "(null)"; while(*s != 0){ 532: 8b 45 f4 mov -0xc(%ebp),%eax 535: 0f b6 00 movzbl (%eax),%eax 538: 84 c0 test %al,%al 53a: 75 da jne 516 <printf+0x103> 53c: eb 68 jmp 5a6 <printf+0x193> putc(fd, *s); s++; } } else if(c == 'c'){ 53e: 83 7d e4 63 cmpl $0x63,-0x1c(%ebp) 542: 75 1d jne 561 <printf+0x14e> putc(fd, *ap); 544: 8b 45 e8 mov -0x18(%ebp),%eax 547: 8b 00 mov (%eax),%eax 549: 0f be c0 movsbl %al,%eax 54c: 89 44 24 04 mov %eax,0x4(%esp) 550: 8b 45 08 mov 0x8(%ebp),%eax 553: 89 04 24 mov %eax,(%esp) 556: e8 d8 fd ff ff call 333 <putc> ap++; 55b: 83 45 e8 04 addl $0x4,-0x18(%ebp) 55f: eb 45 jmp 5a6 <printf+0x193> } else if(c == '%'){ 561: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp) 565: 75 17 jne 57e <printf+0x16b> putc(fd, c); 567: 8b 45 e4 mov -0x1c(%ebp),%eax 56a: 0f be c0 movsbl %al,%eax 56d: 89 44 24 04 mov %eax,0x4(%esp) 571: 8b 45 08 mov 0x8(%ebp),%eax 574: 89 04 24 mov %eax,(%esp) 577: e8 b7 fd ff ff call 333 <putc> 57c: eb 28 jmp 5a6 <printf+0x193> } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); 57e: c7 44 24 04 25 00 00 movl $0x25,0x4(%esp) 585: 00 586: 8b 45 08 mov 0x8(%ebp),%eax 589: 89 04 24 mov %eax,(%esp) 58c: e8 a2 fd ff ff call 333 <putc> putc(fd, c); 591: 8b 45 e4 mov -0x1c(%ebp),%eax 594: 0f be c0 movsbl %al,%eax 597: 89 44 24 04 mov %eax,0x4(%esp) 59b: 8b 45 08 mov 0x8(%ebp),%eax 59e: 89 04 24 mov %eax,(%esp) 5a1: e8 8d fd ff ff call 333 <putc> } state = 0; 5a6: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ 5ad: 83 45 f0 01 addl $0x1,-0x10(%ebp) 5b1: 8b 55 0c mov 0xc(%ebp),%edx 5b4: 8b 45 f0 mov -0x10(%ebp),%eax 5b7: 01 d0 add %edx,%eax 5b9: 0f b6 00 movzbl (%eax),%eax 5bc: 84 c0 test %al,%al 5be: 0f 85 71 fe ff ff jne 435 <printf+0x22> putc(fd, c); } state = 0; } } } 5c4: c9 leave 5c5: c3 ret 000005c6 <free>: static Header base; static Header *freep; void free(void *ap) { 5c6: 55 push %ebp 5c7: 89 e5 mov %esp,%ebp 5c9: 83 ec 10 sub $0x10,%esp Header *bp, *p; bp = (Header*)ap - 1; 5cc: 8b 45 08 mov 0x8(%ebp),%eax 5cf: 83 e8 08 sub $0x8,%eax 5d2: 89 45 f8 mov %eax,-0x8(%ebp) for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 5d5: a1 48 0a 00 00 mov 0xa48,%eax 5da: 89 45 fc mov %eax,-0x4(%ebp) 5dd: eb 24 jmp 603 <free+0x3d> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 5df: 8b 45 fc mov -0x4(%ebp),%eax 5e2: 8b 00 mov (%eax),%eax 5e4: 3b 45 fc cmp -0x4(%ebp),%eax 5e7: 77 12 ja 5fb <free+0x35> 5e9: 8b 45 f8 mov -0x8(%ebp),%eax 5ec: 3b 45 fc cmp -0x4(%ebp),%eax 5ef: 77 24 ja 615 <free+0x4f> 5f1: 8b 45 fc mov -0x4(%ebp),%eax 5f4: 8b 00 mov (%eax),%eax 5f6: 3b 45 f8 cmp -0x8(%ebp),%eax 5f9: 77 1a ja 615 <free+0x4f> free(void *ap) { Header *bp, *p; bp = (Header*)ap - 1; for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 5fb: 8b 45 fc mov -0x4(%ebp),%eax 5fe: 8b 00 mov (%eax),%eax 600: 89 45 fc mov %eax,-0x4(%ebp) 603: 8b 45 f8 mov -0x8(%ebp),%eax 606: 3b 45 fc cmp -0x4(%ebp),%eax 609: 76 d4 jbe 5df <free+0x19> 60b: 8b 45 fc mov -0x4(%ebp),%eax 60e: 8b 00 mov (%eax),%eax 610: 3b 45 f8 cmp -0x8(%ebp),%eax 613: 76 ca jbe 5df <free+0x19> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) break; if(bp + bp->s.size == p->s.ptr){ 615: 8b 45 f8 mov -0x8(%ebp),%eax 618: 8b 40 04 mov 0x4(%eax),%eax 61b: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx 622: 8b 45 f8 mov -0x8(%ebp),%eax 625: 01 c2 add %eax,%edx 627: 8b 45 fc mov -0x4(%ebp),%eax 62a: 8b 00 mov (%eax),%eax 62c: 39 c2 cmp %eax,%edx 62e: 75 24 jne 654 <free+0x8e> bp->s.size += p->s.ptr->s.size; 630: 8b 45 f8 mov -0x8(%ebp),%eax 633: 8b 50 04 mov 0x4(%eax),%edx 636: 8b 45 fc mov -0x4(%ebp),%eax 639: 8b 00 mov (%eax),%eax 63b: 8b 40 04 mov 0x4(%eax),%eax 63e: 01 c2 add %eax,%edx 640: 8b 45 f8 mov -0x8(%ebp),%eax 643: 89 50 04 mov %edx,0x4(%eax) bp->s.ptr = p->s.ptr->s.ptr; 646: 8b 45 fc mov -0x4(%ebp),%eax 649: 8b 00 mov (%eax),%eax 64b: 8b 10 mov (%eax),%edx 64d: 8b 45 f8 mov -0x8(%ebp),%eax 650: 89 10 mov %edx,(%eax) 652: eb 0a jmp 65e <free+0x98> } else bp->s.ptr = p->s.ptr; 654: 8b 45 fc mov -0x4(%ebp),%eax 657: 8b 10 mov (%eax),%edx 659: 8b 45 f8 mov -0x8(%ebp),%eax 65c: 89 10 mov %edx,(%eax) if(p + p->s.size == bp){ 65e: 8b 45 fc mov -0x4(%ebp),%eax 661: 8b 40 04 mov 0x4(%eax),%eax 664: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx 66b: 8b 45 fc mov -0x4(%ebp),%eax 66e: 01 d0 add %edx,%eax 670: 3b 45 f8 cmp -0x8(%ebp),%eax 673: 75 20 jne 695 <free+0xcf> p->s.size += bp->s.size; 675: 8b 45 fc mov -0x4(%ebp),%eax 678: 8b 50 04 mov 0x4(%eax),%edx 67b: 8b 45 f8 mov -0x8(%ebp),%eax 67e: 8b 40 04 mov 0x4(%eax),%eax 681: 01 c2 add %eax,%edx 683: 8b 45 fc mov -0x4(%ebp),%eax 686: 89 50 04 mov %edx,0x4(%eax) p->s.ptr = bp->s.ptr; 689: 8b 45 f8 mov -0x8(%ebp),%eax 68c: 8b 10 mov (%eax),%edx 68e: 8b 45 fc mov -0x4(%ebp),%eax 691: 89 10 mov %edx,(%eax) 693: eb 08 jmp 69d <free+0xd7> } else p->s.ptr = bp; 695: 8b 45 fc mov -0x4(%ebp),%eax 698: 8b 55 f8 mov -0x8(%ebp),%edx 69b: 89 10 mov %edx,(%eax) freep = p; 69d: 8b 45 fc mov -0x4(%ebp),%eax 6a0: a3 48 0a 00 00 mov %eax,0xa48 } 6a5: c9 leave 6a6: c3 ret 000006a7 <morecore>: static Header* morecore(uint nu) { 6a7: 55 push %ebp 6a8: 89 e5 mov %esp,%ebp 6aa: 83 ec 28 sub $0x28,%esp char *p; Header *hp; if(nu < 4096) 6ad: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp) 6b4: 77 07 ja 6bd <morecore+0x16> nu = 4096; 6b6: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp) p = sbrk(nu * sizeof(Header)); 6bd: 8b 45 08 mov 0x8(%ebp),%eax 6c0: c1 e0 03 shl $0x3,%eax 6c3: 89 04 24 mov %eax,(%esp) 6c6: e8 48 fc ff ff call 313 <sbrk> 6cb: 89 45 f4 mov %eax,-0xc(%ebp) if(p == (char*)-1) 6ce: 83 7d f4 ff cmpl $0xffffffff,-0xc(%ebp) 6d2: 75 07 jne 6db <morecore+0x34> return 0; 6d4: b8 00 00 00 00 mov $0x0,%eax 6d9: eb 22 jmp 6fd <morecore+0x56> hp = (Header*)p; 6db: 8b 45 f4 mov -0xc(%ebp),%eax 6de: 89 45 f0 mov %eax,-0x10(%ebp) hp->s.size = nu; 6e1: 8b 45 f0 mov -0x10(%ebp),%eax 6e4: 8b 55 08 mov 0x8(%ebp),%edx 6e7: 89 50 04 mov %edx,0x4(%eax) free((void*)(hp + 1)); 6ea: 8b 45 f0 mov -0x10(%ebp),%eax 6ed: 83 c0 08 add $0x8,%eax 6f0: 89 04 24 mov %eax,(%esp) 6f3: e8 ce fe ff ff call 5c6 <free> return freep; 6f8: a1 48 0a 00 00 mov 0xa48,%eax } 6fd: c9 leave 6fe: c3 ret 000006ff <malloc>: void* malloc(uint nbytes) { 6ff: 55 push %ebp 700: 89 e5 mov %esp,%ebp 702: 83 ec 28 sub $0x28,%esp Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 705: 8b 45 08 mov 0x8(%ebp),%eax 708: 83 c0 07 add $0x7,%eax 70b: c1 e8 03 shr $0x3,%eax 70e: 83 c0 01 add $0x1,%eax 711: 89 45 ec mov %eax,-0x14(%ebp) if((prevp = freep) == 0){ 714: a1 48 0a 00 00 mov 0xa48,%eax 719: 89 45 f0 mov %eax,-0x10(%ebp) 71c: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 720: 75 23 jne 745 <malloc+0x46> base.s.ptr = freep = prevp = &base; 722: c7 45 f0 40 0a 00 00 movl $0xa40,-0x10(%ebp) 729: 8b 45 f0 mov -0x10(%ebp),%eax 72c: a3 48 0a 00 00 mov %eax,0xa48 731: a1 48 0a 00 00 mov 0xa48,%eax 736: a3 40 0a 00 00 mov %eax,0xa40 base.s.size = 0; 73b: c7 05 44 0a 00 00 00 movl $0x0,0xa44 742: 00 00 00 } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 745: 8b 45 f0 mov -0x10(%ebp),%eax 748: 8b 00 mov (%eax),%eax 74a: 89 45 f4 mov %eax,-0xc(%ebp) if(p->s.size >= nunits){ 74d: 8b 45 f4 mov -0xc(%ebp),%eax 750: 8b 40 04 mov 0x4(%eax),%eax 753: 3b 45 ec cmp -0x14(%ebp),%eax 756: 72 4d jb 7a5 <malloc+0xa6> if(p->s.size == nunits) 758: 8b 45 f4 mov -0xc(%ebp),%eax 75b: 8b 40 04 mov 0x4(%eax),%eax 75e: 3b 45 ec cmp -0x14(%ebp),%eax 761: 75 0c jne 76f <malloc+0x70> prevp->s.ptr = p->s.ptr; 763: 8b 45 f4 mov -0xc(%ebp),%eax 766: 8b 10 mov (%eax),%edx 768: 8b 45 f0 mov -0x10(%ebp),%eax 76b: 89 10 mov %edx,(%eax) 76d: eb 26 jmp 795 <malloc+0x96> else { p->s.size -= nunits; 76f: 8b 45 f4 mov -0xc(%ebp),%eax 772: 8b 40 04 mov 0x4(%eax),%eax 775: 2b 45 ec sub -0x14(%ebp),%eax 778: 89 c2 mov %eax,%edx 77a: 8b 45 f4 mov -0xc(%ebp),%eax 77d: 89 50 04 mov %edx,0x4(%eax) p += p->s.size; 780: 8b 45 f4 mov -0xc(%ebp),%eax 783: 8b 40 04 mov 0x4(%eax),%eax 786: c1 e0 03 shl $0x3,%eax 789: 01 45 f4 add %eax,-0xc(%ebp) p->s.size = nunits; 78c: 8b 45 f4 mov -0xc(%ebp),%eax 78f: 8b 55 ec mov -0x14(%ebp),%edx 792: 89 50 04 mov %edx,0x4(%eax) } freep = prevp; 795: 8b 45 f0 mov -0x10(%ebp),%eax 798: a3 48 0a 00 00 mov %eax,0xa48 return (void*)(p + 1); 79d: 8b 45 f4 mov -0xc(%ebp),%eax 7a0: 83 c0 08 add $0x8,%eax 7a3: eb 38 jmp 7dd <malloc+0xde> } if(p == freep) 7a5: a1 48 0a 00 00 mov 0xa48,%eax 7aa: 39 45 f4 cmp %eax,-0xc(%ebp) 7ad: 75 1b jne 7ca <malloc+0xcb> if((p = morecore(nunits)) == 0) 7af: 8b 45 ec mov -0x14(%ebp),%eax 7b2: 89 04 24 mov %eax,(%esp) 7b5: e8 ed fe ff ff call 6a7 <morecore> 7ba: 89 45 f4 mov %eax,-0xc(%ebp) 7bd: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 7c1: 75 07 jne 7ca <malloc+0xcb> return 0; 7c3: b8 00 00 00 00 mov $0x0,%eax 7c8: eb 13 jmp 7dd <malloc+0xde> nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; if((prevp = freep) == 0){ base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 7ca: 8b 45 f4 mov -0xc(%ebp),%eax 7cd: 89 45 f0 mov %eax,-0x10(%ebp) 7d0: 8b 45 f4 mov -0xc(%ebp),%eax 7d3: 8b 00 mov (%eax),%eax 7d5: 89 45 f4 mov %eax,-0xc(%ebp) return (void*)(p + 1); } if(p == freep) if((p = morecore(nunits)) == 0) return 0; } 7d8: e9 70 ff ff ff jmp 74d <malloc+0x4e> } 7dd: c9 leave 7de: c3 ret
34.120138
60
0.42526
a5088ccfd209fd3024c77499d049c98d8465ed9c
1,291
asm
Assembly
Include/IOName_Standard.asm
absindx/NES-RamEdit
bd686399c2509775da9a79d741ce22ba36992ec3
[ "MIT" ]
null
null
null
Include/IOName_Standard.asm
absindx/NES-RamEdit
bd686399c2509775da9a79d741ce22ba36992ec3
[ "MIT" ]
null
null
null
Include/IOName_Standard.asm
absindx/NES-RamEdit
bd686399c2509775da9a79d741ce22ba36992ec3
[ "MIT" ]
null
null
null
;-------------------------------------------------- ; IO name - Standard(PPU, APU) ;-------------------------------------------------- IO_PPU_Setting = $2000 ; npsbsimm IO_PPU_Display = $2001 ; rgbsbsbc IO_PPU_Status = $2002 ; v0cs---- IO_PPU_SpriteAddress = $2003 ; dddddddd IO_PPU_SpriteAccess = $2004 ; dddddddd IO_PPU_Scroll = $2005 ; dddddddd IO_PPU_VRAMAddress = $2006 ; dddddddd IO_PPU_VRAMAccess = $2007 ; dddddddd IO_APU_Square1_1 = $4000 ; ddlerrrr IO_APU_Square1_2 = $4001 ; fssshrrr IO_APU_Square1_3 = $4002 ; ffffffff IO_APU_Square1_4 = $4003 ; cccccfff IO_APU_Square2_1 = $4004 ; ddlerrrr IO_APU_Square2_2 = $4005 ; fssshrrr IO_APU_Square2_3 = $4006 ; ffffffff IO_APU_Square2_4 = $4007 ; cccccfff IO_APU_Triangle_1 = $4008 ; flllllll ;IO_APU_Triangle_2 = $4009 ; -------- IO_APU_Triangle_3 = $400A ; ffffffff IO_APU_Triangle_4 = $400B ; cccccfff IO_APU_Noise_1 = $400C ; --lerrrr ;IO_APU_Noise_2 = $400D ; -------- IO_APU_Noise_3 = $400E ; r---ffff IO_APU_Noise_4 = $400F ; ccccc--- IO_APU_DPCM_1 = $4010 ; ir--ffff IO_APU_DPCM_2 = $4011 ; -fffffff IO_APU_DPCM_3 = $4012 ; aaaaaaaa IO_APU_DPCM_4 = $4013 ; llllllll IO_Sprite_DMA = $4014 ; aaaaaaaa IO_APU_KeyonFlag = $4015 ; ii-dntss IO_Controller_Port1 = $4016 ; ---ccccc IO_Controller_Port2 = $4017 ; u--ccccc
33.973684
51
0.670798
a6c53a12267d2badc13347eeda48d8aab2198e3e
2,984
asm
Assembly
C_and_Assembly/asm2/mystery.asm
woobear/School_projects
40933c0ae90cdabfd364ab0b8e5ae48414d8c347
[ "MIT" ]
null
null
null
C_and_Assembly/asm2/mystery.asm
woobear/School_projects
40933c0ae90cdabfd364ab0b8e5ae48414d8c347
[ "MIT" ]
null
null
null
C_and_Assembly/asm2/mystery.asm
woobear/School_projects
40933c0ae90cdabfd364ab0b8e5ae48414d8c347
[ "MIT" ]
null
null
null
;Robert Wooner ;Assignment 7 ;CS261 ; This code is an ISBN Calculater using 11 digits instead of 10. ;this program ranks each number in the numbers (1-10) multiplies each rank by their digit and adds them together ;then divides them by 11 and compares it to ten and as long as its not zero it will add a new digit ;if it is zero then it will add an "X" SECTION .data prompt: db "Enter 10 digits: " plen: equ $-prompt SECTION .bss digits: equ 10 inbuf: resb digits + 2 SECTION .text global _start _start: nop mov eax, 4 ; write mov ebx, 1 ; to standard output mov ecx, prompt ; the prompt string mov edx, plen ; of length plen int 80H ; interrupt with the syscall mov eax, 3 ; read mov ebx, 0 ; from standard input mov ecx, inbuf ; into the input buffer mov edx, digits+1 ; upto digits + 1 bytes int 80H ; interrupt with the syscall cld ; clear direction flag (df =0) increments loop mov esi, inbuf ;moves inbuf to source index register(pointer register) mov ecx, digits ; moves 10 counter register (loop indexes) mov dx, 0 ;set dx register (16 bit) to 0 top: <<<<<<< HEAD:currAss/asm2/mystery.asm lodsb ; load string byte sub al, '0' ;subtracts 0(ascii value) from al mul cl ;multiplies al and cl and places it in ax add dx, ax ;adds ax to dx loop top ; loops back to top and decrements ecx until 0 mov ax, dx ;moves contents of dx to ax mov cl, 11 ; sets cl to 11 div cl ;divides ax by cl mov al, ah ;moves ah to al cmp al, 10 ; compares al and 10 (al - 10) jnz makeDigit ;jumps to make "makeDigit" if the result of cmp is not zero mov al, 'X' ; moves X to al jmp storeDigit ;jump to "storeDigit" makeDigit: add al, '0' ;adds 0 to al register storeDigit: mov [inbuf+10], al ;stores the new digit mov byte [inbuf+11], 10 ;10 on the end ======= lodsb ; load string byte sub al, '0' ;subtracts 0(ascii value) from al mul cl ;multiplies al and cl and places it in ax add dx, ax ;adds ax to dx loop top ; loops back to top and decrements ecx (cl) until 0 mov ax, dx ;moves contents of dx to ax mov cl, 11 ; sets cl to 11 div cl ;divides ax by cl mov al, ah ;moves ah to al cmp al, 10 ; compares al and 10 (al - 10) jnz makeDigit ;jumps to make "makeDigit" if the result of cmp is not zero mov al, 'X' ; moves X to al jmp storeDigit ;jump to "storeDigit" makeDigit: add al, '0' ;adds 0 to al register storeDigit: mov [inbuf+10], al ;stores the new digit mov byte [inbuf+11], 10 ;10 on the end >>>>>>> 2f93262cad837a7e1bcb91c6389d5b3ff1b5ed24:pastAss/asm2/mystery.asm mov eax, 4 ; write mov ebx, 1 ; to standard output mov ecx, inbuf ; the string in the buffer mov edx, digits+2 ; of length digits+2 int 80H ; interrupt with the syscall mov eax, 1 ; set up process exit mov ebx, 0 ; and int 80H ; terminate
33.52809
112
0.655496
e63bb83a69c399a3a149ad42ae3708ebed28d9e3
6,832
asm
Assembly
Transynther/x86/_processed/NONE/_xt_sm_/i3-7100_9_0xca_notsx.log_21829_95.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_sm_/i3-7100_9_0xca_notsx.log_21829_95.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_sm_/i3-7100_9_0xca_notsx.log_21829_95.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r14 push %rax push %rbx push %rcx push %rdi push %rsi lea addresses_UC_ht+0xf9e2, %rsi lea addresses_WC_ht+0x9de2, %rdi clflush (%rdi) nop nop nop nop nop and %r14, %r14 mov $80, %rcx rep movsl xor %rax, %rax lea addresses_UC_ht+0x14594, %rsi lea addresses_D_ht+0x175e2, %rdi nop nop nop nop nop add %rbx, %rbx mov $51, %rcx rep movsl nop nop add %rsi, %rsi lea addresses_normal_ht+0x1d7b2, %rsi lea addresses_WT_ht+0x13f62, %rdi add $28810, %rax mov $41, %rcx rep movsq nop nop nop nop add $14033, %rsi pop %rsi pop %rdi pop %rcx pop %rbx pop %rax pop %r14 ret .global s_faulty_load s_faulty_load: push %r13 push %r14 push %r15 push %r8 push %rbp push %rcx push %rdi push %rdx push %rsi // Store lea addresses_UC+0x94c2, %r15 nop xor %rbp, %rbp movl $0x51525354, (%r15) nop xor %r15, %r15 // Store lea addresses_UC+0x1ae6, %rsi clflush (%rsi) nop nop nop nop add %r14, %r14 movb $0x51, (%rsi) nop nop nop nop sub $32460, %r13 // Load lea addresses_UC+0x99e2, %r15 nop nop nop nop add $65243, %rsi mov (%r15), %r14w nop sub %r15, %r15 // REPMOV lea addresses_WT+0x131e2, %rsi lea addresses_UC+0x47a2, %rdi nop nop nop nop sub %rdx, %rdx mov $78, %rcx rep movsq nop nop nop nop inc %rcx // Store lea addresses_WT+0x18502, %r14 nop nop nop nop nop sub %rbp, %rbp movl $0x51525354, (%r14) nop nop nop nop nop sub %rdi, %rdi // Store lea addresses_WT+0x94c2, %rcx nop nop cmp $11736, %r15 mov $0x5152535455565758, %r14 movq %r14, %xmm6 vmovups %ymm6, (%rcx) nop nop and $41697, %rdi // Store lea addresses_PSE+0xb5e2, %rcx nop nop and $60701, %rbp movl $0x51525354, (%rcx) nop and %r14, %r14 // Store lea addresses_normal+0x17ace, %rdi nop nop sub $37272, %rsi mov $0x5152535455565758, %r14 movq %r14, (%rdi) nop nop nop nop nop add $15402, %rdi // Faulty Load lea addresses_PSE+0xb5e2, %rsi nop nop nop cmp $40968, %rcx movb (%rsi), %r8b lea oracles, %r13 and $0xff, %r8 shlq $12, %r8 mov (%r13,%r8,1), %r8 pop %rsi pop %rdx pop %rdi pop %rcx pop %rbp pop %r8 pop %r15 pop %r14 pop %r13 ret /* <gen_faulty_load> [REF] {'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_PSE', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 4, 'NT': False, 'type': 'addresses_UC', 'size': 4, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_UC', 'size': 1, 'AVXalign': False}} {'src': {'same': False, 'congruent': 10, 'NT': False, 'type': 'addresses_UC', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WT', 'congruent': 4, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC', 'congruent': 6, 'same': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_WT', 'size': 4, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 4, 'NT': False, 'type': 'addresses_WT', 'size': 32, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_PSE', 'size': 4, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_normal', 'size': 8, 'AVXalign': False}} [Faulty Load] {'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_PSE', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_UC_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 9, 'same': False}} {'src': {'type': 'addresses_UC_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 10, 'same': False}} {'src': {'type': 'addresses_normal_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': False}} {'54': 21829} 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 */
32.846154
2,999
0.65603
3301578768d9b70730ac4c58610a6ebeeb67758d
16,488
asm
Assembly
dosmouse.asm
EdouardVanbelle/dosmouse
bf1fea076dd755b171bd930631cf8efa39f6791d
[ "MIT" ]
null
null
null
dosmouse.asm
EdouardVanbelle/dosmouse
bf1fea076dd755b171bd930631cf8efa39f6791d
[ "MIT" ]
null
null
null
dosmouse.asm
EdouardVanbelle/dosmouse
bf1fea076dd755b171bd930631cf8efa39f6791d
[ "MIT" ]
null
null
null
Title 'DosMouse','VANBELLE Edouard (c) 03/1997' .Model Tiny .code Org 100h Dos_mouse: jmp Debut ;************************************* Hot_Key equ 2700h ;2700 4600h args_flags db 0000b old_int28h dd ? ;adresses des anciennes old_multiplexeur dd ? ;interruptions old_mouse dd ? old_int_clavier dd ? old_int1Ch dd ? can_run db 0 just_write db 0 mouse_cnt db 253d ;255-253=2 => r.a.z de can_run write_cnt db 253d ;toute les 2*1/18.2=0.03s etat_mouse dw 0 ;Si 0,la souris n' est pas aff etat_mouse_sav dw 0 can_write db 0 cursor dw ? ;sauv des attrib du curseur col_40 db 0Ah ;si bit0=1 => mode 40 colonnes ecr_seg dw 0B800h ;adresse de l' écran ecr_ofs dw 0 ;(nb: ecran couleur seulement) start_pos dw 0 ;adr. bébut sélection sur ecr. end_pos dw 0 ;adr. fin selection sur ecr. old_end_pos dw 0 ;ard de sauvegarde old_start_pos dw 0 ptr_sel dw offset Selection ;pour int_clavier Selection db 'Sélection vide.',241 dup (0) BEEP macro ;macro personnelle pour les tests push ax mov ax,0E07h int 10h pop ax endm INT33h macro ;appel direct de la souris pushf call cs:old_mouse endm PUSHT macro ;sauv ts les registres utiles push ax ;=PUSHT push bx push cx push dx push si push di push es push ds endm POPT macro ;rest ts les registres utiles pop ds pop es pop di pop si pop dx pop cx pop bx pop ax endm proc DOES_MOUSE_MOVE push ax mov ax,0Bh INT33h or cx,dx pop ax ret endp proc Multiplexeur_ED Far ;nvelle int. (Multiplexeur) sti ;autre int. autorisées pushf cmp ah,0EDh ;test si on s' adresse à DOSMOUSE je mux_ok ;si oui ... popf jmp cs:Old_Multiplexeur ;sinon appel l' ancien Multiplexeur mux_ok: popf or al,al ;al= n° de fonction jnz saut_mux_1 ;si al <> fonction test mov al,0EDh ;indiquer que D.Mouse est installé fin_mux: iret ;Retour saut_mux_1: cmp al,1 ;fonction 1: modifier les flags. jne saut_mux_2 mov cs:args_flags,bl iret saut_mux_2: cmp al,2 ;fonction 2: lire les flags jne fin_mux ;sinon: fonction inconnue, retour mov bl,cs:args_flags iret endp Multiplexeur_ED proc mouse_ed Far ;détermine si la souris est affichée ou non pushf or ax,ax jnz st_mouse0 mov cs:etat_mouse,0 ;fonction reset du driver jmp st_mouse_fin st_mouse0: cmp ax,01h ;fonction affiche souris jne st_mouse1 inc cs:etat_mouse ;(on incrément le drapeau) jmp st_mouse_fin st_mouse1: cmp ax,02h ;fonction cache souris jne st_mouse2 dec cs:etat_mouse ;(décrémente le drapeau) jmp st_mouse_fin st_mouse2: cmp ax,021h ;fonction reset de la partie logicielle jne st_mouse3 mov cs:etat_mouse,0 jmp st_mouse_fin st_mouse3: cmp ax,016h ;fonction sauvegarde jne st_mouse4 push ax mov ax,cs:etat_mouse mov cs:etat_mouse_sav,ax pop ax jmp st_mouse_fin st_mouse4: cmp ax,017h ;fonction restauration jne st_mouse_fin push ax mov ax,cs:etat_mouse_sav mov cs:etat_mouse,ax pop ax st_mouse_fin: popf jmp cs:old_mouse ;appel l' ancien driver EndP mouse_ed proc int_clavier far ;simule l' appuie de touches sur le clavier sti ; pour envoyer la sélection cmp cs:can_write,00 ; vérifie si on peut écrire jne write_selection cli jmp cs:old_int_clavier ;sinon appel ancien drv clavier write_selection: push bx mov bx,cs:ptr_sel ;regarde ou en est le transfert de car. cmp byte ptr cs:[bx],0 jne do_tfr_car ;si <>0, il y a encore des car. a tfr. lea bx,selection ;sinon remet le pointer à l'origine mov cs:ptr_sel,bx pop bx mov cs:can_write,00 ;plus besoin d'ecrire (tfr terminé) mov cs:just_write,0FFh ;on vient juste d'ecrire, on a donc cli ; plus besoin de la souris jmp cs:old_int_clavier ;ancien gestinnaire clavier do_tfr_car: mov cs:can_run,0 ;désactive le controleur DosMouse cmp ah,00h ;ici,fonction 0= fonction 10 je fct0 ; (lecture car. avec inc ptr) cmp ah,10h je fct0 cmp ah,01h ;ici,fonction 1= fonction 11 je fct1 ; (lecture car, sans modifier source) cmp ah,11h je fct1 pop bx cli jmp cs:old_int_clavier ;sinon appel ancien drv clavier fct0: mov al,cs:[bx] ;tranfert le car pointé par bx xor ah,ah ;pas de scancode (souvent inutile) inc cs:ptr_sel ;passe au car suivant (appel suivant) pop bx iret ;retour fct1: mov al,cs:[bx] ;transfert le car pointé par bx xor ah,ah ;pas de scancode pop bx cmp ah,1 ;ZF=0 => car présent ret 2 ;retour en conservant les flags endp proc tache_de_fond far ;procedure appelée quand le DOS ne fait rien sti ;int autorisées pushf PUSHT cmp cs:etat_mouse,0 ;la souris est-elle éteinte? jz I_can ;oui Ho_no: jmp no_I_can_not ;non, on sort I_can: cmp cs:just_write,0 jne Ho_no ;vient-on juste d' écrire? call does_mouse_move or cx,cx jz ho_no mov ah,0Fh ;lit mode vidéo actuelle int 10h cmp al,03 ;seul le mode texte est suporté jna I_can1 jmp no_I_can_not ;si mode graphique (>3) on sort I_can1: mov al,ah ;al=ah=nbr de colonnes mov cl,3 ;ici seul bit0 est significatif shr al,cl mov cs:col_40,al ;sauvegarde pour les calculs xor al,al ;al inutile xchg al,ah ;bh=page_vidéo mul bh ;calcul offset de l'écran car: mov dh,50d ;off=(col*25*2)*page_page_vidéo mul dh mov cs:ecr_ofs,ax ;sauv l'offset mov ah,03h ;lit forme du curseur int 10h mov cs:cursor,cx ;on la sauvegarde(pour restit.) mov ah,01h mov cx,2020h ;éteint le curseur texte int 10h test cs:args_flags,1000b ;la souris part d'où ? jz no_relocation ;si ZF,part de ancien situation mov ah,03h int 10h ;lit pos du curseur xor ah,ah ;ah inutile mov al,dl ;al=dl=colonne(=pos en X) mov cl,3 ;80 col,largeur curseur= 8 pxls mov bl,cs:col_40 ;40 col,largeur curseur=16 pxls shr bl,1 adc cl,0 ;lit la bit0 via ZC shl ax,cl ;=mul 8 ou 16 push ax ;sauv résultat sur la pile xor ah,ah mov al,dh ;al=dh=ligne(=pos en Y) mov cl,3 shl ax,cl ;=mul 8 mov dx,ax ;dx=ligne_souris pop cx ;cx=sauvgarde_pile=col_souris mov ax,04h ;modifie la pos de la souris INT33h no_relocation: mov ax,0Ah xor bx,bx mov cl,0 mov dl,04 mov ch,01110111b mov dh,01110111b test cs:args_flags,0100b jz cur_mouse_carreau mov dl,18 cur_mouse_carreau: INT33h mov ax,01h int33h tache_loop: mov ax,03h INT33h cmp bx,10b je tache_no_loop cmp bx,01b jne no_sel_mouse mov ax,cs:end_pos mov cs:old_end_pos,ax mov ax,cs:old_start_pos mov cs:start_pos,ax mov cs:end_pos,ax call redraw call sel_mouse no_sel_mouse: mov ah,01h pushf call cs:old_int_clavier jz tache_loop mov cs:can_write,00h jmp fin_tache tache_no_loop: mov ax,0003h INT33h or bx,bx jnz tache_no_loop mov cs:can_write,0FFh test cs:args_flags,0001b jz fin_tache call add_point fin_tache: mov ax,cs:end_pos mov cs:old_end_pos,ax mov ax,cs:old_start_pos mov cs:start_pos,ax mov cs:end_pos,ax call redraw mov ax,0002h INT33h mov ah,01h mov cx,cs:cursor int 10h mov byte ptr cs:can_run,0h POPT popf Iret no_i_can_not: POPT popf cli jmp cs:old_int28h endp tache_de_fond ;proc event_mouse far ; cmp cs:just_write,0 ; jne not_allowed ; mov cs:can_run,0FFh ;not_allowed: ; retf ;endp event_mouse proc sel_mouse pushf push ds push es push cx push ax push bx push si push di cld call DOES_MOUSE_MOVE call calc_pos_dx mov cs:start_pos,dx mov cs:end_pos,dx mov cs:old_start_pos,dx ret_sel_mouse: call DOES_MOUSE_MOVE jz no_move test cs:args_flags,0100b jz no_mode_ligne mov al,cs:col_40 xor ah,ah mov cl,4 shl ax,cl mov bx,ax call calc_pos_dx sub dx,cs:start_pos mov ax,dx mov cl,8 idiv cl or al,al jz no_mode_ligne cmp al,0 jg inc_start_pos mov ax,cs:start_pos mov cs:old_start_pos,ax sub ax,bx mov cs:start_pos,ax jmp no_mode_ligne inc_start_pos: mov ax,cs:start_pos mov cs:old_start_pos,ax add ax,bx mov cs:start_pos,ax no_mode_ligne: call calc_pos_dx mov ax,dx sub ax,cs:start_pos cmp ax,00FBh jl move_it mov bx,cs:start_pos mov dx,0FBh add dx,bx move_it: mov ax,cs:end_pos mov cs:old_end_pos,ax mov cs:end_pos,dx call redraw mov ax,cs:start_pos mov cs:old_start_pos,ax no_move: mov ax,03 INT33h test bx,01b jz no_ret_sel_mouse jmp ret_sel_mouse no_ret_sel_mouse: mov ax,cs mov es,ax mov ax,cs:ecr_seg mov ds,ax mov si,cs:start_pos mov dx,cs:end_pos cmp si,dx je no_selection lea di,cs:selection sel_mouse_rep: cmp si,dx jae no_car_to_sav lodsw cmp al,' ' jae sel_car_ok mov al,' ' sel_car_ok: stosb jmp sel_mouse_rep no_car_to_sav: test cs:args_flags,0010b jz no_addi_enter mov al,0Dh stosb no_addi_enter: mov al,0 stosb no_selection: pop di pop si pop bx pop ax pop cx pop es pop ds popf ret endp sel_mouse proc redraw push ds push es push di push si push ax push bx push cx push dx mov ax,02 pushf call cs:old_mouse mov ax,cs:ecr_seg mov ds,ax mov es,ax mov si,cs:old_start_pos mov di,si xor cx,cx mov dx,cs:old_end_pos invert_car: cmp si,dx jae no_invert_car lodsw mov bx,ax mov bl,bh and bh,10001000b not bl and bl,01110111b or bl,bh mov ah,bl stosw jmp invert_car no_invert_car: or cx,cx jnz fin_redraw not cx mov si,cs:start_pos mov di,si mov di,si mov dx,cs:end_pos jmp invert_car fin_redraw: mov ax,01 pushf call cs:old_mouse pop dx pop cx pop bx pop ax pop si pop di pop es pop ds endp proc calc_pos_dx push ax push bx push cx mov ax,03 INT33h mov ax,cx ;ax=cx=colonne souris mov cl,2 ;80 col,largeur curseur= 8 pxls mov bl,cs:col_40 ;40 col,largeur curseur=16 pxls shr bl,1 adc cl,0 ;lit la bit0 via ZC shr ax,cl ;=div 4 ou 8 push ax ;ax=(colonne_ecr*2) mov ax,dx ;ax=dx=ligne souris mov cl,2 ;80 col,largeur curseur= 8 pxls shr ax,cl ;=div 4 (on div 8 puis mul 2) mov bl,cs:col_40 xor bh,bh mov cl,3 shl bx,cl mul bx ;ax=ax*bx mov dx,cs:ecr_ofs add dx,ax pop ax add dx,ax pop cx pop bx pop ax ret endp proc int1Ch_ed cli pushf inc cs:mouse_cnt jnz no_reset1 mov cs:mouse_cnt,253d mov cs:can_run,00h no_reset1: inc cs:write_cnt jnz no_reset2 mov cs:write_cnt,253d mov cs:just_write,00 no_reset2: popf jmp cs:old_int1Ch endp proc add_point ret ; pushf push di push ax push cx lodsb xor ah,ah add di,ax std mov cx,04 mov al,' ' repne scasb jne no_point mov byte ptr ds:[di],'.' no_point: pop cx pop ax pop di popf ret endp add_point installe: call does_mouse_move lea dx,Debut mov cl,4 shr dx,cl inc dx mov ax,3100h int 21h ;********************************** la partie qui suit ne reste pas en mémoire Debut: mov ah,30h int 21h cmp al,3 jae Debut1 lea bx,Er_Ver_Dos jmp erreur Debut1: mov ax,0ED00h int 2Fh mov is_installed,al or al,al jz no_old_set mov ax,0ED02h int 2Fh mov args_flags,bl no_old_set: lea dx,args_to_find call litargs pushf xor cx,cx mov bh,F_point cmp bh,80h je no_F_point or bh,bh jz reset1 or ch,0001b jmp no_f_point reset1: or cl,0001b no_f_point: mov bh,F_entre cmp bh,80h je no_F_entre or bh,bh jz reset2 or ch,0010b jmp no_f_entre reset2: or cl,0010b no_f_entre: mov bh,F_ligne cmp bh,80h je no_F_ligne or bh,bh jz reset3 or ch,0100b jmp no_f_ligne reset3: or cl,0100b no_f_ligne: mov bh,F_org cmp bh,80h je no_F_org or bh,bh jz reset4 or ch,1000b jmp no_f_org reset4: or cl,1000b no_f_org: mov bl,args_flags not cl and bl,cl or bl,ch mov args_flags,bl popf jnc param_ok or al,al jz no_param lea bx,usage jmp erreur no_param: cmp is_installed,0 jz doit_installer lea dx,dj_inst mov ah,09h int 21h mov ax,4C01h int 21h param_ok: cmp is_installed,0 jz Doit_installer cmp ah,01h jne change_args_flags cmp f_visu,0FFh jne change_args_flags mov ax,0ED02h int 2Fh call aff_visu jmp fin_visu change_args_flags: mov bl,cs:args_flags mov ax,0ED01h int 2Fh mov ah,09h lea dx,bascule int 21h cmp f_visu,0 je fin_visu call aff_visu fin_visu: mov ax,4C00h int 21h Doit_installer: xor ax,ax int 33h or ax,ax jnz drv_souris_ok lea bx,no_mouse jmp erreur drv_souris_ok: ;************** Ici les échanges d'interruptions mov ax,0352Fh int 21h mov word ptr cs:old_multiplexeur,Bx mov word ptr cs:old_multiplexeur+2,Es mov al,28h int 21h mov word ptr cs:old_int28h,Bx mov word ptr cs:old_int28h+2,Es mov al,33h int 21h mov word ptr cs:old_mouse,Bx mov word ptr cs:old_mouse+2,Es mov al,1Ch int 21h mov word ptr cs:old_int1Ch,Bx mov word ptr cs:old_int1Ch+2,Es mov al,16h int 21h mov word ptr cs:old_int_clavier,Bx mov word ptr cs:old_int_clavier+2,Es push cs pop ds mov ax,0252Fh lea dx,multiplexeur_ed int 21h mov al,28h lea dx,tache_de_fond int 21h mov al,33h lea dx,mouse_ed int 21h mov al,1Ch lea dx,int1Ch_ed int 21h mov al,16h lea dx,Int_clavier int 21h push cs pop ds lea dx,dm_inst mov ah,09h int 21h cmp cs:f_visu,0 je di_saut mov bl,args_flags call aff_visu di_saut: jmp installe Erreur: mov ah,09h lea dx,Auteur int 21h mov dx,bx int 21h mov ax,4CFFh int 21h proc aff_visu pushf push dx push ds push es push di push si push ax mov ax,cs mov es,ax mov ds,ax mov ah,09h lea dx,auteur int 21h test bl,0001b jz av_saut1 lea si,Oui lea di,etat_pnt movsw movsb av_saut1: test bl,0010b jz av_saut2 lea si,oui lea di,etat_ent movsw movsb av_saut2: test bl,0100b jz av_saut3 lea si,oui lea di,etat_sel movsw movsb av_saut3: test bl,1000b jz av_saut4 lea si,oui lea di,etat_org movsw movsb av_saut4: lea dx,dm_etat int 21h pop ax pop si pop di pop es pop ds pop dx popf ret endp ;************************************* Auteur db 'DosMouse.com Version 1.0 Copyright (c) 1997' db ' VANBELLE Edouard',10,13,'$' dm_inst db 'DosMouse installé',10,13,'$' no_mouse db 'Installation stoppée: le driver souris n'' est pas en' db ' mémoire',10,13,'$' bascule db 'DosMouse reconfiguré',10,13,'$' dj_inst db 'DosMouse déjà installé',10,13,'$' Usage db 10,13,'Syntaxe: DOSMOUSE [/options+|-] [/v] [/r]',10,13 db 10,13,' V = affiche le mode DosMouse (visualisation des' db ' réglages)' db 10,13,'option peut être l''une des quatre lettres: P,E,L,C' db 10,13,' P = ajout automatique du Point d''extension sur' db ' les fichiers' db 10,13,' E = simulation de l''appuie de la touche Entrée' db ' après une séléction' db 10,13,' L = déplacement de la sélection avec la souris en' db ' mode Ligne horizontale' db 10,13,' C = repositionnement de la souris à l''emplacement' db ' actuel du Curseur' db 10,13,' (chaque option doit être suivie de + ou - sauf pour' db ' ''v'' et ''r'')' db 10,13,' + = activation de l''option, - = désactivation.' db 10,13 db 10,13,' exemple: DOSMOUSE /p+ /e- /v /c+' db 10,13,' (par défaut, DosMouse désactive chaque' db ' option)',10,13,'$' Er_Ver_dos db 10,13,' Version Ms-Dos trop ancienne',10,13,'$' Oui db 'Oui' dm_Etat db 10,13,'Etat de dosmouse:' db 10,13,' ajout automatique du Point d''extension sur' db ' les fichiers : ' etat_pnt db 'Non' db 10,13,' simulation de l''appuie de la touche Entrée après' db ' une sélection : ' etat_Ent db 'Non' db 10,13,' déplacement de la sélection avec la souris en mode' db ' Ligne horizontale : ' etat_sel db 'Non' db 10,13,' repositionnement de la souris à l''emplacement' db ' actuel du Curseur : ' etat_org db 'Non' db 10,13,'$' F_point db 80h F_entre db 80h F_ligne db 80h F_Org db 80h F_Visu db 0 Is_Installed db 0 ;ReInstalle db 0 args_on equ '+' args_off equ '-' Include litargs.inc args_to_find label word dw offset f_point db 'P',1,0 dw offset f_entre db 'E',1,0 dw offset f_ligne db 'L',1,0 dw offset f_org db 'C',1,0 dw offset f_visu db 'V',0 dw 0FFFFh End Dos_Mouse ; **************** VANBELLE Edouard *********************** Fin de programme **
18.463606
79
0.678918
726997f34c38e17c2104c2b7ff25314921b657c7
4,141
asm
Assembly
Transynther/x86/_processed/US/_ht_zr_/i7-8650U_0xd2_notsx.log_13_1049.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/US/_ht_zr_/i7-8650U_0xd2_notsx.log_13_1049.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/US/_ht_zr_/i7-8650U_0xd2_notsx.log_13_1049.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r12 push %r15 push %r9 push %rax push %rcx push %rdi push %rdx push %rsi lea addresses_normal_ht+0x1aa4e, %r9 nop nop nop xor %rdx, %rdx mov (%r9), %rcx nop nop nop nop xor $21174, %r9 lea addresses_WT_ht+0x1cc06, %rsi lea addresses_A_ht+0x407b, %rdi clflush (%rsi) nop nop nop nop and %rax, %rax mov $116, %rcx rep movsl nop add %rsi, %rsi lea addresses_A_ht+0x132fb, %rsi lea addresses_WT_ht+0xcc7b, %rdi nop nop nop nop nop xor %rdx, %rdx mov $83, %rcx rep movsl nop nop nop nop nop and %rax, %rax lea addresses_WT_ht+0x177b, %rdx nop and $43707, %r12 movl $0x61626364, (%rdx) nop add %rdi, %rdi lea addresses_A_ht+0x1de7b, %rsi lea addresses_UC_ht+0x1d3fb, %rdi clflush (%rsi) nop nop nop nop nop add %r15, %r15 mov $40, %rcx rep movsw nop sub $16513, %rdx lea addresses_WC_ht+0x67b, %rdi nop cmp %r15, %r15 mov (%rdi), %r12 nop nop nop nop nop cmp %rsi, %rsi lea addresses_WT_ht+0x14645, %rsi lea addresses_WC_ht+0xd67b, %rdi nop nop xor %r12, %r12 mov $74, %rcx rep movsw add %rdi, %rdi lea addresses_WT_ht+0x385b, %rdi nop nop nop nop nop inc %rsi mov (%rdi), %r9w nop nop nop cmp %rcx, %rcx lea addresses_WT_ht+0x17568, %rdx nop sub $58325, %rax movb (%rdx), %r15b nop nop nop nop sub %r12, %r12 lea addresses_WT_ht+0x1dcb3, %rsi lea addresses_WC_ht+0x4339, %rdi clflush (%rsi) nop and %r9, %r9 mov $26, %rcx rep movsw nop nop nop nop nop add %rcx, %rcx lea addresses_UC_ht+0xc67b, %rsi lea addresses_normal_ht+0x2ab, %rdi clflush (%rdi) nop nop nop nop nop inc %r12 mov $45, %rcx rep movsq inc %r12 lea addresses_UC_ht+0x1967b, %r15 clflush (%r15) xor $52885, %rsi movl $0x61626364, (%r15) nop nop add $1486, %r15 pop %rsi pop %rdx pop %rdi pop %rcx pop %rax pop %r9 pop %r15 pop %r12 ret .global s_faulty_load s_faulty_load: push %r10 push %r15 push %r8 push %rbx push %rcx // Faulty Load lea addresses_US+0x1ee7b, %r15 nop nop nop nop nop and $62199, %r10 vmovups (%r15), %ymm1 vextracti128 $1, %ymm1, %xmm1 vpextrq $0, %xmm1, %r8 lea oracles, %rbx and $0xff, %r8 shlq $12, %r8 mov (%rbx,%r8,1), %r8 pop %rcx pop %rbx pop %r8 pop %r15 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 8, 'AVXalign': True, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 9, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 8, 'AVXalign': True, 'NT': False, 'congruent': 11, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': True}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 3, 'same': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}} {'00': 8, '45': 4, '49': 1} 00 45 00 00 45 00 49 45 00 00 45 00 00 */
20.5
151
0.651775
14e5d51cb946687f11517fbbb2c611f335fa409c
1,121
asm
Assembly
programs/oeis/274/A274593.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/274/A274593.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/274/A274593.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A274593: a(0) = 0; thereafter, a(2*n+1) = a(n)+2*n+1, otherwise a(n) = n. ; 0,1,2,4,4,7,6,11,8,13,10,18,12,19,14,26,16,25,18,32,20,31,22,41,24,37,26,46,28,43,30,57,32,49,34,60,36,55,38,71,40,61,42,74,44,67,46,88,48,73,50,88,52,79,54,101,56,85,58,102,60,91,62,120,64,97,66,116,68,103,70,131,72,109,74,130,76,115,78,150,80,121,82,144,84,127,86,161,88,133,90,158,92,139,94,183,96,145,98,172,100,151,102,191,104,157,106,186,108,163,110,212,112,169,114,200,116,175,118,221,120,181,122,214,124,187,126,247,128,193,130,228,132,199,134,251,136,205,138,242,140,211,142,274,144,217,146,256,148,223,150,281,152,229,154,270,156,235,158,309,160,241,162,284,164,247,166,311,168,253,170,298,172,259,174,336,176,265,178,312,180,271,182,341,184,277,186,326,188,283,190,374,192,289,194,340,196,295,198,371,200,301,202,354,204,307,206,398,208,313,210,368,212,319,214,401,216,325,218,382,220,331,222,435,224,337,226,396,228,343,230,431,232,349,234,410,236,355,238,460,240,361,242,424,244,367,246,461,248,373 mov $1,2 mov $2,$0 add $0,1 lpb $0,1 add $1,$0 sub $0,1 add $0,$1 div $1,2 mod $0,$1 add $0,$1 lpe sub $1,2 add $1,$2
65.941176
913
0.683318