content
stringlengths 5
1.04M
| avg_line_length
float64 1.75
12.9k
| max_line_length
int64 2
244k
| alphanum_fraction
float64 0
0.98
| licenses
sequence | repository_name
stringlengths 7
92
| path
stringlengths 3
249
| size
int64 5
1.04M
| lang
stringclasses 2
values |
---|---|---|---|---|---|---|---|---|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Copyright(c) 2011-2016 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.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
%include "options.asm"
%include "stdmac.asm"
%ifndef UTILS_ASM
%define UTILS_ASM
; compare macro
;; sttni2 is faster, but it can't be debugged
;; so following code is based on "mine5"
;; compare 258 bytes = 8 * 32 + 2
;; tmp16 is a 16-bit version of tmp
;; compare258 src1, src2, result, tmp
%macro compare258 4
%define %%src1 %1
%define %%src2 %2
%define %%result %3
%define %%tmp %4
%define %%tmp16 %4w ; tmp as a 16-bit register
xor %%result, %%result
%%loop1:
mov %%tmp, [%%src1 + %%result]
xor %%tmp, [%%src2 + %%result]
jnz %%miscompare
add %%result, 8
mov %%tmp, [%%src1 + %%result]
xor %%tmp, [%%src2 + %%result]
jnz %%miscompare
add %%result, 8
cmp %%result, 256
jb %%loop1
; compare last two bytes
mov %%tmp16, [%%src1 + %%result]
xor %%tmp16, [%%src2 + %%result]
jnz %%miscompare16
; no miscompares, return 258
add %%result, 2
jmp %%end
%%miscompare16:
and %%tmp, 0xFFFF
%%miscompare:
bsf %%tmp, %%tmp
shr %%tmp, 3
add %%result, %%tmp
%%end:
%endm
;; compare 258 bytes = 8 * 32 + 2
;; tmp16 is a 16-bit version of tmp
;; compare258 src1, src2, result, tmp
%macro compare250_r 4
%define %%src1 %1
%define %%src2 %2
%define %%result %3
%define %%tmp %4
%define %%tmp16 %4w ; tmp as a 16-bit register
mov %%result, 8
mov %%tmp, [%%src1 + 8]
xor %%tmp, [%%src2 + 8]
jnz %%miscompare
add %%result, 8
%%loop1:
mov %%tmp, [%%src1 + %%result]
xor %%tmp, [%%src2 + %%result]
jnz %%miscompare
add %%result, 8
mov %%tmp, [%%src1 + %%result]
xor %%tmp, [%%src2 + %%result]
jnz %%miscompare
add %%result, 8
cmp %%result, 256
jb %%loop1
; compare last two bytes
mov %%tmp16, [%%src1 + %%result]
xor %%tmp16, [%%src2 + %%result]
jnz %%miscompare16
; no miscompares, return 258
add %%result, 2
jmp %%end
%%miscompare16:
and %%tmp, 0xFFFF
%%miscompare:
bsf %%tmp, %%tmp
shr %%tmp, 3
add %%result, %%tmp
%%end:
%endm
;; compare 258 bytes = 8 * 32 + 2
;; compares 16 bytes at a time, using pcmpeqb/pmovmskb
;; compare258_x src1, src2, result, tmp, xtmp1, xtmp2
%macro compare258_x 6
%define %%src1 %1
%define %%src2 %2
%define %%result %3
%define %%tmp %4
%define %%tmp32 %4d
%define %%tmp16 %4w ; tmp as a 16-bit register
%define %%xtmp %5
%define %%xtmp2 %6
xor %%result, %%result
%%loop1:
MOVDQU %%xtmp, [%%src1 + %%result]
MOVDQU %%xtmp2, [%%src2 + %%result]
PCMPEQB %%xtmp, %%xtmp, %%xtmp2
PMOVMSKB %%tmp32, %%xtmp
xor %%tmp, 0xFFFF
jnz %%miscompare
add %%result, 16
MOVDQU %%xtmp, [%%src1 + %%result]
MOVDQU %%xtmp2, [%%src2 + %%result]
PCMPEQB %%xtmp, %%xtmp, %%xtmp2
PMOVMSKB %%tmp32, %%xtmp
xor %%tmp, 0xFFFF
jnz %%miscompare
add %%result, 16
cmp %%result, 256
jb %%loop1
; compare last two bytes
mov %%tmp16, [%%src1 + %%result]
xor %%tmp16, [%%src2 + %%result]
jnz %%miscompare16
; no miscompares, return 258
add %%result, 2
jmp %%end
%%miscompare16:
and %%tmp, 0xFFFF
bsf %%tmp, %%tmp
shr %%tmp, 3
add %%result, %%tmp
jmp %%end
%%miscompare:
bsf %%tmp, %%tmp
add %%result, %%tmp
%%end:
%endm
;; compare 258 bytes = 8 * 32 + 2, assuming first 8 bytes
;; were already checked
;; compares 16 bytes at a time, using pcmpeqb/pmovmskb
;; compare250_x src1, src2, result, tmp, xtmp1, xtmp2
%macro compare250_x 6
%define %%src1 %1
%define %%src2 %2
%define %%result %3
%define %%tmp %4
%define %%tmp32 %4d ; tmp as a 16-bit register
%define %%xtmp %5
%define %%xtmp2 %6
mov %%result, 8
MOVDQU %%xtmp, [%%src1 + 8]
MOVDQU %%xtmp2, [%%src2 + 8]
PCMPEQB %%xtmp, %%xtmp, %%xtmp2
PMOVMSKB %%tmp32, %%xtmp
xor %%tmp, 0xFFFF
jnz %%miscompare
add %%result, 16
%%loop1:
MOVDQU %%xtmp, [%%src1 + %%result]
MOVDQU %%xtmp2, [%%src2 + %%result]
PCMPEQB %%xtmp, %%xtmp, %%xtmp2
PMOVMSKB %%tmp32, %%xtmp
xor %%tmp, 0xFFFF
jnz %%miscompare
add %%result, 16
MOVDQU %%xtmp, [%%src1 + %%result]
MOVDQU %%xtmp2, [%%src2 + %%result]
PCMPEQB %%xtmp, %%xtmp, %%xtmp2
PMOVMSKB %%tmp32, %%xtmp
xor %%tmp, 0xFFFF
jnz %%miscompare
add %%result, 16
cmp %%result, 258 - 16
jb %%loop1
MOVDQU %%xtmp, [%%src1 + %%result]
MOVDQU %%xtmp2, [%%src2 + %%result]
PCMPEQB %%xtmp, %%xtmp, %%xtmp2
PMOVMSKB %%tmp32, %%xtmp
xor %%tmp, 0xFFFF
jnz %%miscompare_last
; no miscompares, return 258
mov %%result, 258
jmp %%end
%%miscompare_last:
bsf %%tmp, %%tmp
add %%result, %%tmp
;; Guarantee the result has length at most 258.
mov %%tmp, 258
cmp %%result, 258
cmova %%result, %%tmp
jmp %%end
%%miscompare:
bsf %%tmp, %%tmp
add %%result, %%tmp
%%end:
%endm
;; compare 258 bytes = 8 * 32 + 2
;; compares 32 bytes at a time, using pcmpeqb/pmovmskb
;; compare258_y src1, src2, result, tmp, xtmp1, xtmp2
%macro compare258_y 6
%define %%src1 %1
%define %%src2 %2
%define %%result %3
%define %%tmp %4
%define %%tmp16 %4w ; tmp as a 16-bit register
%define %%tmp32 %4d ; tmp as a 32-bit register
%define %%ytmp %5
%define %%ytmp2 %6
xor %%result, %%result
%%loop1:
vmovdqu %%ytmp, [%%src1 + %%result]
vmovdqu %%ytmp2, [%%src2 + %%result]
vpcmpeqb %%ytmp, %%ytmp, %%ytmp2
vpmovmskb %%tmp, %%ytmp
xor %%tmp32, 0xFFFFFFFF
jnz %%miscompare
add %%result, 32
vmovdqu %%ytmp, [%%src1 + %%result]
vmovdqu %%ytmp2, [%%src2 + %%result]
vpcmpeqb %%ytmp, %%ytmp, %%ytmp2
vpmovmskb %%tmp, %%ytmp
xor %%tmp32, 0xFFFFFFFF
jnz %%miscompare
add %%result, 32
cmp %%result, 256
jb %%loop1
; compare last two bytes
mov %%tmp16, [%%src1 + %%result]
xor %%tmp16, [%%src2 + %%result]
jnz %%miscompare16
; no miscompares, return 258
add %%result, 2
jmp %%end
%%miscompare16:
and %%tmp, 0xFFFF
bsf %%tmp, %%tmp
shr %%tmp, 3
add %%result, %%tmp
jmp %%end
%%miscompare:
bsf %%tmp, %%tmp
add %%result, %%tmp
%%end:
%endm
;; compare 258 bytes = 8 * 32 + 2, assuming first 8 bytes
;; were already checked
;; compares 32 bytes at a time, using pcmpeqb/pmovmskb
;; compare258_y src1, src2, result, tmp, xtmp1, xtmp2
%macro compare250_y 6
%define %%src1 %1
%define %%src2 %2
%define %%result %3
%define %%tmp %4
%define %%tmp16 %4w ; tmp as a 16-bit register
%define %%tmp32 %4d ; tmp as a 32-bit register
%define %%ytmp %5
%define %%ytmp2 %6
mov %%result, 8
vmovdqu %%ytmp, [%%src1 + 8]
vmovdqu %%ytmp2, [%%src2 + 8]
vpcmpeqb %%ytmp, %%ytmp, %%ytmp2
vpmovmskb %%tmp, %%ytmp
xor %%tmp32, 0xFFFFFFFF
jnz %%miscompare
add %%result, 32
%%loop1:
vmovdqu %%ytmp, [%%src1 + %%result]
vmovdqu %%ytmp2, [%%src2 + %%result]
vpcmpeqb %%ytmp, %%ytmp, %%ytmp2
vpmovmskb %%tmp, %%ytmp
xor %%tmp32, 0xFFFFFFFF
jnz %%miscompare
add %%result, 32
vmovdqu %%ytmp, [%%src1 + %%result]
vmovdqu %%ytmp2, [%%src2 + %%result]
vpcmpeqb %%ytmp, %%ytmp, %%ytmp2
vpmovmskb %%tmp, %%ytmp
xor %%tmp32, 0xFFFFFFFF
jnz %%miscompare
add %%result, 32
cmp %%result, 258 - 32
jb %%loop1
vmovdqu %%ytmp, [%%src1 + %%result]
vmovdqu %%ytmp2, [%%src2 + %%result]
vpcmpeqb %%ytmp, %%ytmp, %%ytmp2
vpmovmskb %%tmp, %%ytmp
xor %%tmp32, 0xFFFFFFFF
jnz %%miscompare_last
mov %%result, 258
jmp %%end
%%miscompare_last:
bsf %%tmp, %%tmp
add %%result, %%tmp
;; Guarantee the result has length at most 258.
mov %%tmp, 258
cmp %%result, 258
cmova %%result, %%tmp
jmp %%end
%%miscompare:
bsf %%tmp, %%tmp
add %%result, %%tmp
%%end:
%endm
%macro compare250 6
%define %%src1 %1
%define %%src2 %2
%define %%result %3
%define %%tmp %4
%define %%xtmp0 %5x
%define %%xtmp1 %6x
%define %%ytmp0 %5
%define %%ytmp1 %6
%if (COMPARE_TYPE == 1)
compare250_r %%src1, %%src2, %%result, %%tmp
%elif (COMPARE_TYPE == 2)
compare250_x %%src1, %%src2, %%result, %%tmp, %%xtmp0, %%xtmp1
%elif (COMPARE_TYPE == 3)
compare250_y %%src1, %%src2, %%result, %%tmp, %%ytmp0, %%ytmp1
%else
%error Unknown Compare type COMPARE_TYPE
% error
%endif
%endmacro
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; compare size, src1, src2, result, tmp
%macro compare 5
%define %%size %1
%define %%src1 %2
%define %%src2 %3
%define %%result %4
%define %%tmp %5
%define %%tmp8 %5b ; tmp as a 8-bit register
xor %%result, %%result
sub %%size, 7
jle %%lab2
%%loop1:
mov %%tmp, [%%src1 + %%result]
xor %%tmp, [%%src2 + %%result]
jnz %%miscompare
add %%result, 8
sub %%size, 8
jg %%loop1
%%lab2:
;; if we fall through from above, we have found no mismatches,
;; %%size+7 is the number of bytes left to look at, and %%result is the
;; number of bytes that have matched
add %%size, 7
jle %%end
%%loop3:
mov %%tmp8, [%%src1 + %%result]
cmp %%tmp8, [%%src2 + %%result]
jne %%end
inc %%result
dec %%size
jg %%loop3
jmp %%end
%%miscompare:
bsf %%tmp, %%tmp
shr %%tmp, 3
add %%result, %%tmp
%%end:
%endm
%endif ;UTILS_ASM
| 23.651584 | 72 | 0.624641 | [
"BSD-3-Clause"
] | gigel773/isa-l | igzip/igzip_compare_types.asm | 10,454 | Assembly |
; 因为换成了ELF,无法使用
GLOBAL main
main:
MOV AX, 1005 * 8
MOV DX, AX
CMP DWORD [DS:0x0004], 'Hari'
JNE fin
MOV ECX, [DS:0x0000]
MOV AX, 2005 * 8
MOV DS, AX
crackloop:
ADD ECX, -1
MOV BYTE [DS:ECX], 123
CMP ECX, 0
JNE crackloop
fin:
MOV EDX, 4
INT 0x40
| 12.2 | 33 | 0.547541 | [
"MIT"
] | ghosind/HariboteOS | day27/app/crack7.asm | 325 | Assembly |
; A212415: Number of (w,x,y,z) with all terms in {1,...,n} and w<x>=y<=z.
; 0,0,3,17,55,135,280,518,882,1410,2145,3135,4433,6097,8190,10780,13940,17748,22287,27645,33915,41195,49588,59202,70150,82550,96525,112203,129717,149205,170810,194680,220968,249832,281435,315945,353535,394383,438672,486590,538330,594090,654073,718487,787545,861465,940470,1024788,1114652,1210300,1311975,1419925,1534403,1655667,1783980,1919610,2062830,2213918,2373157,2540835,2717245,2902685,3097458,3301872,3516240,3740880,3976115,4222273,4479687,4748695,5029640,5322870,5628738,5947602,6279825,6625775,6985825,7360353,7749742,8154380,8574660,9010980,9463743,9933357,10420235,10924795,11447460,11988658,12548822,13128390,13727805,14347515,14987973,15649637,16332970,17038440,17766520,18517688,19292427,20091225
mov $3,3
lpb $0
sub $0,1
add $2,$4
add $1,$2
add $4,$3
add $3,5
lpe
mov $0,$1
| 67.307692 | 711 | 0.793143 | [
"Apache-2.0"
] | ckrause/cm | programs/oeis/212/A212415.asm | 875 | Assembly |
; @copyright
; Copyright (C) 2020 Assured Information Security, Inc.
;
; @copyright
; Permission is hereby granted, free of charge, to any person obtaining a copy
; of this software and associated documentation files (the "Software"), to deal
; in the Software without restriction, including without limitation the rights
; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
; copies of the Software, and to permit persons to whom the Software is
; furnished to do so, subject to the following conditions:
;
; @copyright
; The above copyright notice and this permission notice shall be included in
; all copies or substantial portions of the Software.
;
; @copyright
; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
; SOFTWARE.
.code
intrinsic_sgdt PROC
sgdt fword ptr[rcx]
ret
int 3
intrinsic_sgdt ENDP
end
| 36.485714 | 79 | 0.759593 | [
"MIT"
] | 1370339317/hypervisor | loader/windows/src/x64/intrinsic_sgdt.asm | 1,277 | Assembly |
; BSD
; char *index_callee(const char *s, int c)
SECTION code_clib
SECTION code_string
PUBLIC _index_callee
EXTERN _strchr_callee
defc _index_callee = _strchr_callee
| 13.153846 | 42 | 0.80117 | [
"BSD-2-Clause"
] | ByteProject/Puddle-BuildTools | FictionTools/z88dk/libsrc/_DEVELOPMENT/string/c/sdcc_ix/index_callee.asm | 171 | Assembly |
; A288625: Positions of 0 in A288375; complement of A283794.
; 2,3,5,7,8,11,12,14,17,18,20,22,23,27,28,30,32,33,36,37,39,43,44,46,48,49,52,53,55,58,59,61,63,64,69,70,72,74,75,78,79,81,84,85,87,89,90,94,95,97,99,100,103,104,106,111,112,114,116,117,120,121,123,126,127,129,131,132,136,137,139,141,142,145,146,148,152,153,155,157,158,161,162,164,167,168,170,172,173,179,180,182,184,185,188,189,191,194,195,197
mov $1,$0
seq $1,7895 ; Number of terms in Zeckendorf representation of n (write n as a sum of non-consecutive distinct Fibonacci numbers).
mov $2,$0
sub $0,$1
add $0,$2
add $0,2
| 58.7 | 345 | 0.712095 | [
"Apache-2.0"
] | ckrause/cm | programs/oeis/288/A288625.asm | 587 | Assembly |
; A120138: a(1)=10; a(n)=floor((20+sum(a(1) to a(n-1)))/2).
; 10,15,22,33,50,75,112,168,252,378,567,851,1276,1914,2871,4307,6460,9690,14535,21803,32704,49056,73584,110376,165564,248346,372519,558779,838168,1257252,1885878,2828817,4243226,6364839,9547258,14320887
mov $2,20
lpb $0
sub $0,1
add $1,$2
mov $2,$1
div $1,2
lpe
add $1,$2
div $1,2
add $1,1
mul $1,2
sub $1,22
div $1,2
add $1,10
| 22.055556 | 202 | 0.670025 | [
"Apache-2.0"
] | jmorken/loda | programs/oeis/120/A120138.asm | 397 | Assembly |
// Allocate block outside the ROM area
define MEMORY_MAP = HIROM
define ROM_SIZE = 1
include "../../../src/common/memory.inc"
createCodeBlock(code, 0x802000, 0x80ffaf) // ERROR
| 18.2 | 51 | 0.71978 | [
"MIT"
] | undisbeliever/untech-engine | unit_tests/static-tests/common/memory.oob2.error.asm | 182 | Assembly |
; A052686: E.g.f. x^2*(1+3x-3x^2)/(1-x).
; Submitted by Jamie Morken(s2.)
; 0,0,2,24,24,120,720,5040,40320,362880,3628800,39916800,479001600,6227020800,87178291200,1307674368000,20922789888000,355687428096000,6402373705728000,121645100408832000,2432902008176640000
seq $0,142 ; Factorial numbers: n! = 1*2*3*4*...*n (order of symmetric group S_n, number of permutations of n letters).
div $0,2
mov $2,$0
mod $2,4
mov $3,$0
lpb $2
mov $2,1
mov $3,12
lpe
mov $0,$3
mul $0,2
| 29.8125 | 190 | 0.719078 | [
"Apache-2.0"
] | ckrause/loda-programs | oeis/052/A052686.asm | 477 | Assembly |
Map_Obj27_2_: dc.w word_1EBCA-Map_Obj27_2_
dc.w word_1EBE4-Map_Obj27_2_
dc.w word_1EBFE-Map_Obj27_2_
word_1EBCA: dc.w 4
dc.b $E0, 5, 0, $34, $FF, $E0
dc.b $E0, 5, 0, $34, 0, $10
dc.b $10, 5, 0, $34, $FF, $E0
dc.b $10, 5, 0, $34, 0, $10
word_1EBE4: dc.w 4
dc.b $E0, 5, 0, $34, $FF, $C0
dc.b $E0, 5, 0, $34, 0, $30
dc.b $10, 5, 0, $34, $FF, $C0
dc.b $10, 5, 0, $34, 0, $30
word_1EBFE: dc.w 4
dc.b $E0, 5, 0, $34, $FF, $80
dc.b $E0, 5, 0, $34, 0, $70
dc.b $10, 5, 0, $34, $FF, $80
dc.b $10, 5, 0, $34, 0, $70
| 32.421053 | 43 | 0.452922 | [
"Apache-2.0"
] | NatsumiFox/AMPS-Sonic-3-Knuckles | General/Sprites/Unused/Map - Obj27 Unused 2.asm | 616 | Assembly |
global @ASM_strnlen@8
extern @ASM_memchr@12
%define ASM_memchr @ASM_memchr@12
segment .text align=16
%define string ecx
%define maxLength edx
%define startString esi
%define startMaxLength ebx
%define searchedChar edx
%define searchedString ecx
%define result eax
%define memchrRet eax
@ASM_strnlen@8:
push startString
push startMaxLength
mov startString, string
mov startMaxLength, maxLength
sub esp, 16
push maxLength
xor searchedChar, searchedChar
; mov searchedString, string ; Both are ecx
call ASM_memchr
mov edx, memchrRet
sub edx, startString
test memchrRet, memchrRet
mov result, startMaxLength
cmovne result, edx
add esp, 16
pop startMaxLength
pop startString
ret
| 21.243243 | 47 | 0.706107 | [
"Unlicense"
] | GabrielRavier/Generic-Assembly-Samples | asm/strnlen.asm | 786 | Assembly |
SECTION code_clib
PUBLIC aplib_depack
PUBLIC _aplib_depack
;==============================================================
; aplib_depack(unsigned char *src, unsigned char *dest)
;==============================================================
; Uncompresses data previously compressed with apLib
;==============================================================
.aplib_depack
._aplib_depack
ld hl, 2
add hl, sp
ld e, (hl) ; Destination address
inc hl
ld d, (hl)
inc hl
ld a, (hl) ; Source address
inc hl
ld h, (hl)
ld l, a
jp depack
; Usage:
;
; .include this file in your code
; somewhere after that, an aPLibMemoryStruct called aPLibMemory must be defined somewhere in RAM
; ie. "aPLibMemory instanceof aPLibMemoryStruct" inside a .ramsection or .enum
;
; Then do
;
; ld hl,<source address>
; ld de,<destination address>
; call depack
;
; In my tests, depack() used a maximum of 12 bytes of stack, but this may vary with different data.
; This file is using WLA-DX syntax quite heavily, you'd better use it too...
;.struct aPLibMemoryStruct
;bits db
;byte db ; not directly referenced, assumed to come after bits
;LWM db
;R0 dw
;.endst
; Reader's note:
; The structure of the code has been arranged such that the entry point is in the middle -
; this is so it can use jr to branch out to the various subsections to save a few bytes,
; but it makes it somewhat harder to read. "depack" is the entry point and "aploop" is
; the main loop.
; Subsections which are only referenced by calls are defined in separate .sections to enable
; better code packing in the output (more finely divided blobs).
; More optimisations may be possible; in general, size optimisations are favoured over speed.
.ap_getbit
push bc
ld bc,(aPLibMemory_bits)
rrc c
jr nc,ap_getbit_continue
ld b,(hl)
inc hl
.ap_getbit_continue
ld a,c
and b
ld (aPLibMemory_bits),bc
pop bc
ret
.ap_getbitbc ;doubles BC and adds the read bit
sla c
rl b
call ap_getbit
ret z
inc bc
ret
.ap_getgamma
ld bc,1
.ap_getgammaloop
call ap_getbitbc
call ap_getbit
jr nz,ap_getgammaloop
ret
.apbranch2
;use a gamma code * 256 for offset, another gamma code for length
call ap_getgamma
dec bc
dec bc
ld a,(aPLibMemory_LWM)
or a
jr nz,ap_not_LWM
;bc = 2? ; Maxim: I think he means 0
ld a,b
or c
jr nz,ap_not_zero_gamma
;if gamma code is 2, use old R0 offset, and a new gamma code for length
call ap_getgamma
push hl
ld h,d
ld l,e
push bc
ld bc,(aPLibMemory_R0)
sbc hl,bc
pop bc
ldir
pop hl
jr ap_finishup
.ap_not_zero_gamma
dec bc
.ap_not_LWM
;do I even need this code? ; Maxim: seems so, it's broken without it
;bc=bc*256+(hl), lazy 16bit way
ld b,c
ld c,(hl)
inc hl
ld (aPLibMemory_R0),bc
push bc
call ap_getgamma
ex (sp),hl
;bc = len, hl=offs
push de
ex de,hl
;some comparison junk for some reason
; Maxim: optimised to use add instead of sbc
ld hl,-32000
add hl,de
jr nc,skip1
inc bc
.skip1
ld hl,-1280
add hl,de
jr nc,skip2
inc bc
.skip2
ld hl,-128
add hl,de
jr c,skip3
inc bc
inc bc
.skip3
;bc = len, de = offs, hl=junk
pop hl
push hl
or a
sbc hl,de
pop de
;hl=dest-offs, bc=len, de = dest
ldir
pop hl
.ap_finishup
ld a,1
ld (aPLibMemory_LWM),a
jr aploop
.apbranch1 ; Maxim: moved this one closer to where it's jumped from to allow jr to work and save 2 bytes
ldi
xor a
ld (aPLibMemory_LWM),a
jr aploop
.depack
;hl = source
;de = dest
ldi
xor a
ld (aPLibMemory_LWM),a
inc a
ld (aPLibMemory_bits),a
.aploop
call ap_getbit
jr z, apbranch1
call ap_getbit
jr z, apbranch2
call ap_getbit
jr z, apbranch3
;LWM = 0
xor a
ld (aPLibMemory_LWM),a
;get an offset
ld bc,0
call ap_getbitbc
call ap_getbitbc
call ap_getbitbc
call ap_getbitbc
ld a,b
or c
jr nz,apbranch4
; xor a ;write a 0 ; Maxim: a is zero already (just failed nz test), optimise this line away
ld (de),a
inc de
jr aploop
.apbranch4
ex de,hl ;write a previous bit (1-15 away from dest)
push hl
sbc hl,bc
ld a,(hl)
pop hl
ld (hl),a
inc hl
ex de,hl
jr aploop
.apbranch3
;use 7 bit offset, length = 2 or 3
;if a zero is encountered here, it's EOF
ld c,(hl)
inc hl
rr c
ret z
ld b,2
jr nc,ap_dont_inc_b
inc b
.ap_dont_inc_b
;LWM = 1
ld a,1
ld (aPLibMemory_LWM),a
push hl
ld a,b
ld b,0
;R0 = c
ld (aPLibMemory_R0),bc
ld h,d
ld l,e
or a
sbc hl,bc
ld c,a
ldir
pop hl
jr aploop
SECTION bss_crt
aPLibMemory_bits: defb 0 ;apLib support variable
aPLibMemory_byte: defb 0 ;apLib support variable
aPLibMemory_LWM: defb 0 ;apLib support variable
aPLibMemory_R0: defw 0 ;apLib support variable
| 19.853556 | 104 | 0.661538 | [
"BSD-2-Clause"
] | ByteProject/Puddle-BuildTools | FictionTools/z88dk/libsrc/target/sms/aplib_depack.asm | 4,745 | Assembly |
; A219562: Sum(binomial(n+k,k)^4, k=0..n).
; Submitted by Jon Maiga
; 1,17,1378,170257,25561876,4294835666,776487013506,147812510671121,29234435383857304,5955068493838815892,1241820686691538181636,263946916625793118532050,56996643356459050103185444,12473214064899644269110156626,2760963661677614009262282769378,617198078104431620570782650949905,139163804534752297903317290441908768,31616920038397235721502628472092325656,7231584969154103526780633480125330406504,1664012405835474370305971207563512921162132,384967930268082286287273626430370258665449160
mov $2,$0
lpb $0
mov $3,$2
add $3,$0
bin $3,$0
sub $0,1
pow $3,4
add $1,$3
lpe
mov $0,$1
add $0,1
| 41.4375 | 483 | 0.840121 | [
"Apache-2.0"
] | ckrause/loda-programs | oeis/219/A219562.asm | 663 | Assembly |
; A081611: Number of numbers <= n having no 2 in their ternary representation.
; 1,2,2,3,4,4,4,4,4,5,6,6,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,9,10,10,11,12,12,12,12,12,13,14,14,15,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,18,18,19,20,20,20,20,20,21,22,22,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,25,26,26,27,28,28,28,28,28,29,30,30,31,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,33,34,34,35,36,36,36
mov $5,$0
add $5,1
lpb $5
mov $0,$2
sub $5,1
sub $0,$5
mov $3,2
mov $6,1
mul $6,$0
mul $6,2
mov $4,$6
lpb $4
gcd $3,$4
div $4,3
lpe
mov $6,$3
sub $6,1
add $1,$6
lpe
| 43.608696 | 723 | 0.619143 | [
"Apache-2.0"
] | jmorken/loda | programs/oeis/081/A081611.asm | 1,003 | Assembly |
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r14
push %r8
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_A_ht+0x11a44, %rdi
add %r8, %r8
mov (%rdi), %r14w
nop
nop
nop
nop
sub $19582, %r10
lea addresses_D_ht+0x3a84, %rdx
nop
nop
nop
nop
add %rbx, %rbx
movb $0x61, (%rdx)
nop
add %rdi, %rdi
lea addresses_WT_ht+0xc8c4, %rsi
lea addresses_UC_ht+0x16244, %rdi
xor %r8, %r8
mov $59, %rcx
rep movsq
nop
nop
and $59695, %rsi
lea addresses_A_ht+0x165b8, %r10
sub $2119, %r14
movb (%r10), %r8b
cmp $435, %r10
lea addresses_A_ht+0x10d44, %rsi
lea addresses_WT_ht+0x6144, %rdi
nop
add $16977, %rbx
mov $65, %rcx
rep movsw
nop
nop
cmp %rcx, %rcx
lea addresses_D_ht+0x4f44, %rsi
lea addresses_WC_ht+0xeaf0, %rdi
nop
nop
nop
cmp $34556, %rbx
mov $18, %rcx
rep movsw
nop
nop
nop
cmp $16623, %r8
lea addresses_normal_ht+0x15d04, %rsi
lea addresses_normal_ht+0x9f64, %rdi
nop
nop
nop
nop
inc %r14
mov $66, %rcx
rep movsb
nop
nop
nop
nop
dec %rbx
lea addresses_WT_ht+0x19b44, %rsi
lea addresses_A_ht+0x3c64, %rdi
nop
cmp %r14, %r14
mov $43, %rcx
rep movsb
nop
nop
nop
nop
nop
add %rcx, %rcx
lea addresses_normal_ht+0xfb04, %rsi
lea addresses_D_ht+0x3ca4, %rdi
nop
nop
nop
nop
nop
xor $24710, %r10
mov $81, %rcx
rep movsq
nop
nop
nop
cmp $49937, %rdi
lea addresses_A_ht+0x5f8, %rsi
lea addresses_UC_ht+0x1b0e4, %rdi
clflush (%rdi)
nop
nop
nop
nop
dec %rdx
mov $24, %rcx
rep movsw
nop
nop
nop
nop
mfence
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r8
pop %r14
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r14
push %r15
push %rax
push %rdx
push %rsi
// Load
lea addresses_D+0xdeac, %r10
nop
nop
nop
nop
dec %r15
mov (%r10), %rax
nop
nop
nop
cmp $22274, %r15
// Load
mov $0x4776570000000264, %rsi
clflush (%rsi)
cmp %r15, %r15
movb (%rsi), %r10b
nop
nop
nop
nop
nop
sub %r14, %r14
// Store
lea addresses_WC+0x1a544, %r10
nop
and %r13, %r13
movb $0x51, (%r10)
add $5450, %r15
// Store
lea addresses_WC+0x144, %r13
and %r14, %r14
mov $0x5152535455565758, %r10
movq %r10, (%r13)
nop
nop
dec %rsi
// Faulty Load
lea addresses_US+0x1c944, %r15
nop
cmp %rax, %rax
vmovups (%r15), %ymm3
vextracti128 $1, %ymm3, %xmm3
vpextrq $1, %xmm3, %r14
lea oracles, %rsi
and $0xff, %r14
shlq $12, %r14
mov (%rsi,%r14,1), %r14
pop %rsi
pop %rdx
pop %rax
pop %r15
pop %r14
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_US', 'same': False, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_D', 'same': False, 'size': 8, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_NC', 'same': False, 'size': 1, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_WC', 'same': False, 'size': 1, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WC', 'same': False, 'size': 8, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'type': 'addresses_US', 'same': True, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_A_ht', 'same': True, 'size': 2, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 1, 'congruent': 6, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_A_ht', 'same': False, 'size': 1, 'congruent': 2, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_D_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_A_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM'}
{'00': 49}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 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.307692 | 156 | 0.650244 | [
"MIT"
] | danielmgmi/medusa | Transynther/_processed/US/_zr_/i3-7100_9_0x84_notsx.log_49_909.asm | 4,709 | Assembly |
; A172482: a(n) = (1+n)*(9 + 11*n + 4*n^2)/3.
; 3,16,47,104,195,328,511,752,1059,1440,1903,2456,3107,3864,4735,5728,6851,8112,9519,11080,12803,14696,16767,19024,21475,24128,26991,30072,33379,36920,40703,44736,49027,53584,58415,63528,68931,74632,80639,86960,93603,100576,107887,115544,123555,131928,140671,149792,159299,169200,179503,190216,201347,212904,224895,237328,250211,263552,277359,291640,306403,321656,337407,353664,370435,387728,405551,423912,442819,462280,482303,502896,524067,545824,568175,591128,614691,638872,663679,689120,715203,741936,769327,797384,826115,855528,885631,916432,947939,980160,1013103,1046776,1081187,1116344,1152255,1188928,1226371,1264592,1303599,1343400
mul $0,4
add $0,6
mov $1,$0
bin $0,3
add $0,$1
div $0,8
| 74.3 | 639 | 0.79004 | [
"Apache-2.0"
] | ckrause/cm | programs/oeis/172/A172482.asm | 743 | Assembly |
; A051537: Triangle read by rows: T(i,j) = lcm(i,j)/gcd(i,j) for 1 <= j <= i.
; Submitted by Christian Krause
; 1,2,1,3,6,1,4,2,12,1,5,10,15,20,1,6,3,2,6,30,1,7,14,21,28,35,42,1,8,4,24,2,40,12,56,1,9,18,3,36,45,6,63,72,1,10,5,30,10,2,15,70,20,90,1,11,22,33,44,55,66,77,88,99,110,1,12,6,4,3,60,2,84,6,12,30,132,1,13,26,39,52,65,78,91,104,117,130,143,156,1,14,7,42,14,70,21,2,28,126
add $0,1
lpb $0
add $1,1
mov $2,$0
trn $0,$1
lpe
mov $3,$2
gcd $2,$1
pow $2,2
mul $3,$1
div $3,$2
mov $0,$3
| 29.176471 | 270 | 0.596774 | [
"Apache-2.0"
] | ckrause/loda-programs | oeis/051/A051537.asm | 496 | Assembly |
%define BOOTLOADER
%ifdef BOOTLOADER
org 7c00h
%else
org 100h
%endif
section .bss
length resw 1
tmp resw 1
op equ 10h
op2 equ 1000h
section .text
start:
xor ax, ax
%ifdef BOOTLOADER
mov ds, ax
mov es, ax
%endif
;; 设置显示模式(可选)
;; 看起来很酷的一个模式
mov ax, 000Eh
int 10h
;; CRLF
mov al, 0Dh
call func_putc
mov al, 0Ah
call func_putc
;; 打印字符串的地址
mov ax, msg ;0x7cae, offset=0xae, 可以结合Hexview证明
call Disp2ByteInHex
;; CRLF
mov al, 0Dh
call func_putc
mov al, 0Ah
call func_putc
;; 打印字符串长度,包含\0
mov ax, msg
call func_strlen
call Disp2ByteInHex
;; CRLF
mov al, 0Dh
call func_putc
mov al, 0Ah
call func_putc
;; 打印字符串长度,包含\0
mov ax, msg
call func_strlen_2
call Disp2ByteInHex
hlt
jmp $
func_strlen_2:
xor di, di
xor dx, dx
;; mov [length], ax
mov bp, ax
nextchar_2:
;; add ax, bx
mov dl, [bp+di]
;; mov al, dl
;; call func_putc
or dl, dl
jz loopend_2
inc di
loop nextchar_2
loopend_2:
xor ax, ax
mov ax, di
ret
func_strlen:
xor di, di
xor dx, dx
;; mov [length], ax
mov bp, ax
nextchar:
;; add ax, bx
mov dl, [bp+di]
cmp dl, 0
mov al, dl
call func_putc
je loopend
inc di
loop nextchar
loopend:
xor ax, ax
mov ax, di
ret
;; al
func_putc:
mov ah, 0EH ;
mov bx, 0007H
int 10h
ret
;;
Disp4Bit:
cmp al, 0
jae CMP_9
CMP_9:
cmp al, 9
jbe Disp09
cmp al, 15
jbe DispAF
ja DispNG
Disp09:
add al, '0'
call func_putc
ret
DispAF:
sub al, 10
add al, 'A'
call func_putc
ret
DispNG:
mov al, 'N'
call func_putc
ret
Disp2ByteInHex:
mov cx, 4
loopD2BIH:
xor dx, dx
mov [tmp], ax
mov bx, op2
div bx; [op2]
;; div word [op2] ;; 这样写始终由问题,奇怪,会导致除数为0还是。。。查看lst文件,应该是将常量直接当宏来文本替换了
call Disp4Bit
mov ax, [tmp]
;; 保存循环执行次数cx的值
mov dx, cx
;; 置移位数值4
mov cl, 4
shl ax, cl
mov cx, dx
;cmp ax, 0
;je loopendD2BIH
;jmp loopD2BIH
loop loopD2BIH
loopendD2BIH:
ret
Disp2ByteInHex_Reverse:
mov cx, 4
loopproc:
xor dx, dx
mov [tmp], ax
;; 16位除法时候会触发#DE Devide Error
mov bx, op
div bx
mov ax, dx
call Disp4Bit
mov ax, [tmp]
mov dx, cx
mov cl, 4
shr ax, cl
mov cx, dx
;cmp ax, 0
;je loopend2
loop loopproc
loopend2:
ret
msg db 'Hello here something ...', 13, 10, 0
%ifdef BOOTLOADER
times (512-($-$$) - 2) db 0
;;; 以下一句会报错,提示非常量赋值给times
;; times (512-($-start) - 2) db 0
;;size equ $ - start
;;%if size+2 >512
;;%error "code is too large for boot sector"
db 0x55, 0xAA
%endif
| 13.548718 | 72 | 0.595382 | [
"Unlicense"
] | icecoobe/nasm | mbr/strlen.asm | 2,912 | Assembly |
not(8) g29<1>.xD g26<4>.xD { align16 1Q };
not.nz.f0.0(8) null<1>.xD g13<4>.xD { align16 1Q };
not(8) g20<1>D g19<8,8,1>D { align1 1Q };
not(16) g27<1>D g25<8,8,1>D { align1 1H };
| 63.6 | 79 | 0.330189 | [
"MIT"
] | PWN-Hunter/mesa3d | src/intel/tools/tests/gen6/not.asm | 318 | Assembly |
bits 64
section .bss
fd resb 4
buffer resb 0x1000
size equ 0x1000
section .text
global _start
_start:
; int open(const char *pathname, int flags, mode_t mode);
; arg0 (%rdi), arg1 (%rsi), arg2 (%rdx)
mov rax, 0x2 ; open(
mov rdi, [rsp + 0x10] ; argv[1]
xor esi, esi ; O_RDONLY
mov rdx, 0444o ; -r--r--r--
syscall ; )
mov [fd], rax
; ssize_t read(int fd, void *buf, size_t count);
; arg0 (%rdi), arg1 (%rsi), arg2 (%rdx)
xor eax, eax ; read(
mov rdi, [fd] ; int fd
mov rsi, buffer ; void *buf
mov rdx, size ; size_t count
syscall ; )
; ssize_t write(int fd, const void *buf, size_t count);
; arg0 (%rdi), arg1 (%rsi), arg2 (%rdx)
mov rax, 0x1 ; write(
mov rdi, 0x1 ; STDOUT
; rsi points to buf
; rdx is 0x1000
syscall ; )
; int close(int fd);
; arg0 (%rdi)
mov rax, 0x3 ; close(
mov rdi, [fd] ; int fd
syscall ; )
; void exit(int status);
; arg0 (%rdi)
mov rax, 60 ; exit(
xor edi, edi ; 0
syscall ; )
| 21.471698 | 57 | 0.507909 | [
"MIT"
] | limitedeternity/some-gists | ASM/cat.asm | 1,138 | Assembly |
; A282097: Coefficients in q-expansion of (3*E_2*E_4 - 2*E_6 - E_2^3)/1728, where E_2, E_4, E_6 are the Eisenstein series shown in A006352, A004009, A013973, respectively.
; 0,1,12,36,112,150,432,392,960,1053,1800,1452,4032,2366,4704,5400,7936,5202,12636,7220,16800,14112,17424,12696,34560,19375,28392,29160,43904,25230,64800,30752,64512,52272,62424,58800,117936,52022,86640,85176,144000,70602,169344,81356,162624,157950,152352,106032,285696,136857,232500,187272,264992,151686,349920,217800,376320,259920,302760,208860,604800,230702,369024,412776,520192,354900,627264,305252,582624,457056,705600,362952,1010880,394346,624264,697500,808640,569184,1022112,499280,1190400,793881,847224,578676,1580544,780300,976272,908280,1393920,712890,1895400,927472,1421952,1107072,1272384,1083000,2322432,922082,1642284,1528956
mov $2,$0
mul $2,$0
trn $0,1
seq $0,203 ; a(n) = sigma(n), the sum of the divisors of n. Also called sigma_1(n).
mul $0,$2
| 104 | 639 | 0.791667 | [
"Apache-2.0"
] | ckrause/cm | programs/oeis/282/A282097.asm | 936 | Assembly |
; A177337: Partial sums of round(n^2/36).
; 0,0,0,0,0,1,2,3,5,7,10,13,17,22,27,33,40,48,57,67,78,90,103,118,134,151,170,190,212,235,260,287,315,345,377,411,447,485,525,567,611,658,707,758,812,868,927,988,1052,1119,1188,1260,1335,1413,1494,1578,1665,1755,1848,1945,2045,2148,2255,2365,2479,2596,2717,2842,2970,3102,3238,3378,3522,3670,3822,3978,4138,4303,4472,4645,4823,5005,5192,5383,5579,5780,5985,6195,6410,6630,6855,7085,7320,7560,7805,8056,8312,8573,8840,9112
mov $3,$0
mov $4,$0
lpb $4
mov $0,$3
sub $4,1
sub $0,$4
mov $2,$0
pow $2,2
add $2,13
div $2,36
add $1,$2
lpe
mov $0,$1
| 35.294118 | 421 | 0.688333 | [
"Apache-2.0"
] | ckrause/cm | programs/oeis/177/A177337.asm | 600 | Assembly |
; A021152: Decimal expansion of 1/148.
; 0,0,6,7,5,6,7,5,6,7,5,6,7,5,6,7,5,6,7,5,6,7,5,6,7,5,6,7,5,6,7,5,6,7,5,6,7,5,6,7,5,6,7,5,6,7,5,6,7,5,6,7,5,6,7,5,6,7,5,6,7,5,6,7,5,6,7,5,6,7,5,6,7,5,6,7,5,6,7,5,6,7,5,6,7,5,6,7,5,6,7,5,6,7,5,6,7,5,6,7
lpb $0
sub $0,1
mod $0,3
add $0,5
add $1,$0
mov $0,1
lpe
mov $0,$1
| 26.583333 | 201 | 0.520376 | [
"Apache-2.0"
] | ckrause/cm | programs/oeis/021/A021152.asm | 319 | Assembly |
; A064990: If A_k denotes the first 3^k terms, then A_0 = 0, A_{k+1} = A_k A_k B_k, where B_k is obtained from A_k by interchanging 0's and 1's.
; 0,0,1,0,0,1,1,1,0,0,0,1,0,0,1,1,1,0,1,1,0,1,1,0,0,0,1,0,0,1,0,0,1,1,1,0,0,0,1,0,0,1,1,1,0,1,1,0,1,1,0,0,0,1,1,1,0,1,1,0,0,0,1,1,1,0,1,1,0,0,0,1,0,0,1,0,0,1,1,1,0,0,0,1,0,0,1,1,1,0,0,0,1,0,0,1,1,1,0
cal $0,81603 ; Number of 2's in ternary representation of n.
mod $0,2
mov $1,$0
| 60.857143 | 199 | 0.600939 | [
"Apache-2.0"
] | jmorken/loda | programs/oeis/064/A064990.asm | 426 | Assembly |
SUB SP, 3 ; Alloc space on stack
:begin
ADD PC, 2
:c0 DAT "*", 0
SET A, c0
BOR A, 0x8000
SET [0xffff], A
SET A, 0x1
SET [0xfffe], A
SET A, 0x0
SET [0xfffd], A
SET A, 0x6
SUB A, 1
SET PUSH, 0x20
MUL A, POP
SET X, A
SET A, 0x9
SUB A, 1
ADD X, A
ADD PC, 17
:c1 DAT "0x10c BASIC FTW!", 0
SET A, c1
BOR A, 0x8000
JSR print
JSR printnl
:l0
SET A, [0xfffe]
SET PUSH, A
SET A, 0x21
SET B, POP
SET C, 1
IFG A, B
SET C, 0
IFN C, 0
SET PC, l2
SET A, 0x1
SUB A, 1
SET PUSH, 0x20
MUL A, POP
SET X, A
SET A, [0xfffe]
SUB A, 1
ADD X, A
SET PC, l3
:l2
SET A, [0xfffe]
SET PUSH, A
SET A, 0x2c
SET B, POP
SET C, 1
IFG A, B
SET C, 0
IFN C, 0
SET PC, l4
SET A, 0x2
SET PUSH, A
SET A, [0xfffe]
SET PUSH, A
SET A, 0x21
SUB A, POP
SET PUSH, A
SET A, 0
SUB A, POP
ADD A, POP
SUB A, 1
SET PUSH, 0x20
MUL A, POP
SET X, A
SET A, 0x20
SUB A, 1
ADD X, A
SET PC, l5
:l4
SET A, [0xfffe]
SET PUSH, A
SET A, 0x4b
SET B, POP
SET C, 1
IFG A, B
SET C, 0
IFN C, 0
SET PC, l6
SET A, 0xc
SUB A, 1
SET PUSH, 0x20
MUL A, POP
SET X, A
SET A, 0x1f
SET PUSH, A
SET A, [0xfffe]
SET PUSH, A
SET A, 0x2c
SUB A, POP
SET PUSH, A
SET A, 0
SUB A, POP
SUB A, POP
SET PUSH, A
SET A, 0
SUB A, POP
SUB A, 1
ADD X, A
SET PC, l7
:l6
SET A, 0xb
SET PUSH, A
SET A, [0xfffe]
SET PUSH, A
SET A, 0x4b
SUB A, POP
SET PUSH, A
SET A, 0
SUB A, POP
SUB A, POP
SET PUSH, A
SET A, 0
SUB A, POP
SUB A, 1
SET PUSH, 0x20
MUL A, POP
SET X, A
SET A, 0x1
SUB A, 1
ADD X, A
:l7
:l5
:l3
SET A, [0xfffe]
SET PUSH, A
SET A, 0x3
SET B, POP
MOD B, A
SET A, B
SET B, 0
SET PUSH, A
SET A, [0xfffd]
SET B, POP
SET C, 1
IFE A, B
SET C, 0
IFN C, 0
SET PC, l8
SET A, 0xe
SET Y, 0
SHL A, 12
BOR Y, A
SET A, 0x0
SHL A, 8
BOR Y, A
SET PC, l9
:l8
SET A, 0x1
SET Y, 0
SHL A, 12
BOR Y, A
SET A, 0x0
SHL A, 8
BOR Y, A
:l9
SET A, [0xffff]
JSR print
JSR printnl
SET A, [0xfffe]
SET PUSH, A
SET A, 0x1
ADD A, POP
SET [0xfffe], A
SET A, [0xfffe]
SET PUSH, A
SET A, 0x55
SET B, POP
SET C, 1
IFG B, A
SET C, 0
IFN C, 0
SET PC, l10
SET A, 0x0
SET [0xfffe], A
SET A, [0xfffd]
SET PUSH, A
SET A, 0x1
ADD A, POP
SET [0xfffd], A
SET A, [0xfffd]
SET PUSH, A
SET A, 0x2
SET B, POP
SET C, 1
IFG B, A
SET C, 0
IFN C, 0
SET PC, l11
SET A, 0x0
SET [0xfffd], A
:l11
:l10
SET PC, l0
:l1
SET PC, crash
; compiled functions
:printchar
SET B, X
ADD B, 0x8000
BOR A, Y
SET [B], A
ADD X, 1
IFN X, 0x160
SET PC, pnline
SET X, 0
:pnline
SET PC, POP
:printint
SET I, 0
:printint1
SET B, A
MOD A, 0xa
ADD A, 0x30
SET PUSH, A
SET A, B
DIV A, 0xa
ADD I, 1
IFN A, 0
SET PC, printint1
:printint2
SET A, POP
JSR printchar
SUB I, 1
IFN I, 0
SET PC, printint2
SET A, POP
SET PC, POP
:printstr
AND A, 0x7fff
SET I, A
:printstr1
IFE [I], 0
SET PC, POP
SET A, [I]
JSR printchar
ADD I, 1
SET PC, printstr1
:printnl
DIV X, 32
ADD X, 1
MUL X, 32
SET PC, POP
:print
SET B, A
SHR B, 15
IFE B, 0
JSR printint
IFE B, 1
JSR printstr
SET PC, POP
:crash
SET PC, crash | 11.035156 | 32 | 0.63646 | [
"MIT"
] | lucaspiller/dcpu16-ide | programs/frame.asm | 2,825 | Assembly |
; A191907: Square array read by antidiagonals up: T(n,k) = -(n-1) if n divides k, else 1.
; Submitted by Jon Maiga
; 0,1,0,1,-1,0,1,1,1,0,1,1,-2,-1,0,1,1,1,1,1,0,1,1,1,-3,1,-1,0,1,1,1,1,1,-2,1,0,1,1,1,1,-4,1,1,-1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,-5,1,-3,-2,-1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,-6,1,1,1,1,-1,0,1,1,1,1,1,1,1,1,1
lpb $0
add $1,1
sub $0,$1
lpe
sub $0,1
sub $0,$1
add $1,2
gcd $1,$0
mov $2,$1
div $1,$0
mul $2,$1
add $2,1
mov $0,$2
| 25.166667 | 215 | 0.532009 | [
"Apache-2.0"
] | ckrause/loda-programs | oeis/191/A191907.asm | 453 | Assembly |
; A162214: a(n) = the largest positive multiple of n with exactly n digits when written in binary.
; 1,2,6,12,30,60,126,248,504,1020,2046,4092,8190,16380,32760,65520,131070,262134,524286,1048560,2097144,4194300,8388606,16777200,33554425,67108860,134217702,268435440,536870910,1073741820,2147483646,4294967264,8589934584,17179869180,34359738350,68719476708,137438953470,274877906940,549755813880,1099511627760,2199023255550,4398046511082,8796093022206,17592186044400,35184372088815,70368744177660,140737488355326,281474976710640,562949953421282,1125899906842600,2251799813685240,4503599627370480,9007199254740990
add $0,1
mov $1,$0
mov $2,2
pow $2,$0
sub $2,1
div $2,$0
mul $1,$2
add $1,3
lpb $0
mov $0,0
add $1,4
lpe
sub $1,7
| 43 | 512 | 0.813953 | [
"Apache-2.0"
] | jmorken/loda | programs/oeis/162/A162214.asm | 731 | Assembly |
; A192465: Constant term of the reduction by x^2->x+2 of the polynomial p(n,x)=1+x^n+x^(2n).
; 3,9,25,93,353,1389,5505,21933,87553,349869,1398785,5593773,22372353,89483949,357924865,1431677613,5726666753,22906579629,91626143745,366504225453,1466016202753,5864063412909,23456250855425,93824997829293
seq $0,92431 ; Numbers having in binary representation a leading 1 followed by n zeros and n-1 ones.
div $0,3
mul $0,2
add $0,3
| 53.5 | 205 | 0.785047 | [
"Apache-2.0"
] | ckrause/cm | programs/oeis/192/A192465.asm | 428 | Assembly |
;------------------------------------------------------------------------------
;
; CpuBreakpoint() for AArch64
;
; Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
; Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
; Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR>
; 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 CpuBreakpoint
; MS_CHANGE: change area name to |.text| and add an ALIGN directive
AREA |.text|, ALIGN=2, CODE, READONLY
;/**
; Generates a breakpoint on the CPU.
;
; Generates a breakpoint on the CPU. The breakpoint must be implemented such
; that code can resume normal execution after the breakpoint.
;
;**/
;VOID
;EFIAPI
;CpuBreakpoint (
; VOID
; );
;
CpuBreakpoint
brk 0xf000 ; MS_CHANGE: Change svc to brk for KdDxe support
ret
END
| 32.829268 | 85 | 0.623328 | [
"BSD-2-Clause"
] | changeworld/mu_basecore | MdePkg/Library/BaseLib/AArch64/CpuBreakpoint.asm | 1,346 | Assembly |
Map_360DD0: dc.w Frame_360DD8-Map_360DD0
dc.w Frame_360DEC-Map_360DD0
dc.w Frame_360E00-Map_360DD0
dc.w Frame_360E08-Map_360DD0
Frame_360DD8: dc.w 3
dc.b $F4, 5, 0, $A,$FF,$E8
dc.b $F4, 9, 0, 0,$FF,$F8
dc.b 4, $C, 0, 6,$FF,$F0
Frame_360DEC: dc.w 3
dc.b $F4, 5, 0, $E,$FF,$E8
dc.b $F4, 9, 0, 0,$FF,$F8
dc.b 4, $C, 0, 6,$FF,$F0
Frame_360E00: dc.w 1
dc.b $FC, 0, 0,$12,$FF,$FC
Frame_360E08: dc.w 1
dc.b $FC, 0, 0,$13,$FF,$FC
| 27.411765 | 40 | 0.579399 | [
"Apache-2.0"
] | NatsumiFox/AMPS-Sonic-3-Knuckles | General/Sprites/Blastoid/Map - Blastoid.asm | 466 | Assembly |
; A010003: a(0) = 1, a(n) = 11*n^2 + 2 for n>0.
; 1,13,46,101,178,277,398,541,706,893,1102,1333,1586,1861,2158,2477,2818,3181,3566,3973,4402,4853,5326,5821,6338,6877,7438,8021,8626,9253,9902,10573,11266,11981,12718,13477,14258,15061,15886,16733,17602,18493,19406,20341,21298,22277,23278,24301,25346,26413,27502,28613,29746,30901,32078,33277,34498,35741,37006,38293,39602,40933,42286,43661,45058,46477,47918,49381,50866,52373,53902,55453,57026,58621,60238,61877,63538,65221,66926,68653,70402,72173,73966,75781,77618,79477,81358,83261,85186,87133,89102,91093,93106,95141,97198,99277,101378,103501,105646,107813
pow $1,$0
gcd $1,2
mov $3,$0
mul $3,$0
mov $2,$3
mul $2,11
add $1,$2
mov $0,$1
| 57.416667 | 560 | 0.75762 | [
"Apache-2.0"
] | ckrause/cm | programs/oeis/010/A010003.asm | 689 | Assembly |
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r8
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_normal_ht+0x1197b, %r8
cmp $45619, %r11
movb (%r8), %r12b
nop
xor $56473, %rcx
lea addresses_WT_ht+0x1a17b, %rsi
nop
nop
nop
nop
add %rbx, %rbx
movb $0x61, (%rsi)
nop
nop
cmp $37631, %rsi
lea addresses_WT_ht+0x1a97b, %rsi
lea addresses_A_ht+0x19f23, %rdi
nop
cmp $46144, %rdx
mov $87, %rcx
rep movsl
nop
nop
cmp $42458, %rcx
lea addresses_WC_ht+0x15841, %rdi
nop
nop
nop
nop
nop
mfence
mov (%rdi), %dx
nop
nop
nop
nop
xor %r12, %r12
lea addresses_WT_ht+0x108d3, %r8
nop
sub %rcx, %rcx
movb (%r8), %r12b
nop
cmp %r12, %r12
lea addresses_D_ht+0x1990f, %r11
inc %rsi
movb $0x61, (%r11)
nop
nop
cmp $29306, %rdi
lea addresses_WT_ht+0x143d5, %rbx
nop
nop
nop
xor %rdx, %rdx
mov $0x6162636465666768, %r11
movq %r11, %xmm5
vmovups %ymm5, (%rbx)
and %r11, %r11
lea addresses_WC_ht+0x1c57b, %rcx
nop
nop
nop
nop
nop
add $13480, %rbx
mov (%rcx), %r8
nop
nop
nop
nop
xor %rdx, %rdx
lea addresses_D_ht+0x116bb, %rsi
nop
and $21982, %rbx
vmovups (%rsi), %ymm0
vextracti128 $1, %ymm0, %xmm0
vpextrq $0, %xmm0, %r11
nop
nop
nop
cmp %rcx, %rcx
lea addresses_D_ht+0x12c0b, %r11
cmp $58457, %rsi
movb (%r11), %cl
nop
nop
nop
nop
sub %rcx, %rcx
lea addresses_A_ht+0xd77b, %rsi
lea addresses_WT_ht+0x1a37b, %rdi
clflush (%rdi)
nop
nop
nop
nop
xor $32121, %rdx
mov $123, %rcx
rep movsq
nop
nop
cmp %rcx, %rcx
lea addresses_WT_ht+0xd85b, %rbx
nop
nop
nop
nop
nop
xor $26904, %rdx
mov (%rbx), %esi
nop
add %rdx, %rdx
lea addresses_A_ht+0x1107b, %rsi
lea addresses_A_ht+0x1bc4b, %rdi
nop
nop
nop
nop
nop
add %rbx, %rbx
mov $41, %rcx
rep movsw
sub $39434, %r11
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r8
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r13
push %r15
push %rbp
push %rbx
push %rdi
// Load
lea addresses_normal+0x677b, %rdi
nop
nop
nop
dec %rbp
movups (%rdi), %xmm5
vpextrq $0, %xmm5, %r13
nop
sub %rbp, %rbp
// Load
lea addresses_UC+0xfafb, %r10
nop
nop
nop
nop
nop
and %r12, %r12
movb (%r10), %r13b
sub %r12, %r12
// Store
lea addresses_UC+0x14d9f, %rdi
nop
nop
nop
nop
cmp %rbp, %rbp
mov $0x5152535455565758, %r13
movq %r13, %xmm3
movups %xmm3, (%rdi)
nop
nop
cmp %rdi, %rdi
// Store
lea addresses_A+0x1c8af, %r10
nop
nop
nop
nop
and $3560, %rbx
mov $0x5152535455565758, %rbp
movq %rbp, %xmm4
vmovups %ymm4, (%r10)
nop
nop
nop
nop
nop
cmp %rbp, %rbp
// Store
mov $0x34a883000000097b, %rdi
nop
nop
nop
nop
nop
dec %rbx
mov $0x5152535455565758, %r15
movq %r15, %xmm6
vmovups %ymm6, (%rdi)
sub %r12, %r12
// Store
lea addresses_D+0x1a7fb, %r13
nop
and $1885, %rdi
mov $0x5152535455565758, %r15
movq %r15, %xmm4
movups %xmm4, (%r13)
nop
nop
add %r13, %r13
// Faulty Load
lea addresses_A+0x1577b, %r13
nop
add $43758, %r15
vmovups (%r13), %ymm3
vextracti128 $0, %ymm3, %xmm3
vpextrq $0, %xmm3, %rdi
lea oracles, %rbx
and $0xff, %rdi
shlq $12, %rdi
mov (%rbx,%rdi,1), %rdi
pop %rdi
pop %rbx
pop %rbp
pop %r15
pop %r13
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_A', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_NC', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_A', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 2, 'same': True}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 1, 'AVXalign': True, 'NT': False, 'congruent': 2, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 8, 'AVXalign': True, 'NT': False, 'congruent': 7, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 3, 'same': False}}
{'00': 16378, '45': 1305, '34': 591, '49': 201, '02': 72, '48': 49, '30': 10, '47': 26, '78': 10, '08': 33, '44': 11, 'b8': 3, '46': 17, 'c0': 4, '60': 4, '31': 1, '50': 1}
00 00 00 00 00 45 00 00 34 45 45 00 00 00 00 00 45 00 49 02 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 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 48 00 45 00 00 00 00 45 00 45 34 45 00 45 00 00 34 00 00 00 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 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 45 02 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 45 34 49 00 34 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 34 00 00 45 00 45 00 00 48 00 00 00 00 00 00 45 00 00 00 30 00 00 49 45 45 00 34 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 00 00 00 00 47 78 00 00 34 00 00 00 00 00 00 45 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 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 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 45 00 00 34 00 00 00 00 00 34 00 00 49 34 08 00 00 00 00 02 49 34 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 34 47 48 00 00 00 00 00 00 00 00 45 34 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 34 00 00 00 08 00 00 34 00 00 00 00 49 00 00 00 45 00 34 00 00 00 00 45 45 49 45 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 45 34 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00 34 00 00 49 00 00 45 00 00 45 00 00 00 00 00 45 34 00 00 00 00 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 00 00 00 00 00 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 00 00 00 00 00 00 34 45 00 00 34 00 00 00 00 45 00 00 34 00 00 00 00 00 00 00 00 00 00 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 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 48 00 00 34 00 00 00 08 00 00 00 00 00 00 00 45 00 44 00 00 00 34 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 34 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 34 00 49 00 00 00 00 45 00 45 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 45 00 00 00 00 00 00 00 00 08 00 00 00 45 45 00 34 00 00 00 00 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 00 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 00 45 00 45 00 45 00 00 00 00 00 00 00 00 00 00 34 00 00 00 45 00 00 00 45 00 34 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 31.917857 | 2,999 | 0.647309 | [
"MIT"
] | danielmgmi/medusa | Transynther/_processed/NONE/_ht_st_zr_un_/i7-8650U_0xd2_notsx.log_18716_1005.asm | 8,937 | Assembly |
;----------------------------------------------------------------------------
; TPE-GEN - This program generates 50 TPE encrypted test files
;
; This source can be compiled with MASM 5.0 or TASM 2.01
; (and perhaps others too, but this is not tested.)
;----------------------------------------------------------------------------
.model tiny
.RADIX 16
.code
extrn crypt:near ;external routines in engine
extrn rnd_get:near
extrn rnd_init:near
org 0100
begin: call rnd_init ;init. random number generator
mov dx,offset starttxt ;print message
mov ah,09
int 21
mov cx,50d ;repeat 50 times
lop: push cx
mov ah,3C ;create a new file
mov dx,offset filename
mov cx,0020
int 21
xchg ax,bx
push ds
push es
push bx
mov ax,cs ;input parameters for engine
mov ds,ax
add ax,0400
mov es,ax ;ES = DS + 400h
xor si,si ;code will be right after decr.
mov dx,offset hello ;this will be encrtypted
mov cx,100d ;length of code to encrypt
mov bp,0100 ;decryptor will start at 100h
call rnd_get ;AX register will be random
call crypt ;call the engine
pop bx ;write crypted file
mov ah,40
int 21
mov ah,3E ;close the file
int 21
pop es
pop ds
mov di,offset filename ;adjust name for next file
mov bx,7 ; (increment number)
incnum: inc byte ptr ds:[bx+di]
cmp byte ptr ds:[bx+di],'9'
jbe numok
mov byte ptr ds:[bx+di],'0'
dec bx
jnz incnum
numok: pop cx ;do it again...
loop lop
exit: int 20
;----------------------------------------------------------------------------
; Text and data
;----------------------------------------------------------------------------
starttxt db 'TPE-GEN - Generates 50 TPE encrypted test files.'
db 0Dh, 0Ah, '$'
filename db '00000000.COM',0
;----------------------------------------------------------------------------
; The small test file that will be encrypted
;----------------------------------------------------------------------------
hello: call next ;get relative offset
next: pop dx
add dx,10d ;find begin of message
mov ah,09 ;print message
int 21
int 20
db 'Hello, world!', 0Dh, 0A, '$'
db (100d) dup (90)
end begin
| 35.544554 | 79 | 0.323955 | [
"MIT"
] | 010001111/Family | MSDOS/Virus.MSDOS.Unknown.tpe-gen.asm | 3,590 | Assembly |
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r14
push %r8
push %r9
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x132dc, %r8
nop
cmp %r14, %r14
mov $0x6162636465666768, %rsi
movq %rsi, %xmm5
vmovups %ymm5, (%r8)
nop
nop
xor $25299, %rcx
lea addresses_normal_ht+0x1e8dc, %r14
nop
nop
xor %r11, %r11
mov (%r14), %esi
nop
nop
nop
nop
cmp %r14, %r14
lea addresses_normal_ht+0x1a58a, %rsi
lea addresses_WC_ht+0x1c7dc, %rdi
nop
nop
nop
nop
add $21343, %r11
mov $37, %rcx
rep movsb
nop
nop
nop
cmp $9821, %r11
lea addresses_normal_ht+0xd10, %r14
sub $38582, %rdi
movups (%r14), %xmm4
vpextrq $1, %xmm4, %rcx
nop
nop
nop
nop
nop
cmp $41301, %rdi
lea addresses_normal_ht+0xb0dc, %rsi
lea addresses_A_ht+0x2fdc, %rdi
clflush (%rdi)
sub $40851, %r9
mov $51, %rcx
rep movsq
xor %rdi, %rdi
lea addresses_UC_ht+0x690c, %r8
nop
nop
nop
nop
nop
inc %rsi
vmovups (%r8), %ymm2
vextracti128 $1, %ymm2, %xmm2
vpextrq $0, %xmm2, %r14
nop
nop
nop
cmp $15732, %r9
lea addresses_WT_ht+0xcfde, %rsi
xor %r11, %r11
mov (%rsi), %rdi
nop
nop
nop
nop
xor %r9, %r9
lea addresses_D_ht+0xbb13, %rdi
and $54670, %rsi
mov (%rdi), %r11d
nop
nop
nop
sub $36651, %r9
lea addresses_WT_ht+0xc2bc, %r14
xor $65107, %rcx
movups (%r14), %xmm2
vpextrq $0, %xmm2, %rdi
nop
xor %r9, %r9
pop %rsi
pop %rdi
pop %rcx
pop %r9
pop %r8
pop %r14
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r9
push %rax
push %rbx
push %rdx
push %rsi
// Store
lea addresses_A+0x259c, %rax
cmp %r10, %r10
mov $0x5152535455565758, %rdx
movq %rdx, %xmm1
movntdq %xmm1, (%rax)
add $21086, %r9
// Store
lea addresses_WT+0xd99c, %r10
nop
add $8124, %rbx
mov $0x5152535455565758, %rdx
movq %rdx, %xmm2
vmovups %ymm2, (%r10)
dec %rdx
// Faulty Load
lea addresses_A+0x19bdc, %rsi
nop
nop
nop
cmp $16050, %rdx
vmovups (%rsi), %ymm1
vextracti128 $0, %ymm1, %xmm1
vpextrq $1, %xmm1, %r9
lea oracles, %rax
and $0xff, %r9
shlq $12, %r9
mov (%rax,%r9,1), %r9
pop %rsi
pop %rdx
pop %rbx
pop %rax
pop %r9
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_A', 'same': False, 'size': 16, 'congruent': 0, 'NT': True, 'AVXalign': True}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_A', 'same': False, 'size': 16, 'congruent': 6, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WT', 'same': False, 'size': 32, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'type': 'addresses_A', 'same': True, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 32, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_normal_ht', 'same': True, 'size': 4, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 16, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_UC_ht', 'same': False, 'size': 32, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_D_ht', 'same': False, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 16, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'00': 133}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 24.187135 | 398 | 0.648936 | [
"MIT"
] | danielmgmi/medusa | Transynther/_processed/NONE/_zr_/i3-7100_9_0x84_notsx.log_133_1620.asm | 4,136 | Assembly |
SafariZoneNorthRestHouse_Object:
db $a ; border block
def_warps
warp 2, 7, 8, SAFARI_ZONE_NORTH
warp 3, 7, 8, SAFARI_ZONE_NORTH
def_signs
def_objects
object SPRITE_SCIENTIST, 6, 3, WALK, LEFT_RIGHT, 1 ; person
object SPRITE_SAFARI_ZONE_WORKER, 3, 4, STAY, NONE, 2 ; person
object SPRITE_GENTLEMAN, 1, 5, WALK, UP_DOWN, 3 ; person
def_warps_to SAFARI_ZONE_NORTH_REST_HOUSE
| 24.375 | 63 | 0.761538 | [
"CC0-1.0"
] | opiter09/ASM-Machina | data/maps/objects/SafariZoneNorthRestHouse.asm | 390 | Assembly |
; identical test with i36b.asm, but first empty lines are included, to raise max-line
; number in listing file to two digits
INC_DEPTH=0
INCLUDE "i36b_II.i.asm"
| 13.307692 | 85 | 0.722543 | [
"BSD-3-Clause"
] | Ckirby101/sjasmplus | tests/misc/nested_includes/i36b_I.asm | 173 | Assembly |
dnl AMD64 mpn_popcount, mpn_hamdist -- population count and hamming distance.
dnl Copyright 2004, 2005, 2007, 2010-2012 Free Software Foundation, Inc.
dnl This file is part of the GNU MP Library.
dnl
dnl The GNU MP Library is free software; you can redistribute it and/or modify
dnl it under the terms of either:
dnl
dnl * the GNU Lesser General Public License as published by the Free
dnl Software Foundation; either version 3 of the License, or (at your
dnl option) any later version.
dnl
dnl or
dnl
dnl * the GNU General Public License as published by the Free Software
dnl Foundation; either version 2 of the License, or (at your option) any
dnl later version.
dnl
dnl or both in parallel, as here.
dnl
dnl The GNU MP Library is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
dnl for more details.
dnl
dnl You should have received copies of the GNU General Public License and the
dnl GNU Lesser General Public License along with the GNU MP Library. If not,
dnl see https://www.gnu.org/licenses/.
include(`../config.m4')
C popcount hamdist
C cycles/limb cycles/limb
C AMD K8,K9 6 7
C AMD K10 6 7
C Intel P4 12 14.3
C Intel core2 7 8
C Intel corei ? 7.3
C Intel atom 16.5 17.5
C VIA nano 8.75 10.4
C TODO
C * Tune. It should be possible to reach 5 c/l for popcount and 6 c/l for
C hamdist for K8/K9.
ifdef(`OPERATION_popcount',`
define(`func',`mpn_popcount')
define(`up', `%rdi')
define(`n', `%rsi')
define(`h55555555', `%r10')
define(`h33333333', `%r11')
define(`h0f0f0f0f', `%rcx')
define(`h01010101', `%rdx')
define(`POP', `$1')
define(`HAM', `dnl')
')
ifdef(`OPERATION_hamdist',`
define(`func',`mpn_hamdist')
define(`up', `%rdi')
define(`vp', `%rsi')
define(`n', `%rdx')
define(`h55555555', `%r10')
define(`h33333333', `%r11')
define(`h0f0f0f0f', `%rcx')
define(`h01010101', `%r14')
define(`POP', `dnl')
define(`HAM', `$1')
')
MULFUNC_PROLOGUE(mpn_popcount mpn_hamdist)
ABI_SUPPORT(DOS64)
ABI_SUPPORT(STD64)
ASM_START()
TEXT
ALIGN(32)
PROLOGUE(func)
POP(` FUNC_ENTRY(2) ')
HAM(` FUNC_ENTRY(3) ')
push %r12
push %r13
HAM(` push %r14 ')
mov $0x5555555555555555, h55555555
mov $0x3333333333333333, h33333333
mov $0x0f0f0f0f0f0f0f0f, h0f0f0f0f
mov $0x0101010101010101, h01010101
lea (up,n,8), up
HAM(` lea (vp,n,8), vp ')
neg n
xor R32(%rax), R32(%rax)
bt $0, R32(n)
jnc L(top)
mov (up,n,8), %r8
HAM(` xor (vp,n,8), %r8 ')
mov %r8, %r9
shr %r8
and h55555555, %r8
sub %r8, %r9
mov %r9, %r8
shr $2, %r9
and h33333333, %r8
and h33333333, %r9
add %r8, %r9 C 16 4-bit fields (0..4)
mov %r9, %r8
shr $4, %r9
and h0f0f0f0f, %r8
and h0f0f0f0f, %r9
add %r8, %r9 C 8 8-bit fields (0..16)
imul h01010101, %r9 C sum the 8 fields in high 8 bits
shr $56, %r9
mov %r9, %rax C add to total
add $1, n
jz L(end)
ALIGN(16)
L(top): mov (up,n,8), %r8
mov 8(up,n,8), %r12
HAM(` xor (vp,n,8), %r8 ')
HAM(` xor 8(vp,n,8), %r12 ')
mov %r8, %r9
mov %r12, %r13
shr %r8
shr %r12
and h55555555, %r8
and h55555555, %r12
sub %r8, %r9
sub %r12, %r13
mov %r9, %r8
mov %r13, %r12
shr $2, %r9
shr $2, %r13
and h33333333, %r8
and h33333333, %r9
and h33333333, %r12
and h33333333, %r13
add %r8, %r9 C 16 4-bit fields (0..4)
add %r12, %r13 C 16 4-bit fields (0..4)
add %r13, %r9 C 16 4-bit fields (0..8)
mov %r9, %r8
shr $4, %r9
and h0f0f0f0f, %r8
and h0f0f0f0f, %r9
add %r8, %r9 C 8 8-bit fields (0..16)
imul h01010101, %r9 C sum the 8 fields in high 8 bits
shr $56, %r9
add %r9, %rax C add to total
add $2, n
jnc L(top)
L(end):
HAM(` pop %r14 ')
pop %r13
pop %r12
FUNC_EXIT()
ret
EPILOGUE()
| 21.769663 | 79 | 0.64929 | [
"MIT"
] | csMOOC/Stanford.Cryptography | week6/gmp-5.0.5/mpn/hamdist.asm | 24 | Assembly |
* Zap Thing from list v0.00 Feb 1988 J.R.Oakley QJUMP
*
section thing
*
include 'dev8_keys_chp'
include 'dev8_keys_err'
include 'dev8_keys_qlv'
include 'dev8_keys_sys'
include 'dev8_keys_thg'
*
xref th_find
xref th_rechp
xref th_frmth
xref th_exit
*
xdef th_zthg
xdef th_hrzap
*
*+++
* This removes a thing from the thing list, as well as any Jobs using the
* thing at the moment. Note that it is the responsibility of the calling
* code to return the linkage block to the heap if necessary.
*
* Registers:
* Entry Exit
* D0 0, FEX, IMEM
* D6 current Job preserved
* A0 name of thing
* A1 linkage block
* A6 system variables preserved
*---
th_zthg
jsr th_find(pc) ; is there a thing of this name?
bne.s thr_exit ; no, bother
move.l a1,a0 ; point to linkage
bsr.s thz_rmth ; unlink and remove
*
thr_exit
jmp th_exit(pc)
*+++
* Zap a Thing because its owner has been forcibly removed: this is a "close"
* routine pointed to as a Thing linkage block's "driver".
*
* Registers:
* Entry Exit
* A0 linkage heap header
* A1-A3 smashed
* A6 system variables preserved
*---
th_hrzap
hrzreg reg d6
movem.l hrzreg,-(sp)
moveq #0,d6 ; pretend current job is system
lea chp_end(a0),a0 ; point to usual linkage block
bsr.s thz_rmth
movem.l (sp)+,hrzreg
rts
*
thz_rmth
lea sys_thgl(a6),a1
move.w mem.rlst,a2
jsr (a2) ; unlink from the Thing list
move.l a0,a1
jsr th_frmth(pc) ; force remove the Thing
moveq #0,d0 ; no problems from "close"
rts
*
end
| 31.366197 | 76 | 0.476426 | [
"BSD-2-Clause"
] | olifink/smsqe | util/thg/zthg.asm | 2,227 | Assembly |
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0xe5ac, %rsi
lea addresses_WC_ht+0x82fc, %rdi
nop
nop
nop
xor %rbx, %rbx
mov $47, %rcx
rep movsl
add $39422, %r11
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r13
push %r14
push %r15
push %r8
// Faulty Load
lea addresses_US+0x17f1c, %r11
and %r13, %r13
vmovaps (%r11), %ymm4
vextracti128 $0, %ymm4, %xmm4
vpextrq $0, %xmm4, %r15
lea oracles, %r13
and $0xff, %r15
shlq $12, %r15
mov (%r13,%r15,1), %r15
pop %r8
pop %r15
pop %r14
pop %r13
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'AVXalign': True, 'congruent': 0, 'size': 32, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 4, 'same': False}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 66.403226 | 2,999 | 0.663833 | [
"MIT"
] | danielmgmi/medusa | Transynther/_processed/AVXALIGN/_zr_/i7-7700_9_0x48.log_21829_1278.asm | 4,117 | Assembly |
.686
.model flat,stdcall
option casemap:none
include .\bnlib.inc
include .\bignum.inc
.code
bnSquare proc uses ebx esi edi bnX:DWORD
LOCAL tmpProd
bnSCreateX tmpProd
xor eax,eax
mov esi,bnX
inc eax
mov edi,tmpProd
mov eax,[esi]
add eax,eax
.if eax <= BN_MAX_DWORD
mov [edi],eax
call _bn_square_basecase
mov edi,tmpProd
mov ecx,[edi].BN.dwSize
call _bn_normalize
.endif
invoke bnMov,bnX,tmpProd
bnSDestroyX
ret
bnSquare endp
end
| 15.586207 | 40 | 0.75 | [
"MIT"
] | 0xFF1E071F/Crypto-Hash | BigNum/Mod/Base/bnSquare.asm | 452 | Assembly |
_stressfs: file format elf32-i386
Disassembly of section .text:
00000000 <main>:
#include "fs.h"
#include "fcntl.h"
int
main(int argc, char *argv[])
{
0: 8d 4c 24 04 lea 0x4(%esp),%ecx
4: 83 e4 f0 and $0xfffffff0,%esp
int fd, i;
char path[] = "stressfs0";
7: b8 30 00 00 00 mov $0x30,%eax
{
c: ff 71 fc pushl -0x4(%ecx)
f: 55 push %ebp
10: 89 e5 mov %esp,%ebp
12: 57 push %edi
13: 56 push %esi
char data[512];
printf(1, "stressfs starting\n");
memset(data, 'a', sizeof(data));
14: 8d b5 e8 fd ff ff lea -0x218(%ebp),%esi
{
1a: 53 push %ebx
for(i = 0; i < 4; i++)
1b: 31 db xor %ebx,%ebx
{
1d: 51 push %ecx
1e: 81 ec 20 02 00 00 sub $0x220,%esp
char path[] = "stressfs0";
24: 66 89 85 e6 fd ff ff mov %ax,-0x21a(%ebp)
printf(1, "stressfs starting\n");
2b: 68 88 08 00 00 push $0x888
30: 6a 01 push $0x1
char path[] = "stressfs0";
32: c7 85 de fd ff ff 73 movl $0x65727473,-0x222(%ebp)
39: 74 72 65
3c: c7 85 e2 fd ff ff 73 movl $0x73667373,-0x21e(%ebp)
43: 73 66 73
printf(1, "stressfs starting\n");
46: e8 d5 04 00 00 call 520 <printf>
memset(data, 'a', sizeof(data));
4b: 83 c4 0c add $0xc,%esp
4e: 68 00 02 00 00 push $0x200
53: 6a 61 push $0x61
55: 56 push %esi
56: e8 95 01 00 00 call 1f0 <memset>
5b: 83 c4 10 add $0x10,%esp
if(fork() > 0)
5e: e8 28 03 00 00 call 38b <fork>
63: 85 c0 test %eax,%eax
65: 0f 8f bf 00 00 00 jg 12a <main+0x12a>
for(i = 0; i < 4; i++)
6b: 83 c3 01 add $0x1,%ebx
6e: 83 fb 04 cmp $0x4,%ebx
71: 75 eb jne 5e <main+0x5e>
73: bf 04 00 00 00 mov $0x4,%edi
break;
printf(1, "write %d\n", i);
78: 83 ec 04 sub $0x4,%esp
7b: 53 push %ebx
path[8] += i;
fd = open(path, O_CREATE | O_RDWR);
7c: bb 14 00 00 00 mov $0x14,%ebx
printf(1, "write %d\n", i);
81: 68 9b 08 00 00 push $0x89b
86: 6a 01 push $0x1
88: e8 93 04 00 00 call 520 <printf>
path[8] += i;
8d: 89 f8 mov %edi,%eax
fd = open(path, O_CREATE | O_RDWR);
8f: 5f pop %edi
path[8] += i;
90: 00 85 e6 fd ff ff add %al,-0x21a(%ebp)
fd = open(path, O_CREATE | O_RDWR);
96: 58 pop %eax
97: 8d 85 de fd ff ff lea -0x222(%ebp),%eax
9d: 68 02 02 00 00 push $0x202
a2: 50 push %eax
a3: e8 2b 03 00 00 call 3d3 <open>
a8: 83 c4 10 add $0x10,%esp
ab: 89 c7 mov %eax,%edi
for(i = 0; i < 20; i++)
ad: 8d 76 00 lea 0x0(%esi),%esi
// printf(fd, "%d\n", i);
write(fd, data, sizeof(data));
b0: 83 ec 04 sub $0x4,%esp
b3: 68 00 02 00 00 push $0x200
b8: 56 push %esi
b9: 57 push %edi
ba: e8 f4 02 00 00 call 3b3 <write>
for(i = 0; i < 20; i++)
bf: 83 c4 10 add $0x10,%esp
c2: 83 eb 01 sub $0x1,%ebx
c5: 75 e9 jne b0 <main+0xb0>
close(fd);
c7: 83 ec 0c sub $0xc,%esp
ca: 57 push %edi
cb: e8 eb 02 00 00 call 3bb <close>
printf(1, "read\n");
d0: 58 pop %eax
d1: 5a pop %edx
d2: 68 a5 08 00 00 push $0x8a5
d7: 6a 01 push $0x1
d9: e8 42 04 00 00 call 520 <printf>
fd = open(path, O_RDONLY);
de: 8d 85 de fd ff ff lea -0x222(%ebp),%eax
e4: 59 pop %ecx
e5: 5b pop %ebx
e6: 6a 00 push $0x0
e8: bb 14 00 00 00 mov $0x14,%ebx
ed: 50 push %eax
ee: e8 e0 02 00 00 call 3d3 <open>
f3: 83 c4 10 add $0x10,%esp
f6: 89 c7 mov %eax,%edi
for (i = 0; i < 20; i++)
f8: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
ff: 90 nop
read(fd, data, sizeof(data));
100: 83 ec 04 sub $0x4,%esp
103: 68 00 02 00 00 push $0x200
108: 56 push %esi
109: 57 push %edi
10a: e8 9c 02 00 00 call 3ab <read>
for (i = 0; i < 20; i++)
10f: 83 c4 10 add $0x10,%esp
112: 83 eb 01 sub $0x1,%ebx
115: 75 e9 jne 100 <main+0x100>
close(fd);
117: 83 ec 0c sub $0xc,%esp
11a: 57 push %edi
11b: e8 9b 02 00 00 call 3bb <close>
wait();
120: e8 76 02 00 00 call 39b <wait>
exit();
125: e8 69 02 00 00 call 393 <exit>
12a: 89 df mov %ebx,%edi
12c: e9 47 ff ff ff jmp 78 <main+0x78>
131: 66 90 xchg %ax,%ax
133: 66 90 xchg %ax,%ax
135: 66 90 xchg %ax,%ax
137: 66 90 xchg %ax,%ax
139: 66 90 xchg %ax,%ax
13b: 66 90 xchg %ax,%ax
13d: 66 90 xchg %ax,%ax
13f: 90 nop
00000140 <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, char *t)
{
140: 55 push %ebp
char *os;
os = s;
while((*s++ = *t++) != 0)
141: 31 c0 xor %eax,%eax
{
143: 89 e5 mov %esp,%ebp
145: 53 push %ebx
146: 8b 4d 08 mov 0x8(%ebp),%ecx
149: 8b 5d 0c mov 0xc(%ebp),%ebx
14c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
while((*s++ = *t++) != 0)
150: 0f b6 14 03 movzbl (%ebx,%eax,1),%edx
154: 88 14 01 mov %dl,(%ecx,%eax,1)
157: 83 c0 01 add $0x1,%eax
15a: 84 d2 test %dl,%dl
15c: 75 f2 jne 150 <strcpy+0x10>
;
return os;
}
15e: 89 c8 mov %ecx,%eax
160: 5b pop %ebx
161: 5d pop %ebp
162: c3 ret
163: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
16a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
00000170 <strcmp>:
int
strcmp(const char *p, const char *q)
{
170: 55 push %ebp
171: 89 e5 mov %esp,%ebp
173: 53 push %ebx
174: 8b 4d 08 mov 0x8(%ebp),%ecx
177: 8b 55 0c mov 0xc(%ebp),%edx
while(*p && *p == *q)
17a: 0f b6 01 movzbl (%ecx),%eax
17d: 0f b6 1a movzbl (%edx),%ebx
180: 84 c0 test %al,%al
182: 75 1d jne 1a1 <strcmp+0x31>
184: eb 2a jmp 1b0 <strcmp+0x40>
186: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
18d: 8d 76 00 lea 0x0(%esi),%esi
190: 0f b6 41 01 movzbl 0x1(%ecx),%eax
p++, q++;
194: 83 c1 01 add $0x1,%ecx
197: 83 c2 01 add $0x1,%edx
while(*p && *p == *q)
19a: 0f b6 1a movzbl (%edx),%ebx
19d: 84 c0 test %al,%al
19f: 74 0f je 1b0 <strcmp+0x40>
1a1: 38 d8 cmp %bl,%al
1a3: 74 eb je 190 <strcmp+0x20>
return (uchar)*p - (uchar)*q;
1a5: 29 d8 sub %ebx,%eax
}
1a7: 5b pop %ebx
1a8: 5d pop %ebp
1a9: c3 ret
1aa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
1b0: 31 c0 xor %eax,%eax
return (uchar)*p - (uchar)*q;
1b2: 29 d8 sub %ebx,%eax
}
1b4: 5b pop %ebx
1b5: 5d pop %ebp
1b6: c3 ret
1b7: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
1be: 66 90 xchg %ax,%ax
000001c0 <strlen>:
uint
strlen(char *s)
{
1c0: 55 push %ebp
1c1: 89 e5 mov %esp,%ebp
1c3: 8b 55 08 mov 0x8(%ebp),%edx
int n;
for(n = 0; s[n]; n++)
1c6: 80 3a 00 cmpb $0x0,(%edx)
1c9: 74 15 je 1e0 <strlen+0x20>
1cb: 31 c0 xor %eax,%eax
1cd: 8d 76 00 lea 0x0(%esi),%esi
1d0: 83 c0 01 add $0x1,%eax
1d3: 80 3c 02 00 cmpb $0x0,(%edx,%eax,1)
1d7: 89 c1 mov %eax,%ecx
1d9: 75 f5 jne 1d0 <strlen+0x10>
;
return n;
}
1db: 89 c8 mov %ecx,%eax
1dd: 5d pop %ebp
1de: c3 ret
1df: 90 nop
for(n = 0; s[n]; n++)
1e0: 31 c9 xor %ecx,%ecx
}
1e2: 5d pop %ebp
1e3: 89 c8 mov %ecx,%eax
1e5: c3 ret
1e6: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
1ed: 8d 76 00 lea 0x0(%esi),%esi
000001f0 <memset>:
void*
memset(void *dst, int c, uint n)
{
1f0: 55 push %ebp
1f1: 89 e5 mov %esp,%ebp
1f3: 57 push %edi
1f4: 8b 55 08 mov 0x8(%ebp),%edx
}
static inline void
stosb(void *addr, int data, int cnt)
{
asm volatile("cld; rep stosb" :
1f7: 8b 4d 10 mov 0x10(%ebp),%ecx
1fa: 8b 45 0c mov 0xc(%ebp),%eax
1fd: 89 d7 mov %edx,%edi
1ff: fc cld
200: f3 aa rep stos %al,%es:(%edi)
stosb(dst, c, n);
return dst;
}
202: 89 d0 mov %edx,%eax
204: 5f pop %edi
205: 5d pop %ebp
206: c3 ret
207: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
20e: 66 90 xchg %ax,%ax
00000210 <strchr>:
char*
strchr(const char *s, char c)
{
210: 55 push %ebp
211: 89 e5 mov %esp,%ebp
213: 8b 45 08 mov 0x8(%ebp),%eax
216: 0f b6 4d 0c movzbl 0xc(%ebp),%ecx
for(; *s; s++)
21a: 0f b6 10 movzbl (%eax),%edx
21d: 84 d2 test %dl,%dl
21f: 75 12 jne 233 <strchr+0x23>
221: eb 1d jmp 240 <strchr+0x30>
223: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
227: 90 nop
228: 0f b6 50 01 movzbl 0x1(%eax),%edx
22c: 83 c0 01 add $0x1,%eax
22f: 84 d2 test %dl,%dl
231: 74 0d je 240 <strchr+0x30>
if(*s == c)
233: 38 d1 cmp %dl,%cl
235: 75 f1 jne 228 <strchr+0x18>
return (char*)s;
return 0;
}
237: 5d pop %ebp
238: c3 ret
239: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
return 0;
240: 31 c0 xor %eax,%eax
}
242: 5d pop %ebp
243: c3 ret
244: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
24b: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
24f: 90 nop
00000250 <gets>:
char*
gets(char *buf, int max)
{
250: 55 push %ebp
251: 89 e5 mov %esp,%ebp
253: 57 push %edi
254: 56 push %esi
int i, cc;
char c;
for(i=0; i+1 < max; ){
255: 31 f6 xor %esi,%esi
{
257: 53 push %ebx
258: 89 f3 mov %esi,%ebx
25a: 83 ec 1c sub $0x1c,%esp
25d: 8b 7d 08 mov 0x8(%ebp),%edi
for(i=0; i+1 < max; ){
260: eb 2f jmp 291 <gets+0x41>
262: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
cc = read(0, &c, 1);
268: 83 ec 04 sub $0x4,%esp
26b: 8d 45 e7 lea -0x19(%ebp),%eax
26e: 6a 01 push $0x1
270: 50 push %eax
271: 6a 00 push $0x0
273: e8 33 01 00 00 call 3ab <read>
if(cc < 1)
278: 83 c4 10 add $0x10,%esp
27b: 85 c0 test %eax,%eax
27d: 7e 1c jle 29b <gets+0x4b>
break;
buf[i++] = c;
27f: 0f b6 45 e7 movzbl -0x19(%ebp),%eax
283: 83 c7 01 add $0x1,%edi
286: 88 47 ff mov %al,-0x1(%edi)
if(c == '\n' || c == '\r')
289: 3c 0a cmp $0xa,%al
28b: 74 23 je 2b0 <gets+0x60>
28d: 3c 0d cmp $0xd,%al
28f: 74 1f je 2b0 <gets+0x60>
for(i=0; i+1 < max; ){
291: 83 c3 01 add $0x1,%ebx
294: 89 fe mov %edi,%esi
296: 3b 5d 0c cmp 0xc(%ebp),%ebx
299: 7c cd jl 268 <gets+0x18>
29b: 89 f3 mov %esi,%ebx
break;
}
buf[i] = '\0';
return buf;
}
29d: 8b 45 08 mov 0x8(%ebp),%eax
buf[i] = '\0';
2a0: c6 03 00 movb $0x0,(%ebx)
}
2a3: 8d 65 f4 lea -0xc(%ebp),%esp
2a6: 5b pop %ebx
2a7: 5e pop %esi
2a8: 5f pop %edi
2a9: 5d pop %ebp
2aa: c3 ret
2ab: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
2af: 90 nop
2b0: 8b 75 08 mov 0x8(%ebp),%esi
2b3: 8b 45 08 mov 0x8(%ebp),%eax
2b6: 01 de add %ebx,%esi
2b8: 89 f3 mov %esi,%ebx
buf[i] = '\0';
2ba: c6 03 00 movb $0x0,(%ebx)
}
2bd: 8d 65 f4 lea -0xc(%ebp),%esp
2c0: 5b pop %ebx
2c1: 5e pop %esi
2c2: 5f pop %edi
2c3: 5d pop %ebp
2c4: c3 ret
2c5: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
2cc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
000002d0 <stat>:
int
stat(char *n, struct stat *st)
{
2d0: 55 push %ebp
2d1: 89 e5 mov %esp,%ebp
2d3: 56 push %esi
2d4: 53 push %ebx
int fd;
int r;
fd = open(n, O_RDONLY);
2d5: 83 ec 08 sub $0x8,%esp
2d8: 6a 00 push $0x0
2da: ff 75 08 pushl 0x8(%ebp)
2dd: e8 f1 00 00 00 call 3d3 <open>
if(fd < 0)
2e2: 83 c4 10 add $0x10,%esp
2e5: 85 c0 test %eax,%eax
2e7: 78 27 js 310 <stat+0x40>
return -1;
r = fstat(fd, st);
2e9: 83 ec 08 sub $0x8,%esp
2ec: ff 75 0c pushl 0xc(%ebp)
2ef: 89 c3 mov %eax,%ebx
2f1: 50 push %eax
2f2: e8 f4 00 00 00 call 3eb <fstat>
close(fd);
2f7: 89 1c 24 mov %ebx,(%esp)
r = fstat(fd, st);
2fa: 89 c6 mov %eax,%esi
close(fd);
2fc: e8 ba 00 00 00 call 3bb <close>
return r;
301: 83 c4 10 add $0x10,%esp
}
304: 8d 65 f8 lea -0x8(%ebp),%esp
307: 89 f0 mov %esi,%eax
309: 5b pop %ebx
30a: 5e pop %esi
30b: 5d pop %ebp
30c: c3 ret
30d: 8d 76 00 lea 0x0(%esi),%esi
return -1;
310: be ff ff ff ff mov $0xffffffff,%esi
315: eb ed jmp 304 <stat+0x34>
317: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
31e: 66 90 xchg %ax,%ax
00000320 <atoi>:
int
atoi(const char *s)
{
320: 55 push %ebp
321: 89 e5 mov %esp,%ebp
323: 53 push %ebx
324: 8b 55 08 mov 0x8(%ebp),%edx
int n;
n = 0;
while('0' <= *s && *s <= '9')
327: 0f be 02 movsbl (%edx),%eax
32a: 8d 48 d0 lea -0x30(%eax),%ecx
32d: 80 f9 09 cmp $0x9,%cl
n = 0;
330: b9 00 00 00 00 mov $0x0,%ecx
while('0' <= *s && *s <= '9')
335: 77 1e ja 355 <atoi+0x35>
337: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
33e: 66 90 xchg %ax,%ax
n = n*10 + *s++ - '0';
340: 83 c2 01 add $0x1,%edx
343: 8d 0c 89 lea (%ecx,%ecx,4),%ecx
346: 8d 4c 48 d0 lea -0x30(%eax,%ecx,2),%ecx
while('0' <= *s && *s <= '9')
34a: 0f be 02 movsbl (%edx),%eax
34d: 8d 58 d0 lea -0x30(%eax),%ebx
350: 80 fb 09 cmp $0x9,%bl
353: 76 eb jbe 340 <atoi+0x20>
return n;
}
355: 89 c8 mov %ecx,%eax
357: 5b pop %ebx
358: 5d pop %ebp
359: c3 ret
35a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
00000360 <memmove>:
void*
memmove(void *vdst, void *vsrc, int n)
{
360: 55 push %ebp
361: 89 e5 mov %esp,%ebp
363: 57 push %edi
364: 8b 45 10 mov 0x10(%ebp),%eax
367: 8b 55 08 mov 0x8(%ebp),%edx
36a: 56 push %esi
36b: 8b 75 0c mov 0xc(%ebp),%esi
char *dst, *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
36e: 85 c0 test %eax,%eax
370: 7e 13 jle 385 <memmove+0x25>
372: 01 d0 add %edx,%eax
dst = vdst;
374: 89 d7 mov %edx,%edi
376: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
37d: 8d 76 00 lea 0x0(%esi),%esi
*dst++ = *src++;
380: a4 movsb %ds:(%esi),%es:(%edi)
while(n-- > 0)
381: 39 f8 cmp %edi,%eax
383: 75 fb jne 380 <memmove+0x20>
return vdst;
}
385: 5e pop %esi
386: 89 d0 mov %edx,%eax
388: 5f pop %edi
389: 5d pop %ebp
38a: c3 ret
0000038b <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
38b: b8 01 00 00 00 mov $0x1,%eax
390: cd 40 int $0x40
392: c3 ret
00000393 <exit>:
SYSCALL(exit)
393: b8 02 00 00 00 mov $0x2,%eax
398: cd 40 int $0x40
39a: c3 ret
0000039b <wait>:
SYSCALL(wait)
39b: b8 03 00 00 00 mov $0x3,%eax
3a0: cd 40 int $0x40
3a2: c3 ret
000003a3 <pipe>:
SYSCALL(pipe)
3a3: b8 04 00 00 00 mov $0x4,%eax
3a8: cd 40 int $0x40
3aa: c3 ret
000003ab <read>:
SYSCALL(read)
3ab: b8 05 00 00 00 mov $0x5,%eax
3b0: cd 40 int $0x40
3b2: c3 ret
000003b3 <write>:
SYSCALL(write)
3b3: b8 10 00 00 00 mov $0x10,%eax
3b8: cd 40 int $0x40
3ba: c3 ret
000003bb <close>:
SYSCALL(close)
3bb: b8 15 00 00 00 mov $0x15,%eax
3c0: cd 40 int $0x40
3c2: c3 ret
000003c3 <kill>:
SYSCALL(kill)
3c3: b8 06 00 00 00 mov $0x6,%eax
3c8: cd 40 int $0x40
3ca: c3 ret
000003cb <exec>:
SYSCALL(exec)
3cb: b8 07 00 00 00 mov $0x7,%eax
3d0: cd 40 int $0x40
3d2: c3 ret
000003d3 <open>:
SYSCALL(open)
3d3: b8 0f 00 00 00 mov $0xf,%eax
3d8: cd 40 int $0x40
3da: c3 ret
000003db <mknod>:
SYSCALL(mknod)
3db: b8 11 00 00 00 mov $0x11,%eax
3e0: cd 40 int $0x40
3e2: c3 ret
000003e3 <unlink>:
SYSCALL(unlink)
3e3: b8 12 00 00 00 mov $0x12,%eax
3e8: cd 40 int $0x40
3ea: c3 ret
000003eb <fstat>:
SYSCALL(fstat)
3eb: b8 08 00 00 00 mov $0x8,%eax
3f0: cd 40 int $0x40
3f2: c3 ret
000003f3 <link>:
SYSCALL(link)
3f3: b8 13 00 00 00 mov $0x13,%eax
3f8: cd 40 int $0x40
3fa: c3 ret
000003fb <mkdir>:
SYSCALL(mkdir)
3fb: b8 14 00 00 00 mov $0x14,%eax
400: cd 40 int $0x40
402: c3 ret
00000403 <chdir>:
SYSCALL(chdir)
403: b8 09 00 00 00 mov $0x9,%eax
408: cd 40 int $0x40
40a: c3 ret
0000040b <dup>:
SYSCALL(dup)
40b: b8 0a 00 00 00 mov $0xa,%eax
410: cd 40 int $0x40
412: c3 ret
00000413 <getpid>:
SYSCALL(getpid)
413: b8 0b 00 00 00 mov $0xb,%eax
418: cd 40 int $0x40
41a: c3 ret
0000041b <sbrk>:
SYSCALL(sbrk)
41b: b8 0c 00 00 00 mov $0xc,%eax
420: cd 40 int $0x40
422: c3 ret
00000423 <sleep>:
SYSCALL(sleep)
423: b8 0d 00 00 00 mov $0xd,%eax
428: cd 40 int $0x40
42a: c3 ret
0000042b <uptime>:
SYSCALL(uptime)
42b: b8 0e 00 00 00 mov $0xe,%eax
430: cd 40 int $0x40
432: c3 ret
00000433 <date>:
SYSCALL(date) // date system call added for part 1
433: b8 16 00 00 00 mov $0x16,%eax
438: cd 40 int $0x40
43a: c3 ret
0000043b <getuid>:
SYSCALL(getuid) //Gets the UID of a process
43b: b8 17 00 00 00 mov $0x17,%eax
440: cd 40 int $0x40
442: c3 ret
00000443 <getgid>:
SYSCALL(getgid) //Gets the GID of a process
443: b8 18 00 00 00 mov $0x18,%eax
448: cd 40 int $0x40
44a: c3 ret
0000044b <getppid>:
SYSCALL(getppid) //Gets the PPID of a process
44b: b8 19 00 00 00 mov $0x19,%eax
450: cd 40 int $0x40
452: c3 ret
00000453 <setuid>:
SYSCALL(setuid) //Sets a new UID for a process
453: b8 1a 00 00 00 mov $0x1a,%eax
458: cd 40 int $0x40
45a: c3 ret
0000045b <setgid>:
SYSCALL(setgid) //Sets a new GID for a process
45b: b8 1b 00 00 00 mov $0x1b,%eax
460: cd 40 int $0x40
462: c3 ret
00000463 <cps>:
SYSCALL(cps)
463: b8 1c 00 00 00 mov $0x1c,%eax
468: cd 40 int $0x40
46a: c3 ret
46b: 66 90 xchg %ax,%ax
46d: 66 90 xchg %ax,%ax
46f: 90 nop
00000470 <printint>:
write(fd, &c, 1);
}
static void
printint(int fd, int xx, int base, int sgn)
{
470: 55 push %ebp
471: 89 e5 mov %esp,%ebp
473: 57 push %edi
474: 56 push %esi
475: 53 push %ebx
476: 83 ec 3c sub $0x3c,%esp
479: 89 4d c4 mov %ecx,-0x3c(%ebp)
uint x;
neg = 0;
if(sgn && xx < 0){
neg = 1;
x = -xx;
47c: 89 d1 mov %edx,%ecx
{
47e: 89 45 b8 mov %eax,-0x48(%ebp)
if(sgn && xx < 0){
481: 85 d2 test %edx,%edx
483: 0f 89 7f 00 00 00 jns 508 <printint+0x98>
489: f6 45 08 01 testb $0x1,0x8(%ebp)
48d: 74 79 je 508 <printint+0x98>
neg = 1;
48f: c7 45 bc 01 00 00 00 movl $0x1,-0x44(%ebp)
x = -xx;
496: f7 d9 neg %ecx
} else {
x = xx;
}
i = 0;
498: 31 db xor %ebx,%ebx
49a: 8d 75 d7 lea -0x29(%ebp),%esi
49d: 8d 76 00 lea 0x0(%esi),%esi
do{
buf[i++] = digits[x % base];
4a0: 89 c8 mov %ecx,%eax
4a2: 31 d2 xor %edx,%edx
4a4: 89 cf mov %ecx,%edi
4a6: f7 75 c4 divl -0x3c(%ebp)
4a9: 0f b6 92 b4 08 00 00 movzbl 0x8b4(%edx),%edx
4b0: 89 45 c0 mov %eax,-0x40(%ebp)
4b3: 89 d8 mov %ebx,%eax
4b5: 8d 5b 01 lea 0x1(%ebx),%ebx
}while((x /= base) != 0);
4b8: 8b 4d c0 mov -0x40(%ebp),%ecx
buf[i++] = digits[x % base];
4bb: 88 14 1e mov %dl,(%esi,%ebx,1)
}while((x /= base) != 0);
4be: 39 7d c4 cmp %edi,-0x3c(%ebp)
4c1: 76 dd jbe 4a0 <printint+0x30>
if(neg)
4c3: 8b 4d bc mov -0x44(%ebp),%ecx
4c6: 85 c9 test %ecx,%ecx
4c8: 74 0c je 4d6 <printint+0x66>
buf[i++] = '-';
4ca: c6 44 1d d8 2d movb $0x2d,-0x28(%ebp,%ebx,1)
buf[i++] = digits[x % base];
4cf: 89 d8 mov %ebx,%eax
buf[i++] = '-';
4d1: ba 2d 00 00 00 mov $0x2d,%edx
while(--i >= 0)
4d6: 8b 7d b8 mov -0x48(%ebp),%edi
4d9: 8d 5c 05 d7 lea -0x29(%ebp,%eax,1),%ebx
4dd: eb 07 jmp 4e6 <printint+0x76>
4df: 90 nop
4e0: 0f b6 13 movzbl (%ebx),%edx
4e3: 83 eb 01 sub $0x1,%ebx
write(fd, &c, 1);
4e6: 83 ec 04 sub $0x4,%esp
4e9: 88 55 d7 mov %dl,-0x29(%ebp)
4ec: 6a 01 push $0x1
4ee: 56 push %esi
4ef: 57 push %edi
4f0: e8 be fe ff ff call 3b3 <write>
while(--i >= 0)
4f5: 83 c4 10 add $0x10,%esp
4f8: 39 de cmp %ebx,%esi
4fa: 75 e4 jne 4e0 <printint+0x70>
putc(fd, buf[i]);
}
4fc: 8d 65 f4 lea -0xc(%ebp),%esp
4ff: 5b pop %ebx
500: 5e pop %esi
501: 5f pop %edi
502: 5d pop %ebp
503: c3 ret
504: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
neg = 0;
508: c7 45 bc 00 00 00 00 movl $0x0,-0x44(%ebp)
50f: eb 87 jmp 498 <printint+0x28>
511: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
518: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
51f: 90 nop
00000520 <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
520: 55 push %ebp
521: 89 e5 mov %esp,%ebp
523: 57 push %edi
524: 56 push %esi
525: 53 push %ebx
526: 83 ec 2c sub $0x2c,%esp
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
529: 8b 75 0c mov 0xc(%ebp),%esi
52c: 0f b6 1e movzbl (%esi),%ebx
52f: 84 db test %bl,%bl
531: 0f 84 b8 00 00 00 je 5ef <printf+0xcf>
ap = (uint*)(void*)&fmt + 1;
537: 8d 45 10 lea 0x10(%ebp),%eax
53a: 83 c6 01 add $0x1,%esi
write(fd, &c, 1);
53d: 8d 7d e7 lea -0x19(%ebp),%edi
state = 0;
540: 31 d2 xor %edx,%edx
ap = (uint*)(void*)&fmt + 1;
542: 89 45 d0 mov %eax,-0x30(%ebp)
545: eb 37 jmp 57e <printf+0x5e>
547: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
54e: 66 90 xchg %ax,%ax
550: 89 55 d4 mov %edx,-0x2c(%ebp)
c = fmt[i] & 0xff;
if(state == 0){
if(c == '%'){
state = '%';
553: ba 25 00 00 00 mov $0x25,%edx
if(c == '%'){
558: 83 f8 25 cmp $0x25,%eax
55b: 74 17 je 574 <printf+0x54>
write(fd, &c, 1);
55d: 83 ec 04 sub $0x4,%esp
560: 88 5d e7 mov %bl,-0x19(%ebp)
563: 6a 01 push $0x1
565: 57 push %edi
566: ff 75 08 pushl 0x8(%ebp)
569: e8 45 fe ff ff call 3b3 <write>
56e: 8b 55 d4 mov -0x2c(%ebp),%edx
} else {
putc(fd, c);
571: 83 c4 10 add $0x10,%esp
for(i = 0; fmt[i]; i++){
574: 0f b6 1e movzbl (%esi),%ebx
577: 83 c6 01 add $0x1,%esi
57a: 84 db test %bl,%bl
57c: 74 71 je 5ef <printf+0xcf>
c = fmt[i] & 0xff;
57e: 0f be cb movsbl %bl,%ecx
581: 0f b6 c3 movzbl %bl,%eax
if(state == 0){
584: 85 d2 test %edx,%edx
586: 74 c8 je 550 <printf+0x30>
}
} else if(state == '%'){
588: 83 fa 25 cmp $0x25,%edx
58b: 75 e7 jne 574 <printf+0x54>
if(c == 'd'){
58d: 83 f8 64 cmp $0x64,%eax
590: 0f 84 9a 00 00 00 je 630 <printf+0x110>
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
596: 81 e1 f7 00 00 00 and $0xf7,%ecx
59c: 83 f9 70 cmp $0x70,%ecx
59f: 74 5f je 600 <printf+0xe0>
printint(fd, *ap, 16, 0);
ap++;
} else if(c == 's'){
5a1: 83 f8 73 cmp $0x73,%eax
5a4: 0f 84 d6 00 00 00 je 680 <printf+0x160>
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
5aa: 83 f8 63 cmp $0x63,%eax
5ad: 0f 84 8d 00 00 00 je 640 <printf+0x120>
putc(fd, *ap);
ap++;
} else if(c == '%'){
5b3: 83 f8 25 cmp $0x25,%eax
5b6: 0f 84 b4 00 00 00 je 670 <printf+0x150>
write(fd, &c, 1);
5bc: 83 ec 04 sub $0x4,%esp
5bf: c6 45 e7 25 movb $0x25,-0x19(%ebp)
5c3: 6a 01 push $0x1
5c5: 57 push %edi
5c6: ff 75 08 pushl 0x8(%ebp)
5c9: e8 e5 fd ff ff call 3b3 <write>
putc(fd, c);
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
5ce: 88 5d e7 mov %bl,-0x19(%ebp)
write(fd, &c, 1);
5d1: 83 c4 0c add $0xc,%esp
5d4: 6a 01 push $0x1
5d6: 83 c6 01 add $0x1,%esi
5d9: 57 push %edi
5da: ff 75 08 pushl 0x8(%ebp)
5dd: e8 d1 fd ff ff call 3b3 <write>
for(i = 0; fmt[i]; i++){
5e2: 0f b6 5e ff movzbl -0x1(%esi),%ebx
putc(fd, c);
5e6: 83 c4 10 add $0x10,%esp
}
state = 0;
5e9: 31 d2 xor %edx,%edx
for(i = 0; fmt[i]; i++){
5eb: 84 db test %bl,%bl
5ed: 75 8f jne 57e <printf+0x5e>
}
}
}
5ef: 8d 65 f4 lea -0xc(%ebp),%esp
5f2: 5b pop %ebx
5f3: 5e pop %esi
5f4: 5f pop %edi
5f5: 5d pop %ebp
5f6: c3 ret
5f7: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
5fe: 66 90 xchg %ax,%ax
printint(fd, *ap, 16, 0);
600: 83 ec 0c sub $0xc,%esp
603: b9 10 00 00 00 mov $0x10,%ecx
608: 6a 00 push $0x0
60a: 8b 5d d0 mov -0x30(%ebp),%ebx
60d: 8b 45 08 mov 0x8(%ebp),%eax
610: 8b 13 mov (%ebx),%edx
612: e8 59 fe ff ff call 470 <printint>
ap++;
617: 89 d8 mov %ebx,%eax
619: 83 c4 10 add $0x10,%esp
state = 0;
61c: 31 d2 xor %edx,%edx
ap++;
61e: 83 c0 04 add $0x4,%eax
621: 89 45 d0 mov %eax,-0x30(%ebp)
624: e9 4b ff ff ff jmp 574 <printf+0x54>
629: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
printint(fd, *ap, 10, 1);
630: 83 ec 0c sub $0xc,%esp
633: b9 0a 00 00 00 mov $0xa,%ecx
638: 6a 01 push $0x1
63a: eb ce jmp 60a <printf+0xea>
63c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
putc(fd, *ap);
640: 8b 5d d0 mov -0x30(%ebp),%ebx
write(fd, &c, 1);
643: 83 ec 04 sub $0x4,%esp
putc(fd, *ap);
646: 8b 03 mov (%ebx),%eax
write(fd, &c, 1);
648: 6a 01 push $0x1
ap++;
64a: 83 c3 04 add $0x4,%ebx
write(fd, &c, 1);
64d: 57 push %edi
64e: ff 75 08 pushl 0x8(%ebp)
putc(fd, *ap);
651: 88 45 e7 mov %al,-0x19(%ebp)
write(fd, &c, 1);
654: e8 5a fd ff ff call 3b3 <write>
ap++;
659: 89 5d d0 mov %ebx,-0x30(%ebp)
65c: 83 c4 10 add $0x10,%esp
state = 0;
65f: 31 d2 xor %edx,%edx
661: e9 0e ff ff ff jmp 574 <printf+0x54>
666: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
66d: 8d 76 00 lea 0x0(%esi),%esi
putc(fd, c);
670: 88 5d e7 mov %bl,-0x19(%ebp)
write(fd, &c, 1);
673: 83 ec 04 sub $0x4,%esp
676: e9 59 ff ff ff jmp 5d4 <printf+0xb4>
67b: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
67f: 90 nop
s = (char*)*ap;
680: 8b 45 d0 mov -0x30(%ebp),%eax
683: 8b 18 mov (%eax),%ebx
ap++;
685: 83 c0 04 add $0x4,%eax
688: 89 45 d0 mov %eax,-0x30(%ebp)
if(s == 0)
68b: 85 db test %ebx,%ebx
68d: 74 17 je 6a6 <printf+0x186>
while(*s != 0){
68f: 0f b6 03 movzbl (%ebx),%eax
state = 0;
692: 31 d2 xor %edx,%edx
while(*s != 0){
694: 84 c0 test %al,%al
696: 0f 84 d8 fe ff ff je 574 <printf+0x54>
69c: 89 75 d4 mov %esi,-0x2c(%ebp)
69f: 89 de mov %ebx,%esi
6a1: 8b 5d 08 mov 0x8(%ebp),%ebx
6a4: eb 1a jmp 6c0 <printf+0x1a0>
s = "(null)";
6a6: bb ab 08 00 00 mov $0x8ab,%ebx
while(*s != 0){
6ab: 89 75 d4 mov %esi,-0x2c(%ebp)
6ae: b8 28 00 00 00 mov $0x28,%eax
6b3: 89 de mov %ebx,%esi
6b5: 8b 5d 08 mov 0x8(%ebp),%ebx
6b8: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
6bf: 90 nop
write(fd, &c, 1);
6c0: 83 ec 04 sub $0x4,%esp
s++;
6c3: 83 c6 01 add $0x1,%esi
6c6: 88 45 e7 mov %al,-0x19(%ebp)
write(fd, &c, 1);
6c9: 6a 01 push $0x1
6cb: 57 push %edi
6cc: 53 push %ebx
6cd: e8 e1 fc ff ff call 3b3 <write>
while(*s != 0){
6d2: 0f b6 06 movzbl (%esi),%eax
6d5: 83 c4 10 add $0x10,%esp
6d8: 84 c0 test %al,%al
6da: 75 e4 jne 6c0 <printf+0x1a0>
6dc: 8b 75 d4 mov -0x2c(%ebp),%esi
state = 0;
6df: 31 d2 xor %edx,%edx
6e1: e9 8e fe ff ff jmp 574 <printf+0x54>
6e6: 66 90 xchg %ax,%ax
6e8: 66 90 xchg %ax,%ax
6ea: 66 90 xchg %ax,%ax
6ec: 66 90 xchg %ax,%ax
6ee: 66 90 xchg %ax,%ax
000006f0 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
6f0: 55 push %ebp
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
6f1: a1 6c 0b 00 00 mov 0xb6c,%eax
{
6f6: 89 e5 mov %esp,%ebp
6f8: 57 push %edi
6f9: 56 push %esi
6fa: 53 push %ebx
6fb: 8b 5d 08 mov 0x8(%ebp),%ebx
6fe: 8b 10 mov (%eax),%edx
bp = (Header*)ap - 1;
700: 8d 4b f8 lea -0x8(%ebx),%ecx
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
703: 39 c8 cmp %ecx,%eax
705: 73 19 jae 720 <free+0x30>
707: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
70e: 66 90 xchg %ax,%ax
710: 39 d1 cmp %edx,%ecx
712: 72 14 jb 728 <free+0x38>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
714: 39 d0 cmp %edx,%eax
716: 73 10 jae 728 <free+0x38>
{
718: 89 d0 mov %edx,%eax
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
71a: 8b 10 mov (%eax),%edx
71c: 39 c8 cmp %ecx,%eax
71e: 72 f0 jb 710 <free+0x20>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
720: 39 d0 cmp %edx,%eax
722: 72 f4 jb 718 <free+0x28>
724: 39 d1 cmp %edx,%ecx
726: 73 f0 jae 718 <free+0x28>
break;
if(bp + bp->s.size == p->s.ptr){
728: 8b 73 fc mov -0x4(%ebx),%esi
72b: 8d 3c f1 lea (%ecx,%esi,8),%edi
72e: 39 fa cmp %edi,%edx
730: 74 1e je 750 <free+0x60>
bp->s.size += p->s.ptr->s.size;
bp->s.ptr = p->s.ptr->s.ptr;
} else
bp->s.ptr = p->s.ptr;
732: 89 53 f8 mov %edx,-0x8(%ebx)
if(p + p->s.size == bp){
735: 8b 50 04 mov 0x4(%eax),%edx
738: 8d 34 d0 lea (%eax,%edx,8),%esi
73b: 39 f1 cmp %esi,%ecx
73d: 74 28 je 767 <free+0x77>
p->s.size += bp->s.size;
p->s.ptr = bp->s.ptr;
} else
p->s.ptr = bp;
73f: 89 08 mov %ecx,(%eax)
freep = p;
}
741: 5b pop %ebx
freep = p;
742: a3 6c 0b 00 00 mov %eax,0xb6c
}
747: 5e pop %esi
748: 5f pop %edi
749: 5d pop %ebp
74a: c3 ret
74b: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
74f: 90 nop
bp->s.size += p->s.ptr->s.size;
750: 03 72 04 add 0x4(%edx),%esi
753: 89 73 fc mov %esi,-0x4(%ebx)
bp->s.ptr = p->s.ptr->s.ptr;
756: 8b 10 mov (%eax),%edx
758: 8b 12 mov (%edx),%edx
75a: 89 53 f8 mov %edx,-0x8(%ebx)
if(p + p->s.size == bp){
75d: 8b 50 04 mov 0x4(%eax),%edx
760: 8d 34 d0 lea (%eax,%edx,8),%esi
763: 39 f1 cmp %esi,%ecx
765: 75 d8 jne 73f <free+0x4f>
p->s.size += bp->s.size;
767: 03 53 fc add -0x4(%ebx),%edx
freep = p;
76a: a3 6c 0b 00 00 mov %eax,0xb6c
p->s.size += bp->s.size;
76f: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
772: 8b 53 f8 mov -0x8(%ebx),%edx
775: 89 10 mov %edx,(%eax)
}
777: 5b pop %ebx
778: 5e pop %esi
779: 5f pop %edi
77a: 5d pop %ebp
77b: c3 ret
77c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
00000780 <malloc>:
return freep;
}
void*
malloc(uint nbytes)
{
780: 55 push %ebp
781: 89 e5 mov %esp,%ebp
783: 57 push %edi
784: 56 push %esi
785: 53 push %ebx
786: 83 ec 1c sub $0x1c,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
789: 8b 45 08 mov 0x8(%ebp),%eax
if((prevp = freep) == 0){
78c: 8b 3d 6c 0b 00 00 mov 0xb6c,%edi
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
792: 8d 70 07 lea 0x7(%eax),%esi
795: c1 ee 03 shr $0x3,%esi
798: 83 c6 01 add $0x1,%esi
if((prevp = freep) == 0){
79b: 85 ff test %edi,%edi
79d: 0f 84 ad 00 00 00 je 850 <malloc+0xd0>
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
7a3: 8b 07 mov (%edi),%eax
if(p->s.size >= nunits){
7a5: 8b 48 04 mov 0x4(%eax),%ecx
7a8: 39 f1 cmp %esi,%ecx
7aa: 73 71 jae 81d <malloc+0x9d>
7ac: 81 fe 00 10 00 00 cmp $0x1000,%esi
7b2: bb 00 10 00 00 mov $0x1000,%ebx
7b7: 0f 43 de cmovae %esi,%ebx
p = sbrk(nu * sizeof(Header));
7ba: 8d 0c dd 00 00 00 00 lea 0x0(,%ebx,8),%ecx
7c1: 89 4d e4 mov %ecx,-0x1c(%ebp)
7c4: eb 1b jmp 7e1 <malloc+0x61>
7c6: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
7cd: 8d 76 00 lea 0x0(%esi),%esi
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
7d0: 8b 10 mov (%eax),%edx
if(p->s.size >= nunits){
7d2: 8b 4a 04 mov 0x4(%edx),%ecx
7d5: 39 f1 cmp %esi,%ecx
7d7: 73 4f jae 828 <malloc+0xa8>
7d9: 8b 3d 6c 0b 00 00 mov 0xb6c,%edi
7df: 89 d0 mov %edx,%eax
p->s.size = nunits;
}
freep = prevp;
return (void*)(p + 1);
}
if(p == freep)
7e1: 39 c7 cmp %eax,%edi
7e3: 75 eb jne 7d0 <malloc+0x50>
p = sbrk(nu * sizeof(Header));
7e5: 83 ec 0c sub $0xc,%esp
7e8: ff 75 e4 pushl -0x1c(%ebp)
7eb: e8 2b fc ff ff call 41b <sbrk>
if(p == (char*)-1)
7f0: 83 c4 10 add $0x10,%esp
7f3: 83 f8 ff cmp $0xffffffff,%eax
7f6: 74 1b je 813 <malloc+0x93>
hp->s.size = nu;
7f8: 89 58 04 mov %ebx,0x4(%eax)
free((void*)(hp + 1));
7fb: 83 ec 0c sub $0xc,%esp
7fe: 83 c0 08 add $0x8,%eax
801: 50 push %eax
802: e8 e9 fe ff ff call 6f0 <free>
return freep;
807: a1 6c 0b 00 00 mov 0xb6c,%eax
if((p = morecore(nunits)) == 0)
80c: 83 c4 10 add $0x10,%esp
80f: 85 c0 test %eax,%eax
811: 75 bd jne 7d0 <malloc+0x50>
return 0;
}
}
813: 8d 65 f4 lea -0xc(%ebp),%esp
return 0;
816: 31 c0 xor %eax,%eax
}
818: 5b pop %ebx
819: 5e pop %esi
81a: 5f pop %edi
81b: 5d pop %ebp
81c: c3 ret
if(p->s.size >= nunits){
81d: 89 c2 mov %eax,%edx
81f: 89 f8 mov %edi,%eax
821: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
if(p->s.size == nunits)
828: 39 ce cmp %ecx,%esi
82a: 74 54 je 880 <malloc+0x100>
p->s.size -= nunits;
82c: 29 f1 sub %esi,%ecx
82e: 89 4a 04 mov %ecx,0x4(%edx)
p += p->s.size;
831: 8d 14 ca lea (%edx,%ecx,8),%edx
p->s.size = nunits;
834: 89 72 04 mov %esi,0x4(%edx)
freep = prevp;
837: a3 6c 0b 00 00 mov %eax,0xb6c
}
83c: 8d 65 f4 lea -0xc(%ebp),%esp
return (void*)(p + 1);
83f: 8d 42 08 lea 0x8(%edx),%eax
}
842: 5b pop %ebx
843: 5e pop %esi
844: 5f pop %edi
845: 5d pop %ebp
846: c3 ret
847: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
84e: 66 90 xchg %ax,%ax
base.s.ptr = freep = prevp = &base;
850: c7 05 6c 0b 00 00 70 movl $0xb70,0xb6c
857: 0b 00 00
base.s.size = 0;
85a: bf 70 0b 00 00 mov $0xb70,%edi
base.s.ptr = freep = prevp = &base;
85f: c7 05 70 0b 00 00 70 movl $0xb70,0xb70
866: 0b 00 00
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
869: 89 f8 mov %edi,%eax
base.s.size = 0;
86b: c7 05 74 0b 00 00 00 movl $0x0,0xb74
872: 00 00 00
if(p->s.size >= nunits){
875: e9 32 ff ff ff jmp 7ac <malloc+0x2c>
87a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
prevp->s.ptr = p->s.ptr;
880: 8b 0a mov (%edx),%ecx
882: 89 08 mov %ecx,(%eax)
884: eb b1 jmp 837 <malloc+0xb7>
| 33.975849 | 60 | 0.416034 | [
"MIT-0"
] | TRamirez97/CSE460-HW02 | stressfs.asm | 45,018 | Assembly |
; A047478: Numbers that are congruent to {1, 5, 7} mod 8.
; 1,5,7,9,13,15,17,21,23,25,29,31,33,37,39,41,45,47,49,53,55,57,61,63,65,69,71,73,77,79,81,85,87,89,93,95,97,101,103,105,109,111,113,117,119,121,125,127,129,133,135,137,141,143,145,149,151,153,157,159,161,165,167,169,173,175,177,181,183,185,189,191,193,197,199,201,205,207,209,213,215,217,221,223,225,229,231,233,237,239,241,245,247,249,253,255,257,261,263,265,269,271,273,277,279,281,285,287,289,293,295,297,301,303,305,309,311,313,317,319,321,325,327,329,333,335,337,341,343,345,349,351,353,357,359,361,365,367,369,373,375,377,381,383,385,389,391,393,397,399,401,405,407,409,413,415,417,421,423,425,429,431,433,437,439,441,445,447,449,453,455,457,461,463,465,469,471,473,477,479,481,485,487,489,493,495,497,501,503,505,509,511,513,517,519,521,525,527,529,533,535,537,541,543,545,549,551,553,557,559,561,565,567,569,573,575,577,581,583,585,589,591,593,597,599,601,605,607,609,613,615,617,621,623,625,629,631,633,637,639,641,645,647,649,653,655,657,661,663,665
mov $1,4
mul $1,$0
add $1,2
div $1,3
mul $1,2
add $1,1
| 107.5 | 960 | 0.723721 | [
"Apache-2.0"
] | jmorken/loda | programs/oeis/047/A047478.asm | 1,075 | Assembly |
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %rbp
push %rbx
push %rdx
lea addresses_WC_ht+0x1d310, %rbx
nop
nop
nop
nop
nop
and $30012, %rbp
mov $0x6162636465666768, %r11
movq %r11, %xmm2
movups %xmm2, (%rbx)
nop
nop
nop
nop
nop
xor $43163, %rdx
pop %rdx
pop %rbx
pop %rbp
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r14
push %rbp
push %rbx
push %rcx
push %rdx
// Store
lea addresses_RW+0x5f10, %rbp
nop
nop
nop
nop
sub %rbx, %rbx
movb $0x51, (%rbp)
nop
add $28103, %rbx
// Load
lea addresses_UC+0x6710, %rbx
clflush (%rbx)
nop
nop
nop
nop
sub $64226, %r10
movb (%rbx), %dl
nop
nop
add %rdx, %rdx
// Faulty Load
lea addresses_US+0x710, %rdx
nop
nop
nop
nop
add %rcx, %rcx
mov (%rdx), %rbp
lea oracles, %rbx
and $0xff, %rbp
shlq $12, %rbp
mov (%rbx,%rbp,1), %rbp
pop %rdx
pop %rcx
pop %rbx
pop %rbp
pop %r14
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_US', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 10, 'NT': False, 'type': 'addresses_RW', 'size': 1, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 10, 'NT': False, 'type': 'addresses_UC', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_US', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 10, 'NT': False, 'type': 'addresses_WC_ht', 'size': 16, 'AVXalign': False}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 48.021053 | 2,999 | 0.659579 | [
"MIT"
] | danielmgmi/medusa | Transynther/_processed/US/_zr_/i3-7100_9_0xca_notsx.log_21829_308.asm | 4,562 | Assembly |
; A186387: Adjusted joint rank sequence of (f(i)) and (g(j)) with f(i) before g(j) when f(i)=g(j), where f(i)=6i and g(j)=j(j+1)/2 (triangular number). Complement of A186388.
; 3,6,8,10,12,13,15,17,18,20,21,23,24,26,27,29,30,32,33,34,36,37,39,40,41,43,44,45,47,48,49,51,52,53,54,56,57,58,60,61,62,63,65,66,67,68,70,71,72,73,75,76,77,78,80,81,82,83,85,86,87,88,89,91,92
mov $2,$0
mov $3,$0
mul $0,2
add $0,2
mul $0,2
mul $2,2
add $0,$2
lpb $0,1
sub $0,1
add $1,1
trn $0,$1
mov $2,$1
lpe
sub $2,2
mov $1,$2
lpb $3,1
add $1,1
sub $3,1
lpe
add $1,3
| 23.291667 | 193 | 0.60644 | [
"Apache-2.0"
] | karttu/loda | programs/oeis/186/A186387.asm | 559 | Assembly |
C -*- mode: asm; asm-comment-char: ?C; -*-
C nettle, low-level cryptographics library
C
C Copyright (C) 2002, 2005 Niels Möller
C
C The nettle library is free software; you can redistribute it and/or modify
C it under the terms of the GNU Lesser General Public License as published by
C the Free Software Foundation; either version 2.1 of the License, or (at your
C option) any later version.
C
C The nettle library is distributed in the hope that it will be useful, but
C WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
C or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
C License for more details.
C
C You should have received a copy of the GNU Lesser General Public License
C along with the nettle library; see the file COPYING.LIB. If not, write to
C the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
C MA 02111-1301, USA.
include_src(<sparc32/aes.m4>)
C Arguments
define(<CTX>, <%i0>)
define(<T>, <%i1>)
define(<LENGTH>,<%i2>)
define(<DST>, <%i3>)
define(<SRC>, <%i4>)
C AES state, two copies for unrolling
define(<W0>, <%l0>)
define(<W1>, <%l1>)
define(<W2>, <%l2>)
define(<W3>, <%l3>)
define(<X0>, <%l4>)
define(<X1>, <%l5>)
define(<X2>, <%l6>)
define(<X3>, <%l7>)
C %o0-%03 are used for loop invariants T0-T3
define(<KEY>, <%o4>)
define(<ROUND>, <%o5>)
C %g1, %g2, %g3 are TMP1, TMP2 and TMP3
C The sparc32 stack frame looks like
C
C %fp - 4: OS-dependent link field
C %fp - 8: OS-dependent link field
C %fp - 104: OS register save area.
define(<FRAME_SIZE>, 104)
.file "aes-decrypt-internal.asm"
C _aes_decrypt(struct aes_context *ctx,
C const struct aes_table *T,
C unsigned length, uint8_t *dst,
C uint8_t *src)
.section ".text"
.align 16
.proc 020
PROLOGUE(_nettle_aes_decrypt)
save %sp, -FRAME_SIZE, %sp
cmp LENGTH, 0
be .Lend
C Loop invariants
add T, AES_TABLE0, T0
add T, AES_TABLE1, T1
add T, AES_TABLE2, T2
add T, AES_TABLE3, T3
.Lblock_loop:
C Read src, and add initial subkey
add CTX, AES_KEYS, KEY
AES_LOAD(0, SRC, KEY, W0)
AES_LOAD(1, SRC, KEY, W1)
AES_LOAD(2, SRC, KEY, W2)
AES_LOAD(3, SRC, KEY, W3)
C Must be even, and includes the final round
ld [AES_NROUNDS + CTX], ROUND
add SRC, 16, SRC
add KEY, 16, KEY
srl ROUND, 1, ROUND
C Last two rounds handled specially
sub ROUND, 1, ROUND
.Lround_loop:
C The AES_ROUND macro uses T0,... T3
C Transform W -> X
AES_ROUND(0, W0, W3, W2, W1, KEY, X0)
AES_ROUND(1, W1, W0, W3, W2, KEY, X1)
AES_ROUND(2, W2, W1, W0, W3, KEY, X2)
AES_ROUND(3, W3, W2, W1, W0, KEY, X3)
C Transform X -> W
AES_ROUND(4, X0, X3, X2, X1, KEY, W0)
AES_ROUND(5, X1, X0, X3, X2, KEY, W1)
AES_ROUND(6, X2, X1, X0, X3, KEY, W2)
AES_ROUND(7, X3, X2, X1, X0, KEY, W3)
subcc ROUND, 1, ROUND
bne .Lround_loop
add KEY, 32, KEY
C Penultimate round
AES_ROUND(0, W0, W3, W2, W1, KEY, X0)
AES_ROUND(1, W1, W0, W3, W2, KEY, X1)
AES_ROUND(2, W2, W1, W0, W3, KEY, X2)
AES_ROUND(3, W3, W2, W1, W0, KEY, X3)
add KEY, 16, KEY
C Final round
AES_FINAL_ROUND(0, T, X0, X3, X2, X1, KEY, DST)
AES_FINAL_ROUND(1, T, X1, X0, X3, X2, KEY, DST)
AES_FINAL_ROUND(2, T, X2, X1, X0, X3, KEY, DST)
AES_FINAL_ROUND(3, T, X3, X2, X1, X0, KEY, DST)
subcc LENGTH, 16, LENGTH
bne .Lblock_loop
add DST, 16, DST
.Lend:
ret
restore
EPILOGUE(_nettle_aes_decrypt)
| 25.225564 | 78 | 0.6769 | [
"BSD-3-Clause"
] | GaloisInc/hacrypto | src/C/nettle/nettle-2.7.1/sparc32/aes-decrypt-internal.asm | 3,356 | Assembly |
; A108321: a(n) = n^2 if n^2 is not the difference of two primes; otherwise a(n) = 0.
; 0,0,0,0,25,0,49,0,0,0,121,0,169,0,0,0,289,0,361,0,0,0,529,0,625,0,729,0,841,0,961,0,0,0,1225,0,1369,0,0,0,1681,0,1849
mov $2,$0
add $2,1
pow $2,2
add $2,1
lpb $2
mov $3,$2
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
add $1,2
mov $4,$0
lpb $0,4
cmp $4,$0
dif $0,2
mul $2,$4
add $7,$2
lpe
lpb $1
div $1,9
sub $7,1
lpe
lpe
mov $0,$7
| 19.307692 | 119 | 0.563745 | [
"Apache-2.0"
] | ckrause/cm | programs/oeis/108/A108321.asm | 502 | Assembly |
; A011874: [ n(n-1)/21 ].
; 0,0,0,0,0,0,1,2,2,3,4,5,6,7,8,10,11,12,14,16,18,20,22,24,26,28,30,33,36,38,41,44,47,50,53,56,60,63,66,70,74,78,82,86,90,94,98,102,107,112,116,121,126,131,136,141
bin $0,2
mov $1,$0
add $1,$0
div $1,21
| 28.75 | 163 | 0.604348 | [
"Apache-2.0"
] | jmorken/loda | programs/oeis/011/A011874.asm | 230 | Assembly |
BITS 16
start:
mov ax, 07C0h ; Set up 4K stack space after this bootloader
add ax, 288 ; (4096 + 512) / 16 bytes per paragraph
mov ss, ax
mov sp, 4096
mov ax, 07C0h ; Set data segment to where we're loaded
mov ds, ax
mov si, text_string ; Put string position into SI
call print_string ; Call our string-printing routine
jmp $ ; Jump here - infinite loop!
text_string db 'Welcome to Hero Alom Operating System', 0
print_string: ; Routine: output string in SI to screen
mov ah, 0Eh ; int 10h 'print char' function
.repeat:
lodsb ; Get character from string
cmp al, 0
je .done ; If char is zero, end of string
int 10h ; Otherwise, print it
jmp .repeat
.done:
ret
times 510-($-$$) db 0 ; Pad remainder of boot sector with 0s
dw 0xAA55 ; The standard PC boot signature
| 21.342105 | 61 | 0.692972 | [
"MIT"
] | sarthakganguly/heroalomos | heroalomos.asm | 811 | Assembly |
; A122430: Primes of the form 1+2*n+3*n^2.
; Submitted by Christian Krause
; 17,457,617,1009,1777,2081,3137,4409,5897,9521,11657,14009,24481,25577,29009,39217,43441,47881,49409,62497,67801,75209,81017,85009,87041,93281,97561,104161,110977,120401,132721,135257,140401,159161,182041,194057,203321,212801,229081,232409,239137,252881,270601,304009,331337,355697,376657,393857,402601,429409,471241,476009,500209,530041,560737,565937,608401,613817,624721,674977,680681,692161,697937,709561,733097,751001,781321,799801,806009,824777,837409,882377,902009,982697,1024337,1038409
mov $2,332202
lpb $2
mov $3,$6
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
add $1,16
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
sub $2,18
add $5,$1
add $1,8
mov $6,$5
lpe
mov $0,$5
add $0,1
| 37.363636 | 494 | 0.742092 | [
"Apache-2.0"
] | ckrause/loda-programs | oeis/122/A122430.asm | 822 | Assembly |
.code
; int Core_Math_Sum_(int a, int b)
Core_Math_Sum_ proc
add ecx, edx
mov eax, ecx
ret
Core_Math_Sum_ endp
; int Core_Math_Div_(int a, int b, int* quotient, int* remainder)
Core_Math_Div_ proc
; Error if < 0
cmp edx, 0
je InvalidDivisor
mov r10d, edx ; Backup the divisor value
mov eax, ecx
; Convert an int stored in eax to long, where:
; eax: contains least significant bits (32 bits)
; edx: contains most significant bits (32 bits) {that's the reason for the backup above}
cdq
; Divides eax by the operand and place:
; quotient: eax
; remainder: edx
idiv r10d
mov dword ptr [r8], eax
mov dword ptr [r9], edx
mov eax, 1
ret
InvalidDivisor:
xor eax, eax
ret
Core_Math_Div_ endp
end | 15.909091 | 88 | 0.734286 | [
"MIT"
] | gfurtadoalmeida/study-assembly-x64 | book-01/Assembly/asm/core/math/core_math_arithmetics.asm | 700 | Assembly |
; The format is 0
; High value is 224
; Low value is 15
db $0B,$01,$01,$03,$03,$09,$32,$30,$4E,$53,$65,$6B,$BC,$5D,$7F,$00
| 21.333333 | 70 | 0.5625 | [
"BSD-3-Clause"
] | bushy555/ZX-Spectrum-1-Bit-Routines | CLICK_DRUMS/pwm/test/kick1.asm | 128 | Assembly |
; A267185: Column 2 of the square array in A267181.
; 0,1,0,4,2,5,3,6,4,7,5,8,6,9,7,10,8,11,9,12,10,13,11,14,12,15,13,16,14,17,15,18,16,19,17,20,18,21,19,22,20,23,21,24,22,25,23,26,24,27,25,28,26,29,27,30,28,31,29,32,30,33,31,34,32,35,33,36,34,37,35
mov $2,$0
trn $2,3
add $2,$0
mov $3,$2
add $3,3
lpb $0,1
trn $0,2
add $1,5
lpe
trn $1,$3
| 24.571429 | 197 | 0.616279 | [
"Apache-2.0"
] | karttu/loda | programs/oeis/267/A267185.asm | 344 | Assembly |
.global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r14
push %r15
push %rax
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x2013, %r13
nop
nop
nop
nop
nop
sub %rsi, %rsi
movb $0x61, (%r13)
nop
nop
cmp %rax, %rax
lea addresses_UC_ht+0x66c, %rsi
lea addresses_UC_ht+0x1d793, %rdi
nop
nop
nop
nop
and $55509, %r15
mov $106, %rcx
rep movsq
nop
nop
nop
and $9602, %rdi
lea addresses_WT_ht+0x18e13, %rsi
lea addresses_D_ht+0xb413, %rdi
cmp %r15, %r15
mov $43, %rcx
rep movsb
nop
xor $2170, %rdi
lea addresses_normal_ht+0x17489, %r14
nop
nop
add %r15, %r15
mov (%r14), %ax
nop
nop
nop
cmp $37467, %rax
lea addresses_A_ht+0xfd2b, %rsi
lea addresses_D_ht+0x1bc13, %rdi
nop
cmp $46410, %rbx
mov $112, %rcx
rep movsq
nop
nop
nop
inc %r15
lea addresses_UC_ht+0x19413, %rbx
nop
nop
nop
sub $40773, %rsi
mov $0x6162636465666768, %r13
movq %r13, %xmm4
and $0xffffffffffffffc0, %rbx
vmovaps %ymm4, (%rbx)
nop
nop
nop
add %rdi, %rdi
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r15
pop %r14
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r15
push %r8
push %rbp
push %rcx
push %rdx
// Store
lea addresses_UC+0x1eeb3, %r15
nop
nop
nop
nop
dec %rdx
mov $0x5152535455565758, %rcx
movq %rcx, (%r15)
nop
nop
nop
nop
cmp %r12, %r12
// Load
lea addresses_PSE+0x16813, %r12
nop
nop
nop
nop
sub %rbp, %rbp
mov (%r12), %r10w
sub $44775, %rbp
// Store
lea addresses_A+0x6873, %rdx
nop
nop
nop
nop
sub $57547, %rbp
mov $0x5152535455565758, %r15
movq %r15, (%rdx)
nop
nop
xor $60937, %r10
// Store
lea addresses_WC+0x82d3, %rbp
nop
nop
dec %rdx
movw $0x5152, (%rbp)
add $23654, %rcx
// Store
lea addresses_WC+0x16a53, %r12
nop
nop
and %rdx, %rdx
mov $0x5152535455565758, %rcx
movq %rcx, %xmm2
and $0xffffffffffffffc0, %r12
vmovntdq %ymm2, (%r12)
nop
nop
inc %rcx
// Load
mov $0x513, %rdx
nop
nop
nop
and %r12, %r12
mov (%rdx), %bp
nop
nop
nop
nop
nop
cmp %r10, %r10
// Load
lea addresses_UC+0xe0f3, %r8
nop
nop
nop
nop
nop
dec %r15
vmovups (%r8), %ymm4
vextracti128 $0, %ymm4, %xmm4
vpextrq $1, %xmm4, %rbp
nop
nop
nop
nop
nop
sub %rcx, %rcx
// Load
lea addresses_D+0xbf33, %rcx
nop
nop
cmp %r8, %r8
mov (%rcx), %bp
nop
nop
nop
nop
nop
sub %r15, %r15
// Store
lea addresses_WT+0x7213, %r15
nop
nop
and %rcx, %rcx
movw $0x5152, (%r15)
nop
nop
nop
nop
nop
dec %rbp
// Store
lea addresses_PSE+0x3a53, %r10
nop
nop
cmp $15738, %rcx
mov $0x5152535455565758, %rbp
movq %rbp, %xmm3
vmovups %ymm3, (%r10)
nop
nop
sub $17725, %rdx
// Store
lea addresses_WT+0x57e3, %r10
nop
nop
nop
nop
sub %rcx, %rcx
movw $0x5152, (%r10)
sub $50858, %rcx
// Store
lea addresses_RW+0x1c353, %rbp
inc %r10
movb $0x51, (%rbp)
nop
nop
nop
add $41683, %r12
// Faulty Load
lea addresses_WT+0x9c13, %rcx
nop
nop
add %r10, %r10
movups (%rcx), %xmm0
vpextrq $1, %xmm0, %r15
lea oracles, %r10
and $0xff, %r15
shlq $12, %r15
mov (%r10,%r15,1), %r15
pop %rdx
pop %rcx
pop %rbp
pop %r8
pop %r15
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': False, 'type': 'addresses_WT'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 5, 'same': False, 'type': 'addresses_UC'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': True, 'size': 2, 'congruent': 7, 'same': False, 'type': 'addresses_PSE'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 5, 'same': False, 'type': 'addresses_A'}, 'OP': 'STOR'}
{'dst': {'NT': True, 'AVXalign': False, 'size': 2, 'congruent': 6, 'same': False, 'type': 'addresses_WC'}, 'OP': 'STOR'}
{'dst': {'NT': True, 'AVXalign': False, 'size': 32, 'congruent': 3, 'same': False, 'type': 'addresses_WC'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 8, 'same': False, 'type': 'addresses_P'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 3, 'same': False, 'type': 'addresses_UC'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 5, 'same': False, 'type': 'addresses_D'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 8, 'same': False, 'type': 'addresses_WT'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 5, 'same': False, 'type': 'addresses_PSE'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 4, 'same': False, 'type': 'addresses_WT'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 6, 'same': False, 'type': 'addresses_RW'}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0, 'same': True, 'type': 'addresses_WT'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'NT': False, 'AVXalign': True, 'size': 1, 'congruent': 10, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'STOR'}
{'src': {'congruent': 0, 'same': False, 'type': 'addresses_UC_ht'}, 'dst': {'congruent': 6, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM'}
{'src': {'congruent': 8, 'same': False, 'type': 'addresses_WT_ht'}, 'dst': {'congruent': 9, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM'}
{'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 1, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 0, 'same': False, 'type': 'addresses_A_ht'}, 'dst': {'congruent': 10, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM'}
{'dst': {'NT': True, 'AVXalign': True, 'size': 32, 'congruent': 10, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'STOR'}
{'39': 21829}
39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39
*/
| 29.424138 | 2,999 | 0.650416 | [
"MIT"
] | danielmgmi/medusa | Transynther/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_1257.asm | 8,533 | Assembly |
; #########################################################################
.386
.model flat, stdcall
option casemap :none ; case sensitive
; #########################################################################
include \masm32\include\windows.inc
include \masm32\include\gdi32.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc
include \masm32\include\masm32.inc
include aplib.inc
includelib \masm32\lib\gdi32.lib
includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\masm32.lib
includelib aplib.lib
; #########################################################################
;=============
; Local macros
;=============
return MACRO arg
mov eax, arg
ret
ENDM
;=================
; Local prototypes
;=================
WndProc PROTO :DWORD,:DWORD,:DWORD,:DWORD
TopXY PROTO :DWORD,:DWORD
EditProc PROTO :DWORD,:DWORD,:DWORD,:DWORD
; #########################################################################
.const
MAXSIZE equ 260
.data
szHelp db 'use up/down arrow keys to navigate', 0
.data?
readcompAllocMem HANDLE ?
readAllocMem DWORD ?
decompMem HANDLE ?
decompAllocMem DWORD ?
szFileName db MAXSIZE dup (?)
szAppPath db MAXSIZE dup (?)
hInstance dd ?
txtEdit dd ?
hWnd dd ?
lpEditProc dd ?
tmp dd ?
hFile dd ?
iDocSize dd ?
uDocSize dd ?
iFileSize dd ?
.code
start:
;=====================
; Get program instance
;=====================
invoke GetModuleHandle, NULL
mov hInstance, eax
;=========================
; Run and exit our program
;=========================
invoke DialogBoxParam, hInstance, 100, 0, addr WndProc, 0
invoke ExitProcess, 0
; #########################################################################
WndProc proc hDlg :DWORD,
uMsg :DWORD,
wParam :DWORD,
lParam :DWORD
LOCAL Wwd :DWORD
LOCAL Wht :DWORD
LOCAL Wtx :DWORD
LOCAL Wty :DWORD
.if uMsg == WM_INITDIALOG
mov eax, hDlg
mov hWnd, eax
invoke GetDlgItem, hDlg, 101
mov txtEdit, eax
invoke SetWindowLong, txtEdit, GWL_WNDPROC, EditProc
mov lpEditProc, eax
invoke GetStockObject, ANSI_FIXED_FONT
invoke SendMessage, txtEdit, WM_SETFONT, eax, 0
invoke LoadCursor, NULL, IDC_ARROW
invoke SetClassLong, txtEdit, GCL_HCURSOR, eax
;================================
; Center window at following size
;================================
mov Wwd, 648
mov Wht, 370
invoke GetSystemMetrics, SM_CXSCREEN
invoke TopXY, Wwd, eax
mov Wtx, eax
invoke GetSystemMetrics, SM_CYSCREEN
invoke TopXY, Wht, eax
mov Wty, eax
invoke MoveWindow, hDlg, Wtx, Wty, Wwd, Wht, TRUE
;================
; Get name of EXE
;================
invoke GetModuleFileName, NULL, addr szFileName, MAXSIZE
invoke GetAppPath, addr szAppPath
invoke lstrlen, addr szFileName
mov iDocSize, eax
invoke lstrlen, addr szAppPath
sub iDocSize, eax
invoke szRight, addr szFileName, addr szAppPath, iDocSize
sub iDocSize, 3
invoke lstrcpyn, addr szFileName, addr szAppPath, iDocSize
invoke SetWindowText, hWnd, addr szFileName
invoke LoadIcon, NULL, IDI_APPLICATION
invoke SendMessage, hDlg, WM_SETICON, TRUE, eax
;================
; Obtain exe size
;================
invoke GetModuleFileName, NULL, addr szAppPath, MAXSIZE
invoke filesize, addr szAppPath
mov iFileSize, eax
;======================
; Open file for reading
;======================
invoke _lopen, addr szAppPath, OF_READ
mov hFile, eax
;======================
; Get uncompressed size
;======================
mov eax, iFileSize
sub eax, 8
invoke _llseek, hFile, eax, FILE_CURRENT
invoke _lread, hFile, addr iDocSize, sizeof iDocSize
;====================
; Get compressed size
;====================
invoke _lread, hFile, addr uDocSize, sizeof uDocSize
invoke _lclose, hFile
;===============
; Open exe again
;===============
invoke _lopen, addr szAppPath, OF_READ
mov hFile, eax
;================================
; Obtain compressed text location
; (iFileSize) - (8 + iDocSize)
;================================
mov eax, iFileSize
sub eax, iDocSize
sub eax, 8
invoke _llseek, hFile, eax, FILE_CURRENT
;============================
; Allocate memory for reading
;============================
invoke GlobalAlloc, GMEM_MOVEABLE or GMEM_ZEROINIT, iDocSize
mov readcompAllocMem, eax
invoke GlobalLock, readcompAllocMem
mov readAllocMem, eax
;=====================
; Read compressed text
;=====================
invoke _lread, hFile, readAllocMem, iDocSize
;==================================
; Allocate memory for decompression
;==================================
invoke GlobalAlloc, GMEM_MOVEABLE or GMEM_ZEROINIT, uDocSize
mov decompMem, eax
invoke GlobalLock, decompMem
mov decompAllocMem, eax
;========================================
; Decompress text and update edit control
;========================================
invoke aP_depack_asm_fast, readAllocMem, decompAllocMem
invoke SendMessage, txtEdit, WM_SETTEXT, 0, decompAllocMem
;=====================
; Free file and memory
;=====================
invoke _lclose, hFile
invoke GlobalUnlock, decompAllocMem
invoke GlobalFree, decompMem
invoke GlobalUnlock, readAllocMem
invoke GlobalFree, readcompAllocMem
;=========================
; Make edit active control
;=========================
invoke SetFocus, txtEdit
return 0
.elseif uMsg == WM_CTLCOLORSTATIC
;==================================
; Paint edit box with system colors
;==================================
invoke SetBkMode, wParam, OPAQUE
invoke GetSysColor, COLOR_WINDOW
invoke SetBkColor, wParam, eax
invoke GetSysColor, COLOR_WINDOWTEXT
invoke SetTextColor, wParam, eax
invoke GetSysColorBrush, COLOR_WINDOW
ret
.elseif uMsg == WM_KEYDOWN
.if wParam == VK_F1
; prevents flicker
.if tmp != TRUE
invoke SetWindowText, hDlg, addr szHelp
mov tmp, TRUE
.endif
.endif
.elseif uMsg == WM_KEYUP
.if wParam == VK_F1
mov tmp, FALSE
invoke SetWindowText, hDlg, addr szFileName
.endif
.elseif uMsg == WM_CLOSE
invoke EndDialog, hDlg, 0
ret
.endif
xor eax, eax
ret
WndProc endp
; #########################################################################
TopXY proc wDim:DWORD, sDim:DWORD
shr sDim, 1 ; divide screen dimension by 2
shr wDim, 1 ; divide window dimension by 2
mov eax, wDim ; copy window dimension into eax
sub sDim, eax ; sub half win dimension from half screen dimension
return sDim
TopXY endp
; #########################################################################
EditProc proc hWin :DWORD,
uMsg :DWORD,
wParam :DWORD,
lParam :DWORD
.if uMsg == WM_RBUTTONDOWN
return 0
.elseif uMsg == WM_SETFOCUS
return 0
.elseif uMsg == WM_CHAR
return 0
.elseif uMsg == WM_GETTEXT
return 0
.elseif uMsg == EM_GETLINE
return 0
.elseif uMsg == EM_GETSEL
return 0
.elseif uMsg == WM_GETTEXTLENGTH
return 0
.elseif uMsg == WM_KEYUP
.if wParam == VK_UP
.elseif wParam == VK_DOWN
.elseif wParam == VK_PRIOR
.elseif wParam == VK_NEXT
.else
invoke SendMessage, hWnd, WM_KEYUP, VK_F1, 0
.endif
.elseif uMsg == WM_KEYDOWN
.if wParam == VK_UP
invoke SendMessage, txtEdit, WM_KEYDOWN, VK_PRIOR, 0
.elseif wParam == VK_DOWN
invoke SendMessage, txtEdit, WM_KEYDOWN, VK_NEXT, 0
.elseif wParam == VK_PRIOR
.elseif wParam == VK_NEXT
.else
invoke SendMessage, hWnd, WM_KEYDOWN, VK_F1, 0
return 0
.endif
.endif
invoke CallWindowProc, lpEditProc, hWin, uMsg, wParam, lParam
ret
EditProc endp
; #########################################################################
end start
| 27.939759 | 75 | 0.479517 | [
"MIT"
] | dindoliboon/archive | asm/masm32/t2e/stub.asm | 9,276 | Assembly |
; A004083: Numbers n such that cos(n-1) <= 0 and cos(n) > 0.
; 5,11,18,24,30,37,43,49,55,62,68,74,81,87,93,99,106,112,118,125,131,137,143,150,156,162,169,175,181,187,194,200,206,213,219,225,231,238,244,250,257,263,269,275,282,288,294,301,307,313,319,326,332,338,345
mov $3,$0
mul $0,2
mov $1,$0
add $1,4
div $1,7
add $1,5
mov $2,$3
mul $2,6
add $1,$2
| 27.076923 | 204 | 0.653409 | [
"Apache-2.0"
] | karttu/loda | programs/oeis/004/A004083.asm | 352 | Assembly |
; A104128: a(n) = p + p^(p+1), where p = prime(n).
; Submitted by Christian Krause
; 10,84,15630,5764808,3138428376732,3937376385699302,14063084452067724991026,37589973457545958193355620,480250763996501976790165756943064,74462898441675122902293018227199467668020630,529144398052420314716929933900838757437386767392,390539993363777986320898213181845819006713655084697379373166,54565982855941191947249368879497196495421462536627690767330656099322,745782254782301503355862595418917382807246689177519953982343989556806844
seq $0,40 ; The prime numbers.
seq $0,108398 ; a(n) = n*(1 + n^n)/2.
mul $0,2
| 74.625 | 434 | 0.859296 | [
"Apache-2.0"
] | ckrause/loda-programs | oeis/104/A104128.asm | 597 | Assembly |
Name: en-drive.asm
Type: file
Size: 43178
Last-Modified: '2000-11-08T02:03:12Z'
SHA-1: F0901CDA8893F2AA6EBD0694CE9637028532E505
Description: null
| 20.857143 | 47 | 0.808219 | [
"MIT"
] | Brycey92/gigaleak | other.7z/NEWS.7z/NEWS/FZERO/FZERO/Game/en-drive.asm | 146 | Assembly |
.INCSRC "IPS_NES.INC"
IPS_NESHDR = IPS_NESHDR_YES ; Either 'IPS_NESHDR_YES' or 'IPS_NESHDR_NO'.
IPS_OBJ = IPS_OBJ_NO ; Either 'IPS_OBJ_YES' or 'IPS_OBJ_NO'.
;GOTOXY .MACRO (XX,YY)
; @BASEVRAMXXYY = 9248 + (32 * YY) + XX
; .DCB >@BASEVRAMXXYY
; .DCB <@BASEVRAMXXYY
;.ENDM
.IPSOpen (0)
.INDEX 8
.MEM 8
; Patch NES Header to enable Battery-backed RAM
.DCB $00
.DCB $00
.DCB $06 ; offset = $0006
.DCB $00
.DCB $01 ; size = 1 byte
.DCB $12 ; set bit 1 (battery)
.INCSRC "asctable.asm"
.INCSRC "pwdpatch.asm"
.INCSRC "uilayout.asm"
.IPSClose (0) ; Close IPS Output File.
| 18.46875 | 73 | 0.658206 | [
"MIT"
] | RupertAvery/WillowPatch | src/Willow.asm | 591 | Assembly |
;================================================================================
; The Legend of Zelda, A Link to the Past - Randomizer General Development & Bugfixes
;================================================================================
lorom
;================================================================================
;org $00FFC0 ; <- 7FC0 - Bank00.asm : 9173 (db "THE LEGEND OF ZELDA " ; 21 bytes)
;db #$23, $4E
org $00FFD5 ; <- 7FD5 - Bank00.asm : 9175 (db $20 ; rom layout)
;db #$35 ; set fast exhirom
db #$30 ; set fast lorom
;org $00FFD6 ; <- 7FD6 - Bank00.asm : 9176 (db $02 ; cartridge type)
;db #$55 ; enable S-RTC
org $00FFD7 ; <- 7FD7 - Bank00.asm : 9177 (db $0A ; rom size)
db #$0B ; mark rom as 16mbit
org $00FFD8 ; <- 7FD8 - Bank00.asm : 9178 (db $03 ; ram size (sram size))
db #$05 ; mark sram as 32k
org $3FFFFF ; <- 1FFFFF
db #$00 ; expand file to 2mb
org $1FFFF8 ; <- FFFF8 timestamp rom
db #$20, #$18, #$07, #$23 ; year/month/day
;================================================================================
!ADD = "CLC : ADC"
!SUB = "SEC : SBC"
!BLT = "BCC"
!BGE = "BCS"
!INVENTORY_SWAP = "$7EF38C"
!INVENTORY_SWAP_2 = "$7EF38E"
!NPC_FLAGS = "$7EF410"
!NPC_FLAGS_2 = "$7EF411"
!MAP_OVERLAY = "$7EF414" ; [2]
!PROGRESSIVE_SHIELD = "$7EF416" ; ss-- ----
!HUD_FLAG = "$7EF416" ; --h- ----
!FORCE_PYRAMID = "$7EF416" ; ---- p---
!IGNORE_FAIRIES = "$7EF416" ; ---- -i--
!SHAME_CHEST = "$7EF416" ; ---s ----
!HAS_GROVE_ITEM = "$7EF416" ; ---- ---g general flags, don't waste these
!HIGHEST_SWORD_LEVEL = "$7EF417" ; --- -sss
!SRAM_SINK = "$7EF41E" ; <- change this
!FRESH_FILE_MARKER = "$7EF4F0" ; zero if fresh file
;$7EF41A[w] - Programmable Item #1
;$7EF41C[w] - Programmable Item #2
;$7EF41E[w] - Programmable Item #3
;$7EF418 - Goal Item Counter
;$7EF420 - $7EF466 - Stat Tracking Bank 1
;$7EF450 - $7EF45F - RNG Item (Single) Flags
!MS_GOT = "$7F5031"
!DARK_WORLD = "$7EF3CA"
!REDRAW = "$7F5000"
!GANON_WARP_CHAIN = "$7F5032";
!TILE_UPLOAD_BUFFER = "$7EA180";
!FORCE_HEART_SPAWN = "$7F5033";
!SKIP_HEART_SAVE = "$7F5034";
!INVENTORY_SWAP = "$7EF38C"
!INVENTORY_SWAP_2 = "$7EF38E"
!ITEM_LIMIT_COUNTS = "$7EF390"
!SHOP_PURCHASE_COUNTS = "$7EF3A0"
;================================================================================
incsrc hooks.asm
incsrc treekid.asm
incsrc spriteswap.asm
incsrc hashalphabethooks.asm
;org $208000 ; bank #$20
org $A08000 ; bank #$A0
incsrc itemdowngrade.asm
incsrc bugfixes.asm
incsrc darkworldspawn.asm
incsrc lampmantlecone.asm
incsrc floodgatesoftlock.asm
incsrc heartpieces.asm
incsrc npcitems.asm
incsrc utilities.asm
incsrc flipperkill.asm
incsrc previewdatacopy.asm
incsrc pendantcrystalhud.asm
incsrc potions.asm
incsrc shopkeeper.asm
incsrc bookofmudora.asm
incsrc crypto.asm
incsrc tablets.asm
incsrc rupeelimit.asm
incsrc fairyfixes.asm
incsrc rngfixes.asm
incsrc medallions.asm
incsrc inventory.asm
incsrc ganonfixes.asm
incsrc zelda.asm
incsrc maidencrystals.asm
incsrc zoraking.asm
incsrc catfish.asm
incsrc flute.asm
incsrc dungeondrops.asm
incsrc halfmagicbat.asm
incsrc newitems.asm
incsrc mantle.asm
incsrc swordswap.asm
incsrc stats.asm
incsrc scratchpad.asm
incsrc map.asm
incsrc msu.asm
incsrc dialog.asm
incsrc events.asm
incsrc entrances.asm
incsrc clock.asm
incsrc accessability.asm
incsrc heartbeep.asm
incsrc capacityupgrades.asm
incsrc timer.asm
incsrc doorframefixes.asm
incsrc music.asm
incsrc hashalphabet.asm
incsrc roomloading.asm
incsrc icepalacegraphics.asm
warnpc $A18000
org $1C8000 ; text tables for translation
incbin i18n_en.bin
warnpc $1CF356
org $A18000 ; static mapping area
incsrc framehook.asm
warnpc $A186B0
org $A186B0 ; static mapping area, do not move
incsrc hud.asm
warnpc $A18800
org $A18800 ; static mapping area
incsrc zsnes.asm
warnpc $A19000
org $A1FF00 ; static mapping area
incsrc init.asm
org $A48000 ; code bank - PUT NEW CODE HERE
incsrc glitched.asm
incsrc hardmode.asm
incsrc goalitem.asm
incsrc compasses.asm
incsrc openmode.asm
incsrc quickswap.asm
incsrc endingsequence.asm
incsrc cuccostorm.asm
incsrc compression.asm
incsrc retro.asm
incsrc dpadinvert.asm
incsrc boots.asm
incsrc fileselect.asm
incsrc playername.asm
incsrc decryption.asm
incsrc inverted.asm
incsrc invertedmaps.asm
warnpc $A58000
;org $228000 ; contrib area
org $A28000 ; contrib area
incsrc contrib.asm
org $A38000
incsrc stats/main.asm
org $308000 ; bank #$30
incsrc tables.asm
;incsrc sandbox.asm
org $318000 ; bank #$31
GFX_Mire_Bombos:
incbin 99ff1_bombos.gfx
warnpc $318800
org $318800
GFX_Mire_Quake:
incbin 99ff1_quake.gfx
warnpc $319000
org $319000
GFX_TRock_Bombos:
incbin a6fc4_bombos.gfx
warnpc $319800
org $319800
GFX_TRock_Ether:
incbin a6fc4_ether.gfx
warnpc $31A000
org $31A000
GFX_HUD_Items:
incbin c2807_v3.gfx
warnpc $31A800
org $31A800
GFX_New_Items:
incbin newitems.gfx
;incbin eventitems.gfx ; *EVENT*
warnpc $31B000
org $31B000
GFX_HUD_Main:
incbin c2e3e.gfx
warnpc $31B800
org $31B800
GFX_Hash_Alphabet:
incbin hashalphabet.chr.gfx
warnpc $31C001
org $31C000
IcePalaceFloorGfx:
incbin ice_palace_floor.bin
warnpc $31C801
org $31C800
Damage_Table:
incbin damage_table.bin
warnpc $31D001
org $31D000
FileSelectNewGraphics:
incbin fileselect.chr.gfx
warnpc $31E001
org $31E000
InvertedCastleHole: ;address used by front end. DO NOT MOVE!
incbin sheet73.gfx
warnpc $31E501
org $338000
GFX_HUD_Palette:
incbin hudpalette.pal
warnpc $348000
org $328000
Extra_Text_Table:
incsrc itemtext.asm
incsrc externalhooks.asm
;================================================================================
org $119100 ; PC 0x89100
incbin map_icons.gfx
warnpc $119401
;================================================================================
org $AF8000 ; PC 0x178000
Static_RNG: ; each line below is 512 bytes of rng
incsrc staticrng.asm
warnpc $AF8401
;================================================================================
org $AF8400
incsrc tournament.asm
incsrc eventdata.asm
warnpc $B08000
;================================================================================
;Bank Map
;$20 Code Bank
;$21 Reserved (Frame Hook & Init)
;$22 Contrib Code
;$23 Stats & Credits
;$24 Code Bank
;$29 External hooks (rest of bank not used)
;$2E Reserved for Tournament Use
;$2F Static RNG (rest is reserved for tournament use)
;$30 Main Configuration Table
;$31 Graphics Bank
;$32 Text Bank
;$33 Graphics Bank
;$37 Don't Use ZSNES Graphics
;$38 Don't Use ZSNES Graphics (continued)
;$3A reserved for downstream use
;$3B reserved for downstream use
;$3F reserved for internal debugging
;$7F5700 - $7F57FF reserved for downstream use
;================================================================================
;SRAM Map
;$70:0000 ( 4K) Game state
;$70:1000 (20K) Log entries
;$70:6000 ( 8K) Scratch buffers
;================================================================================
;org $0080DC ; <- 0xDC - Bank00.asm:179 - Kill Music
;db #$A9, #$00, #$EA
;LDA.b #$00 : NOP
;================================================================================
;org $0AC53E ; <- 5453E - Bank0A.asm:1103 - (LDA $0AC51F, X) - i have no idea what this is for anymore
;LDA.b #$7F
;NOP #2
;================================================================================
;org $05DF8B ; <- 2DF8B - Bank05.asm : 2483
;AND.w #$0100 ; allow Sprite_DrawMultiple to access lower half of sprite tiles
;================================================================================
;org $0DF8F1 ; this is required for the X-indicator in the HUD except not anymore obviously
;
;;red pendant
;db $2B, $31, $2C, $31, $3D, $31, $2E, $31
;db $2B, $25, $2C, $25, $2D, $25, $2E, $25
;
;;blue pendant
;db $2B, $31, $2C, $31, $3D, $31, $2E, $31
;db $2B, $2D, $2C, $2D, $2D, $2D, $2E, $2D
;
;;green pendant
;db $2B, $31, $2C, $31, $3D, $31, $2E, $31
;db $2B, $3D, $2C, $3D, $2D, $3D, $2E, $3D
;================================================================================
;org $00CFF2 ; 0x4FF2 - Mire H
;db GFX_Mire_Bombos>>16
;org $00D0D1 ; 0x50D1 - Mire M
;db GFX_Mire_Bombos>>8
;org $00D1B0 ; 0x51B0 - Mire L
;db GFX_Mire_Bombos
;org $00D020 ; 0x5020 - Trock H
;db GFX_TRock_Bombos>>16
;org $00D0FF ; 0x50FF - Trock M
;db GFX_TRock_Bombos>>8
;org $00D1DE ; 0x51DE - Trock L
;db GFX_TRock_Bombos
org $00D09C ; 0x509C - HUD Items H
db GFX_HUD_Items>>16
org $00D17B ; 0x517B - HUD Items M
db GFX_HUD_Items>>8
org $00D25A ; 0x525A - HUD Items L
db GFX_HUD_Items
; this used to be a pointer to a dummy file
org $00D065 ; 005065 - New Items H
db GFX_New_Items>>16
org $00D144 ; 005114 - New Items M
db GFX_New_Items>>8
org $00D223 ; 005223 - New Items L
db GFX_New_Items
org $00D09D ; 0x509D - HUD Main H
db GFX_HUD_Main>>16
org $00D17C ; 0x517C - HUD Main M
db GFX_HUD_Main>>8
org $00D25B ; 0x525B - HUD Main L
db GFX_HUD_Main
;================================================================================
org $008781
UseImplicitRegIndexedLocalJumpTable:
org $00879c
UseImplicitRegIndexedLongJumpTable:
org $008333
Vram_EraseTilemaps_triforce:
org $00893D
EnableForceBlank:
org $00D308
DecompSwordGfx:
org $00D348
DecompShieldGfx:
org $00D463
Tagalong_LoadGfx:
org $00D51B
GetAnimatedSpriteTile:
org $00D52D
GetAnimatedSpriteTile_variable:
org $00D84E
Attract_DecompressStoryGfx:
org $00E529
LoadSelectScreenGfx:
org $00F945
PrepDungeonExit:
org $00FDEE
Mirror_InitHdmaSettings:
org $01873A
Dungeon_LoadRoom:
org $02A0A8
Dungeon_SaveRoomData:
org $02A0BE
Dungeon_SaveRoomData_justKeys:
org $02B861
Dungeon_SaveRoomQuadrantData:
org $02FD8A ; 17D8A - Bank07.asm: 3732 Note: Different bank
LoadGearPalettes_bunny:
org $05A51D
Sprite_SpawnFallingItem:
org $05DF6C ; 02DF6C - Bank05.asm : 2445
Sprite_DrawMultiple:
org $05DF70 ; 02DF70 - Bank05.asm : 2454
Sprite_DrawMultiple_quantity_preset:
org $05DF75 ; 02DF75 - Bank05.asm : 2461
Sprite_DrawMultiple_player_deferred:
org $05E1A7 ; 02E1A7 - Bank05.asm : 2592
Sprite_ShowSolicitedMessageIfPlayerFacing:
org $05E1F0
Sprite_ShowMessageFromPlayerContact:
org $05E219
Sprite_ShowMessageUnconditional:
org $05FA8E
Sprite_ShowMessageMinimal:
org $05EC96
Sprite_ZeldaLong:
org $0683E6
Utility_CheckIfHitBoxesOverlapLong:
org $06A7DB
Chicken_SpawnAvengerChicken: ; returns short
org $06DC5C
Sprite_DrawShadowLong:
org $06DD40
DashKey_Draw:
org $06DBF8
Sprite_PrepAndDrawSingleLargeLong:
org $06DC00
Sprite_PrepAndDrawSingleSmallLong:
org $06EA18
Sprite_ApplySpeedTowardsPlayerLong:
org $06EAA6
Sprite_DirectionToFacePlayerLong:
org $06F12F
Sprite_CheckDamageToPlayerSameLayerLong:
org $06F86A
OAM_AllocateDeferToPlayerLong:
org $0791B3
Player_HaltDashAttackLong:
org $07999D
Link_ReceiveItem:
org $07E68F
Unknown_Method_0: ; In US version disassembly simply called "$3E6A6 IN ROM"
org $07F4AA
Sprite_CheckIfPlayerPreoccupied:
org $08C3AE
Ancilla_ReceiveItem:
org $08F710
Ancilla_SetOam_XY_Long:
org $0985E2 ; (break on $0985E4)
AddReceivedItem:
org $098BAD
AddPendantOrCrystal:
org $0993DF
AddDashTremor:
org $09AE64
Sprite_SetSpawnedCoords:
org $09AD58
GiveRupeeGift:
org $0ABA4F
OverworldMap_InitGfx:
org $0ABA99
OverworldMap_DarkWorldTilemap:
org $0ABAB9
OverworldMap_LoadSprGfx:
org $0DBA71
GetRandomInt:
org $0DBA80
OAM_AllocateFromRegionA:
org $0DBA84
OAM_AllocateFromRegionB:
org $0DBA88
OAM_AllocateFromRegionC:
org $0DBA8C
OAM_AllocateFromRegionD:
org $0DBA90
OAM_AllocateFromRegionE:
org $0DBA94
OAM_AllocateFromRegionF:
org $0DBB67
Sound_SetSfxPanWithPlayerCoords:
org $0DBB6E
Sound_SetSfx1PanLong:
org $0DBB7C
Sound_SetSfx2PanLong:
org $0DBB8A
Sound_SetSfx3PanLong:
org $0DDB7F
HUD_RefreshIconLong:
org $0DE01E ; 6E10E - equipment.asm : 787
BottleMenu_movingOn:
org $0DE346
RestoreNormalMenu:
org $0DE9C8
DrawProgressIcons: ; this returns short
org $0DED29
DrawEquipment: ; this returns short
org $0DFA78
HUD_RebuildLong:
org $0DFA88
HUD_RebuildIndoor_Palace:
org $0EEE10
Messaging_Text:
org $1BC97C:
Overworld_DrawPersistentMap16:
org $1BED03
Palette_Sword:
org $1BED29
Palette_Shield:
org $1BEDF9
Palette_ArmorAndGloves:
org $1BEE52
Palette_Hud:
org $1CFAAA
ShopKeeper_RapidTerminateReceiveItem:
org $1CF500
Sprite_NullifyHookshotDrag:
org $1CFD69
Main_ShowTextMessage:
org $1DE9B6
Filter_MajorWhitenMain:
org $1DF65D
Sprite_SpawnDynamically:
org $1DF65F
Sprite_SpawnDynamically_arbitrary:
org $1DFD4B
DiggingGameGuy_AttemptPrizeSpawn:
org $1EDE28
Sprite_GetEmptyBottleIndex: ; this is totally in sprite_bees.asm
org $1EF4E7
Sprite_PlayerCantPassThrough:
;================================================================================
| 20.773179 | 102 | 0.678409 | [
"MIT"
] | Zarby89/z3randomizer | LTTP_RND_GeneralBugfixes.asm | 12,547 | Assembly |
; A133043: Number of segments needed to draw the spiral of equilateral triangles with side lengths which follow the Padovan sequence.
; 3,5,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65
add $0,3
mov $1,$0
mov $2,-2
lpb $1,1
div $1,3
add $1,$2
add $1,$0
lpe
add $1,2
| 30.846154 | 179 | 0.673317 | [
"Apache-2.0"
] | karttu/loda | programs/oeis/133/A133043.asm | 401 | Assembly |
; A093412: Triangle read by rows: a(n, k) is the numerator of (n + (n-1) + ... + (n-k+1))/(1 + 2 + ... + k), 0 < k <= n.
; Submitted by Christian Krause
; 1,2,1,3,5,1,4,7,3,1,5,3,2,7,1,6,11,5,9,4,1,7,13,3,11,5,9,1,8,5,7,13,2,11,5,1,9,17,4,3,7,13,3,11,1,10,19,9,17,8,15,7,13,6,1,11,7,5,19,3,17,2,5,7,13,1,12,23,11,21,10,19,9,17,8,15,7,1,13,25,6,23,11,3,5,19,9,17,4
lpb $0
add $1,1
sub $0,$1
lpe
add $0,2
mul $1,2
sub $1,$0
add $1,4
gcd $0,$1
div $1,$0
mov $0,$1
| 29.125 | 210 | 0.545064 | [
"Apache-2.0"
] | ckrause/loda-programs | oeis/093/A093412.asm | 466 | Assembly |
extern __BANK_7_head
extern _updateDirection
extern animateMenu
extern bank7Screen
extern displayTile
extern keyboardScan
extern lookupScanCode
extern pressJumpMsg
extern printAttr
extern scanCodes
extern setAttr
extern setTileAttr
extern waitReleaseKey
public defineKeys
section CODE_5
include "defs.inc"
defineKeys:
push af
;
; Setup the screen
;
;
; Patch the displayTile routine to access
; memory @ 0x4000 (screen 0)
;
ld a, SCREEN_START>>8
ld (bank7Screen+1), a
;
; Copy screen 1 to screen 0
;
ld de, SCREEN_START ; Destination address
ld hl, __BANK_7_head ; Source address, bank 7 must be mapped
ld bc, SCREEN_LENGTH+SCREEN_ATTR_LENGTH
ldir ; Copy
BANK 0 ; Bank 0 contains the tile attributes
;
; Clear the text from the main menu
;
ld b, 0x0d ; Start Y position
yLoop:
ld c, 0x06 ; Starting X position
xLoop:
ld a, ID_BLANK ; ID of tile to use
call displayTile ; Display the tile
inc c ; Increment the screen X position
ld a, c
cp 0x06+0x13
jr nz, xLoop ; and loop if not zero
inc b ; Increment the screen Y position
ld a, b
cp 0x0d+0x08
jr nz, yLoop ; and loop if not zero
;
; Display screen title
;
ld bc, 0x0d0a
ld hl, defineKeyMsg
ld a, PAPER_BLACK|INK_WHITE|BRIGHT
bcall printAttr
;
; Underline the title
;
ld a, ID_PLATFORM
ld bc, 0x0e0a ; Starting screen Y/X location
ld e, 11
underline:
call displayTile
call setTileAttr ; Requires attributes in BANK 0
inc c ; Increment the X screen location
dec e ; Decrement loop count
jr nz, underline ; and loop if not zero
screen 0 ; Display screen 0
;
; Get key for left
;
ld bc, 0x0f0a
ld hl, leftMsg
call getInput
ld (scanCodes), de
;
; Get key for right
;
ld bc, 0x110a
call getInput
ld (scanCodes+3), de
;
; Get key for jump
;
ld bc, 0x130a
call getInput
ld (scanCodes+6), de
;
; Display the continue message
;
ld bc, 0x1505
ld hl, pressJumpMsg
ld a, PAPER_BLACK|INK_WHITE|BRIGHT|FLASH
bcall printAttr
waitJump:
ld hl, lanternList
call animateMenu
call _updateDirection
ld a, e
and JUMP
jr z, waitJump
waitJumpRelease:
ld hl, lanternList
call animateMenu
call _updateDirection
ld a, e
and JUMP
jr nz, waitJumpRelease
pop af
ret
;
; Display a prompt asking to input a direction key.
; When the key is pressed display it. If SPACE or ENTER
; is pressed, display the approprate message.
;
; Input:
; bc - Y/X screen position of prompt
; hl - Pointer to message to display
;
; Output:
; de - Scan code for the key pressed
getInput:
ld a, PAPER_BLACK|INK_WHITE
bcall printAttr
push hl
ld a, PAPER_BLACK|INK_GREEN|BRIGHT|FLASH
call setAttr
push bc
getKey:
ld hl, lanternList
call animateMenu
call keyboardScan ; Read the keyboard
jr z, getKey ; Process key press
ld (key), a
ld hl, lanternList
call waitReleaseKey
pop bc
cp 0x20
jr nz, notSpace
ld hl, spaceMsg
jr printKey
notSpace:
cp 0x0d
jr nz, notEnter
ld hl, enterMsg
jr printKey
notEnter:
ld hl, key
printKey:
ld a, PAPER_BLACK|INK_GREEN|BRIGHT
bcall printAttr
ld a, (key)
call lookupScanCode
pop hl
ret
section BSS_5
key:
ds 2
section RODATA_5
;
; List of lanterns on the this menu
;
lanternList:
db 4
dw SCREEN_ATTR_START+(7*32)+12
dw SCREEN_ATTR_START+(7*32)+13
dw SCREEN_ATTR_START+(7*32)+18
dw SCREEN_ATTR_START+(7*32)+19
defineKeyMsg:
db "Define Keys", 0x00
leftMsg:
db "Left - ", 0x00
rightMsg:
db "Right - ", 0x00
jumpMsg:
db "Jump - ", 0x00
spaceMsg:
db "SPACE", 0x00
enterMsg:
db "ENTER", 0x00
| 25.041284 | 79 | 0.462173 | [
"BSD-3-Clause"
] | iratahack/CastleEscape | src/definekeys.asm | 5,459 | Assembly |
; A189664: Fixed point of the morphism 0->010, 1->001.
; 0,1,0,0,0,1,0,1,0,0,1,0,0,1,0,0,0,1,0,1,0,0,0,1,0,1,0,0,1,0,0,0,1,0,1,0,0,1,0,0,0,1,0,1,0,0,1,0,0,1,0,0,0,1,0,1,0,0,0,1,0,1,0,0,1,0,0,1,0,0,0,1,0,1,0,0,0,1,0,1,0,0,1,0,0,0,1,0,1,0,0,1,0,0,1,0,0,0,1,0
add $0,1
seq $0,284817 ; a(n) = 2n - 1 - A284776(n).
| 51.833333 | 201 | 0.533762 | [
"Apache-2.0"
] | ckrause/cm | programs/oeis/189/A189664.asm | 311 | Assembly |
-S _wc
| 3.5 | 6 | 0.571429 | [
"MIT-0"
] | coopervk/xv6-small-file-optimization | wc.asm | 7 | Assembly |
; A039112: Numbers n such that representation in base 10 has same number of 0's and 1's.
; 2,3,4,5,6,7,8,9,10,22,23,24,25,26,27,28,29,32,33,34,35,36,37,38,39,42,43,44,45,46,47,48,49,52,53,54,55,56,57,58,59,62,63,64,65,66,67,68,69,72,73,74,75,76,77,78,79,82,83,84,85,86,87,88,89,92,93,94,95,96
mov $1,$0
mov $2,$0
lpb $2,1
add $0,$1
add $0,2
add $3,1
lpb $3,1
sub $0,1
add $1,9
trn $0,$1
trn $3,3
lpe
lpb $0,1
trn $0,8
add $1,2
mov $2,1
lpe
lpe
add $1,2
| 21.565217 | 203 | 0.580645 | [
"Apache-2.0"
] | karttu/loda | programs/oeis/039/A039112.asm | 496 | Assembly |
End of preview. Expand
in Dataset Viewer.
No dataset card yet
New: Create and edit this dataset card directly on the website!
Contribute a Dataset Card- Downloads last month
- 10