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 |
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r13
push %r15
push %r9
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x1aff1, %rdi
nop
nop
nop
add $52070, %r11
mov $0x6162636465666768, %r13
movq %r13, %xmm4
movups %xmm4, (%rdi)
nop
nop
nop
nop
nop
dec %r10
lea addresses_D_ht+0x30d5, %rsi
lea addresses_normal_ht+0x68cd, %rdi
sub $52716, %r9
mov $61, %rcx
rep movsq
nop
nop
sub $47622, %rcx
lea addresses_normal_ht+0x13d, %rcx
nop
nop
nop
nop
nop
sub $16137, %r9
mov (%rcx), %rsi
nop
nop
nop
nop
add %rcx, %rcx
lea addresses_WT_ht+0x1555d, %r11
nop
nop
nop
inc %rsi
mov $0x6162636465666768, %r10
movq %r10, %xmm2
movups %xmm2, (%r11)
nop
nop
nop
nop
add $9817, %rdi
lea addresses_WC_ht+0x4ecd, %r10
nop
nop
nop
nop
nop
cmp %r9, %r9
and $0xffffffffffffffc0, %r10
movntdqa (%r10), %xmm1
vpextrq $0, %xmm1, %r13
cmp %rsi, %rsi
lea addresses_A_ht+0xa093, %rsi
lea addresses_normal_ht+0x10123, %rdi
clflush (%rdi)
nop
nop
nop
sub $37229, %r11
mov $39, %rcx
rep movsq
nop
nop
nop
nop
xor %r9, %r9
lea addresses_normal_ht+0x834d, %rsi
lea addresses_WC_ht+0x100cd, %rdi
nop
sub %r11, %r11
mov $79, %rcx
rep movsq
nop
inc %r10
lea addresses_D_ht+0x7f0d, %rsi
lea addresses_normal_ht+0xb51d, %rdi
add %r11, %r11
mov $33, %rcx
rep movsw
nop
nop
and $52623, %rsi
lea addresses_UC_ht+0x1cacd, %rsi
lea addresses_A_ht+0x11acd, %rdi
nop
nop
nop
and $2003, %r15
mov $30, %rcx
rep movsw
nop
nop
add $34811, %r11
lea addresses_D_ht+0x2c4d, %rsi
lea addresses_WC_ht+0x1c645, %rdi
nop
nop
and %r10, %r10
mov $52, %rcx
rep movsb
cmp %r11, %r11
lea addresses_normal_ht+0x404d, %r9
clflush (%r9)
nop
inc %r10
movl $0x61626364, (%r9)
nop
nop
nop
nop
xor %r11, %r11
lea addresses_A_ht+0x2ecd, %r15
nop
nop
nop
nop
cmp %r13, %r13
movw $0x6162, (%r15)
nop
nop
inc %rcx
lea addresses_normal_ht+0x163af, %r10
nop
add $62938, %rcx
movl $0x61626364, (%r10)
nop
nop
inc %rsi
lea addresses_D_ht+0x28ab, %rcx
nop
nop
xor %rsi, %rsi
mov (%rcx), %r9w
nop
nop
nop
nop
inc %rcx
lea addresses_UC_ht+0x1edcd, %r13
nop
nop
dec %r10
mov (%r13), %esi
nop
nop
nop
cmp $18285, %r15
pop %rsi
pop %rdi
pop %rcx
pop %r9
pop %r15
pop %r13
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r15
push %rbx
push %rcx
push %rdi
push %rsi
// Store
mov $0x76df800000000acd, %r10
xor $36547, %rcx
movb $0x51, (%r10)
nop
xor $58395, %rdi
// Faulty Load
lea addresses_A+0xcecd, %r15
nop
nop
nop
nop
and $26914, %rbx
mov (%r15), %r10d
lea oracles, %rcx
and $0xff, %r10
shlq $12, %r10
mov (%rcx,%r10,1), %r10
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r15
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_NC', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 10}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 3, 'type': 'addresses_D_ht'}, 'dst': {'same': True, 'congruent': 9, 'type': 'addresses_normal_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 4}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 4}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC_ht', 'NT': True, 'AVXalign': False, 'size': 16, 'congruent': 7}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 0, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 1, 'type': 'addresses_normal_ht'}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 6, 'type': 'addresses_normal_ht'}, 'dst': {'same': False, 'congruent': 5, 'type': 'addresses_WC_ht'}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 5, 'type': 'addresses_D_ht'}, 'dst': {'same': False, 'congruent': 2, 'type': 'addresses_normal_ht'}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 10, 'type': 'addresses_UC_ht'}, 'dst': {'same': False, 'congruent': 9, 'type': 'addresses_A_ht'}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 6, 'type': 'addresses_D_ht'}, 'dst': {'same': True, 'congruent': 0, 'type': 'addresses_WC_ht'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 6}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': True, 'size': 2, 'congruent': 8}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal_ht', 'NT': True, 'AVXalign': False, 'size': 4, 'congruent': 1}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 1}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 7}}
{'00': 1267}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 33.753138 | 2,999 | 0.658981 | [
"MIT"
] | danielmgmi/medusa | Transynther/_processed/NONE/_zr_/i9-9900K_12_0xca_notsx.log_1267_1674.asm | 8,067 | Assembly |
;*** implements debug displays
;--- written by japheth
;--- public domain
;--- to be assembled with JWasm or Masm v6.1+
.486P
.model FLAT
option proc:private
option dotname
include jemm.inc ;common declarations
include jemm32.inc ;declarations for Jemm32
include debug.inc
?BUFFSTA equ 4F8h;physical start address buffer
?BUFFOFS equ 4FCh;offset in buffer
?BUFFSIZ equ 100000h
;--- publics/externals
include external.inc
;--- macros
; assume SS:FLAT,DS:FLAT,ES:FLAT
if ?DBGOUT
.text$01 segment
DbgPTE dd 0
.text$01 ends
.text$03 segment
;--- display DWORD in eax
VDWORDOUT proc public
push eax
shr eax,16
call VWORDOUT
pop eax
VDWORDOUT endp
VWORDOUT proc public
push eax
mov al,ah
call VBYTEOUT
pop eax
VWORDOUT endp
VBYTEOUT proc public
pushfd
push eax
mov ah,al
shr al,4
call VNIBOUT
mov al,ah
call VNIBOUT
pop eax
popfd
ret
VBYTEOUT endp
VNIBOUT proc
and al,0Fh
cmp al,10
sbb al,69H
das
jmp VPUTCHR
VNIBOUT endp
;--- make no assumptions about DS and ES here!
;--- also don't push/pop segment registers!
VPUTCHR PROC public
PUSHAD
if ?BUFFERED
test byte ptr ss:[417h],10h ;scroll lock on?
jz @@done
mov edi,ss:[?BUFFSTA]
and edi,edi
jz @@done
mov ecx,ss:[?BUFFOFS]
lea edx,[edi+ecx]
and dx,0F000h
or dl,1+2+4
mov ebx,[DbgPTE]
mov ss:[ebx], edx
mov esi,cr3
mov cr3,esi
@SYSPTE2LINEAR edi, ebx
movzx ebx,cx
and bh,0Fh
mov ss:[edi+ebx],al
inc ecx
and ecx,?BUFFSIZ-1
mov ss:[?BUFFOFS],ecx
@@done:
else
if ?USEMONO
mov edi,0B0000h
mov ebx,7
else
MOV EDI,0B8000h
CMP BYTE ptr SS:[463h],0B4h
JNZ @@IS_COLOR
XOR DI,DI
@@IS_COLOR:
movzx EBX, WORD PTR SS:[44Eh]
ADD EDI, EBX
MOVZX EBX, BYTE PTR SS:[462h]
endif
mov esi, edi
MOVZX ECX, BYTE PTR SS:[EBX*2+450h+1] ;ROW
if ?USEMONO
MOV EAX, 80
else
MOVZX EAX, WORD PTR SS:[44Ah]
endif
MUL ECX
MOVZX EDX, BYTE PTR SS:[EBX*2+450h] ;COL
ADD EAX, EDX
MOV DH,CL
LEA EDI, [EDI+EAX*2]
MOV AL, [ESP+1Ch]
CMP AL, 10
JZ @@NEWLINE
MOV SS:[EDI], AL
MOV byte ptr SS:[EDI+1], 07
INC DL
if ?USEMONO
cmp dl,80
else
CMP DL, BYTE PTR SS:[44Ah]
endif
JB @@OLDLINE
@@NEWLINE:
MOV DL, 00
INC DH
if ?USEMONO
CMP DH, 24
else
CMP DH, BYTE PTR SS:[484h]
endif
JBE @@OLDLINE
DEC DH
CALL @@SCROLL_SCREEN
@@OLDLINE:
MOV SS:[EBX*2+450h],DX
endif
POPAD
RET
ife ?BUFFERED
;--- scroll screen up 1 line
;--- esi -> start screen
@@SCROLL_SCREEN:
CLD
mov edi,esi
if ?USEMONO
mov eax,80
else
movzx eax,word ptr ss:[44Ah]
endif
push eax
lea esi, [esi+2*eax]
if ?USEMONO
mov CL, 24
else
MOV CL, SS:[484h]
endif
mul cl
mov ecx,eax
@@nextcell:
db 2Eh ;CS prefix
lodsw
mov ss:[edi],ax
add edi,2
loop @@nextcell
pop ecx
mov ax,0720h
@@nextcell2:
mov ss:[edi],ax
add edi,2
loop @@nextcell2
retn
endif
VPUTCHR ENDP
;--- print a string which is hard-coded behind the call to this function
VPRINTSTR PROC public
XCHG EBX,[ESP]
PUSH EAX
@@NEXTCHAR:
MOV AL,CS:[EBX] ; using CS prefix should always work here
INC EBX
CMP AL,0
JZ @@DONE
call VPUTCHR
JMP @@NEXTCHAR
@@DONE:
POP EAX
XCHG EBX,[ESP]
RET
VPRINTSTR endp
if 0
;--- support for 386SWAT: check if int 3 vector still points to
;--- the monitor code segment. If no, assume 386SWAT has intruded
DebugBreak proc public
cmp word ptr cs:[offset V86GDT+3*8+4],FLAT_CODE_SEL
jz @@noswat
pushfd
or byte ptr [esp+1],1 ;set TF
popfd
@@noswat:
ret
DebugBreak endp
endif
.text$03 ends
.text$04 segment
;--- init debug
;--- ESI -> Jemminit
Debug_Init proc public
if ?BUFFERED
cmp [bNoPool],0
jz @@ok
@@error:
;--- severe error. disable debug output
mov byte ptr ds:[VPUTCHR],0C9h
ret
@@ok:
mov edx, [XMS_Handle_Table.xht_pArray]
if 1;e ?INTEGRATED
movzx ecx, [XMS_Handle_Table.xht_numhandles]
movzx eax, [XMS_Handle_Table.xht_sizeof]
@@nextitem:
test [edx].XMS_HANDLE.xh_flags, XMSF_FREE
jz @@skipitem
cmp [edx].XMS_HANDLE.xh_sizeK, ?BUFFSIZ / 1024
jnc @@founditem
@@skipitem:
add edx,eax
loop @@nextitem
jmp @@error
@@founditem:
jz @@splitdone
push ebx
mov ebx, edx
@@nextitem2:
test [ebx].XMS_HANDLE.xh_flags, XMSF_INPOOL
jnz @@founditem2
add ebx,eax
loop @@nextitem2
pop ebx
jmp @@error
@@founditem2:
mov [ebx].XMS_HANDLE.xh_flags, XMSF_FREE
mov eax, [edx].XMS_HANDLE.xh_baseK
add eax, ?BUFFSIZ / 1024
mov [ebx].XMS_HANDLE.xh_baseK, eax
mov eax, [edx].XMS_HANDLE.xh_sizeK
sub eax, ?BUFFSIZ / 1024
mov [ebx].XMS_HANDLE.xh_sizeK, eax
pop ebx
@@splitdone:
mov [edx].XMS_HANDLE.xh_flags, XMSF_USED
mov [edx].XMS_HANDLE.xh_locks, 1
mov [edx].XMS_HANDLE.xh_sizeK, ?BUFFSIZ / 1024
mov eax, [edx].XMS_HANDLE.xh_baseK
else
mov eax, ?BUFFSIZ / 1024
cmp [edx+sizeof XMS_HANDLE].XMS_HANDLE.xh_sizeK, eax
jc @@error
sub [edx+sizeof XMS_HANDLE].XMS_HANDLE.xh_sizeK, eax
add [edx].XMS_HANDLE.xh_sizeK, eax
mov eax, [edx+sizeof XMS_HANDLE].XMS_HANDLE.xh_baseK
add [edx+sizeof XMS_HANDLE].XMS_HANDLE.xh_baseK, ?BUFFSIZ / 1024
endif
;--- now in EAX physical address of debug output buffer.
;--- we need a 4 kB page of linear address space to map
;--- the physical memory
shl eax, 10
mov ds:[?BUFFSTA],eax
mov edx,[PageMapHeap]
mov [DbgPTE], edx
mov ecx,?BUFFSIZ / 4096
or al,1+2+4
@@nextitem3:
mov [edx],eax
pushad
mov eax,cr3
mov cr3,eax
@SYSPTE2LINEAR edi, edx
mov ecx, 4096/4
xor eax, eax
rep stosd
popad
add eax,4096
loop @@nextitem3
add edx,4
mov [PageMapHeap], edx
xor eax, eax
mov ds:[?BUFFOFS],eax
endif
ret
Debug_Init endp
.text$04 ends
endif
END
| 17.267267 | 73 | 0.665217 | [
"MPL-2.0",
"MPL-2.0-no-copyleft-exception"
] | AlainODea/sdcboot | freedos/source/jemm/debug.asm | 5,750 | Assembly |
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) Geoworks 1994 -- All Rights Reserved
PROJECT: ConView Library
MODULE: Main
FILE: mainSpecialLink.asm
AUTHOR: Cassie Hartzog, January 26, 1995
MESSAGES:
ROUTINES:
Name Description
---- -----------
INT MSLHandleSpecialLink Looks for and handles special links.
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cassie 1/26/95 Initial revision
DESCRIPTION:
Code needed for dealing with special hyperlinks.
$Id: mainSpecialLink.asm,v 1.1 97/04/04 17:49:41 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
;
; First, some useful macros.
;
ClrZero macro
mov ax, 1
or ax, ax ; clear zero flag
endm
SetZero macro
xor ax, ax ; clear zero flag
endm
BookFileCode segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
MSLHandleSpecialLink
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Look for and handle special hyperlinks
CALLED BY: CGVFollowLinkLow
PASS: *ds:si - ContentGenView
ss:bp - ContentTextRequest
RETURN: Z flag - clear if caller needs to follow link in CTR,
(CTR_context may have been modified)
- set if caller shouldn't follow link
DESTROYED: anything but ds, si, bp may be destroyed
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
cassie 1/26/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
MSLHandleSpecialLink proc near
cmp {tchar}ss:[bp].CTR_context, '!'
je handleSpecial
ret
handleSpecial:
;
; The next char tells us what kind of special link this is.
;
SBCS < mov al, ss:[bp].CTR_context.[1] >
SBCS < sub al, ' ' >
DBCS < mov ax, ss:[bp].CTR_context.[1] >
DBCS < sub ax, ' ' >
EC < WARNING_S INVALID_SPECIAL_LINK_CHAR >
js done
SBCS < cmp al, length specialLinkHandlerTable >
DBCS < cmp ax, length specialLinkHandlerTable >
EC < WARNING_A INVALID_SPECIAL_LINK_CHAR >
ja done
;
; Find the special handler's offset in the table below
;
SBCS < clr ah >
shl ax ; word align the index
mov bx, ax
EC < swatLabel:: >
call cs:specialLinkHandlerTable[bx]
done:
ret
MSLHandleSpecialLink endp
;
; This table is indexed by the PC GEOS character set.
;
specialLinkHandlerTable nptr.near \
DefaultLinkHandler, ; C_SPACE
DefaultLinkHandler, ; '!'
DefaultLinkHandler, ; '"'
DefaultLinkHandler, ; '#'
DefaultLinkHandler, ; '$'
DefaultLinkHandler, ; '%'
DefaultLinkHandler, ; '&'
DefaultLinkHandler, ; '''
DefaultLinkHandler, ; '('
DefaultLinkHandler, ; ')'
DefaultLinkHandler, ; '*'
DefaultLinkHandler, ; '+'
DefaultLinkHandler, ; ','
DefaultLinkHandler, ; '-'
DefaultLinkHandler, ; '.'
DefaultLinkHandler, ; '/'
MSLStandardSoundError, ; '0'
MSLStandardSoundWarning, ; '1'
MSLStandardSoundNotify, ; '2'
MSLStandardSoundNoInput, ; '3'
MSLStandardSoundKeyClick, ; '4'
MSLStandardSoundAlarm, ; '5'
DefaultLinkHandler, ; '6'
DefaultLinkHandler, ; '7'
DefaultLinkHandler, ; '8'
DefaultLinkHandler, ; '9'
DefaultLinkHandler, ; ':'
DefaultLinkHandler, ; ';'
DefaultLinkHandler, ; '<'
DefaultLinkHandler, ; '='
DefaultLinkHandler, ; '>'
DefaultLinkHandler, ; '?'
DefaultLinkHandler, ; '@'
MSLLaunchApplicationAndQuit, ; 'A'
MSLGoBack, ; 'B'
DefaultLinkHandler, ; 'C'
DefaultLinkHandler, ; 'D'
DefaultLinkHandler, ; 'E'
DefaultLinkHandler, ; 'F'
DefaultLinkHandler, ; 'G'
MSLInvertHotspots, ; 'H'
DefaultLinkHandler, ; 'I'
DefaultLinkHandler, ; 'J'
DefaultLinkHandler, ; 'K'
DefaultLinkHandler, ; 'L'
DefaultLinkHandler, ; 'M'
MSLNextPage, ; 'N'
DefaultLinkHandler, ; 'O'
MSLPreviousPage, ; 'P'
MSLQuitBookReader, ; 'Q'
DefaultLinkHandler, ; 'R'
;;; MSLPlaySoundAndLink, ; 'S' - doesn't work yet!
DefaultLinkHandler, ; 'S'
MSLGotoTOC, ; 'T'
DefaultLinkHandler, ; 'U'
DefaultLinkHandler, ; 'V'
DefaultLinkHandler, ; 'W'
DefaultLinkHandler, ; 'X'
DefaultLinkHandler, ; 'Y'
DefaultLinkHandler, ; 'Z'
DefaultLinkHandler, ; '['
DefaultLinkHandler, ; '\'
DefaultLinkHandler, ; ']'
DefaultLinkHandler, ; '^'
DefaultLinkHandler, ; '_'
DefaultLinkHandler, ; '`'
MSLLaunchApplication, ; 'a'
DefaultLinkHandler, ; 'b'
DefaultLinkHandler, ; 'c'
DefaultLinkHandler, ; 'd'
DefaultLinkHandler, ; 'e'
DefaultLinkHandler, ; 'f'
DefaultLinkHandler, ; 'g'
DefaultLinkHandler, ; 'h'
DefaultLinkHandler, ; 'i'
DefaultLinkHandler, ; 'j'
DefaultLinkHandler, ; 'k'
DefaultLinkHandler, ; 'l'
DefaultLinkHandler, ; 'm'
DefaultLinkHandler, ; 'n'
DefaultLinkHandler, ; 'o'
DefaultLinkHandler, ; 'p'
DefaultLinkHandler, ; 'q'
DefaultLinkHandler, ; 'r'
;;; MSLPlaySound, ; 's' - doesn't work yet!
DefaultLinkHandler, ; 's'
DefaultLinkHandler, ; 't'
DefaultLinkHandler, ; 'u'
DefaultLinkHandler, ; 'v'
DefaultLinkHandler, ; 'w'
DefaultLinkHandler, ; 'x'
DefaultLinkHandler, ; 'y'
DefaultLinkHandler, ; 'z'
DefaultLinkHandler, ; '{'
DefaultLinkHandler, ; '|'
DefaultLinkHandler, ; '}'
DefaultLinkHandler ; '~'
.assert (length specialLinkHandlerTable eq ('~' - ' ')+1)
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DefaultLinkHandler
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Clear zero flag, so that link is handled normally
by CGVFollowLinkLow.
CALLED BY: MSLHandleSpecialLink
PASS: nothing
RETURN: Z flag is clear, so that link is treated normally
DESTROYED: ax
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
cassie 1/26/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DefaultLinkHandler proc near
mov ax, 1
or ax, ax ; clear zero flag
ret
DefaultLinkHandler endp
if 0 ; this doesn't work yet
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
MSLPlaySoundAndLink
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Play a .wav file whose name follows the ! in CTR_context,
and is terminated by a '.', and is followed by the NULL-
termianted name of a link to follow after playing the sound.
CALLED BY:
PASS: ss:bp - ContentTextRequest
RETURN: Z flag clear if there is a link name following the wav filename
Z flag set if no link name
DESTROYED: ax, cx, es, di
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
cassie 1/26/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
MSLPlaySoundAndLink proc near
uses si
.enter
;
; Look for the '.' which terminates the wav filename
; and replace it with a NULL.
;
segmov es, ss, ax
lea di, ss:[bp].CTR_context
mov cx, CONTEXT_NAME_BUFFER_SIZE
sub cx, (size tchar) * 2 ; sub NULL and '!S'
DBCS < mov ax, '.' >
SBCS < mov ax, '.' >
LocalFindChar
jnz playSound ; '.' not found!
sub di, size tchar
mov {tchar}es:[di], C_NULL
playSound:
pushf
push di ; save offset to link
call MSLPlaySound
pop si ; ds:si <- link name
popf
jnz noLink ; is there a link?
;
; Move the link name to the front of CTR_context
;
lea di, ss:[bp].CTR_context ; es:di - dest
segmov es, ds, ax
LocalCopyString
ClrZero ; do follow the link
done:
.leave
ret
noLink:
SetZero
jmp done
MSLPlaySoundAndLink endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
MSLPlaySound
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Play a .wav file whose name follows the ! in CTR_context
and is NULL-terminated.
CALLED BY:
PASS: ss:bp - ContentTextRequest
RETURN: Zero set
DESTROYED: ax, bx, di, es
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
cassie 1/26/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
standardWavExtension tchar ".wav",0
MSLPlaySound proc near
uses si, ds
.enter
;
; Save The current directory, go to the book's directory
;
call FilePushDir
call MFChangeToBookDirectory
;
; Copy the wav filename, which follows the '!' char, to our buffer
; and tack on the ".wav" extension.
;
sub sp, size FileLongName
mov di, sp
segmov es, ss, ax ; es:di <- filename buffer
mov ds, ax
lea si, {tchar}ss:[bp].CTR_context.[2]
LocalCopyString
sub di, size tchar ; point to the null
segmov ds, cs, ax
mov si, offset standardWavExtension
LocalCopyString
mov di, sp ; es:di <- wav filename
; Play the .wav file.
clr bx
mov {tchar}ss:[bp].CTR_context, 0
lea dx, ss:[bp].CTR_context
call WavPlayFile
call FilePopDir
add sp, size FileLongName
SetZero ; don't follow any link!
.leave
ret
MSLPlaySound endp
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
MSLInvertHotspots
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Causes the hotspots on the current page to toggle
invert themselves.
CALLED BY:
PASS: *ds:si - ContentGenView
RETURN: Zero flag set
DESTROYED: ax, di
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
cassie 1/26/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
MSLInvertHotspots proc near
mov ax, MSG_CT_TOGGLE_INVERT_AND_INVERT
clr di
call MUObjMessageSend
SetZero
ret
MSLInvertHotspots endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
MSLLaunchApplicationAndQuit
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:
CALLED BY:
PASS:
RETURN: Zero flag set
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
cassie 1/26/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
MSLLaunchApplicationAndQuit proc near
call MSLLaunchApplication
jcxz done
GOTO MSLQuitBookReader
done:
ret
MSLLaunchApplicationAndQuit endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
MSLLaunchApplication
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Launch an application
CALLED BY:
PASS: nada
RETURN: cx - non-zero app was successfully launched, as far as
we can tell
- 0 if error finding or launching app
Zero flag set
DESTROYED: ax, bx, cx, dx, di, es
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
changes to App directory
REVISION HISTORY:
Name Date Description
---- ---- -----------
cassie 1/26/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
MSLLaunchApplication proc near
uses si, ds
.enter
;
; Copy the app's token chars to a buffer
;
segmov ds, ss, ax
mov es, ax
sub sp, size GeodeToken
mov di, sp ; es:di <- buffer
lea si, ss:[bp].CTR_context.[2] ; ds:si <- TokenChars
mov cx, size TokenChars
rep movsb
xchg si, di ;ds:di<-manufID string
call LocalAsciiToFixed ;dx <- ManufID
mov es:[si], dx
mov di, sp ;es:di <- GeodeToken
;
; Create a launch block for IACP.
;
mov dx, MSG_GEN_PROCESS_OPEN_APPLICATION
call IACPCreateDefaultLaunchBlock
mov bx, dx
jc error
;
; Launch app using IACP.
;
push bp
mov ax, mask IACPCF_FIRST_ONLY or \
mask IACPCF_OBEY_LAUNCH_MODEL or \
(IACPSM_USER_INTERACTIBLE shl offset IACPCF_SERVER_MODE)
call IACPConnect
mov dx, ax
mov_tr ax, bp
pop bp
jc error
push bp
mov_tr bp, ax
clr cx, dx
call IACPShutdown
pop bp
mov cx, 1 ; no error
done:
add sp, size GeodeToken
SetZero
.leave
ret
error:
clr cx ; return error
jmp done
MSLLaunchApplication endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
MSLQuitBookReader
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Shuts down the app
CALLED BY:
PASS: nothing
RETURN: Zero flag set
DESTROYED: ax, bx, cx, di
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
cassie 1/26/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
MSLQuitBookReader proc near
mov ax, MSG_META_QUIT
call UserSendToApplicationViaProcess
SetZero
ret
MSLQuitBookReader endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
MSLStandardSound.....
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Play a standard sound and optionally follow a link,
if one follows the special hyperlink chars.
CALLED BY:
PASS: ss:bp - ContentTextRequest
RETURN: Z flag clear if there is a link name, now in CTR_context
Z flag set if no link name
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
cassie 1/26/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
MSLStandardSoundError proc near
mov ax, SST_ERROR
GOTO callUserStandardSound
MSLStandardSoundError endp
MSLStandardSoundWarning proc near
mov ax, SST_WARNING
GOTO callUserStandardSound
MSLStandardSoundWarning endp
MSLStandardSoundNotify proc near
mov ax, SST_NOTIFY
GOTO callUserStandardSound
MSLStandardSoundNotify endp
MSLStandardSoundNoInput proc near
mov ax, SST_NO_INPUT
GOTO callUserStandardSound
MSLStandardSoundNoInput endp
MSLStandardSoundKeyClick proc near
mov ax, SST_KEY_CLICK
GOTO callUserStandardSound
MSLStandardSoundKeyClick endp
MSLStandardSoundAlarm proc near
mov ax, SST_ALARM
FALL_THRU callUserStandardSound
MSLStandardSoundAlarm endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
callUserStandardSound
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Play the sound and look for a link name following the
special hyperlink chars.
CALLED BY:
PASS: *ds:si - ConGenView
RETURN: Z flag clear if there is a link name, now in CTR_context
Z flag set if no link name
DESTROYED: ax, di, es
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
cassie 1/26/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
callUserStandardSound proc near
uses ds, si
.enter
call UserStandardSound
cmp {tchar}ss:[bp].CTR_context.[2], 0
jz done
;
; Move the link name to the front of CTR_context
;
lea di, ss:[bp].CTR_context ; es:di <- dest
mov si, di
add si, (size tchar) * 2 ; move past !x
segmov es, ss, ax
mov ds, ax
LocalCopyString
ClrZero ; do follow the link
done:
.leave
ret
callUserStandardSound endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
MSLGoBack
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Send a message to go back to previously viewed page
CALLED BY: MSLHandleSpecialLink
PASS: nothing
RETURN: Z flag is set
DESTROYED: ax
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
cassie 1/26/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
MSLGoBack proc near
;
; Send a "go back" message to the nav controller.
;
mov ax, MSG_CNC_GO_BACK
GOTO SendMsgToCNCAndSetZFlag
MSLGoBack endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
MSLGotoTOC
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Send a message to goto the TOC
CALLED BY: MSLHandleSpecialLink
PASS: nothing
RETURN: Z flag is set
DESTROYED: ax
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
cassie 1/26/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
MSLGotoTOC proc near
;
; Send a "goto TOC" message to the nav controller.
;
mov ax, MSG_CNC_GOTO_TOC
GOTO SendMsgToCNCAndSetZFlag
MSLGotoTOC endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
MSLNextPage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Send a "goto next page" message to the nav controller.
CALLED BY: MSLHandleSpecialLink
PASS: nothing
RETURN: Z flag is set
DESTROYED: ax
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
cassie 1/26/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
MSLNextPage proc near
;
; Send a "goto next page" message to the nav controller.
;
mov ax, MSG_CNC_NEXT_PAGE
GOTO SendMsgToCNCAndSetZFlag
MSLNextPage endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
MSLPreviousPage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Send a "goto next page" message to the nav controller.
CALLED BY: MSLHandleSpecialLink
PASS: nothing
RETURN: Z flag is set
DESTROYED: ax
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
cassie 1/26/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
MSLPreviousPage proc near
;
; Send a "goto next page" message to the nav controller.
;
mov ax, MSG_CNC_PREVIOUS_PAGE
GOTO SendMsgToCNCAndSetZFlag
MSLPreviousPage endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SendMsgToCNCAndSetZFlag
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Force queue a message to ContentNavControl
CALLED BY: INT - utility
PASS: ax - message to send
*ds:si - ContentGenView
RETURN: Zero flag is set
DESTROYED: ax, bx, si, di
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
cassie 1/26/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SendMsgToCNCAndSetZFlag proc near
; record the passed message, which goes to ContentNavControl
push si
mov bx, segment ContentNavControlClass
mov si, offset ContentNavControlClass
mov di, mask MF_RECORD
call ObjMessage
mov cx, di
; record a classed event, which is sent to...
mov bx, segment ContentNavControlClass
mov si, offset ContentNavControlClass
mov ax, MSG_META_SEND_CLASSED_EVENT
mov dx, TO_SELF
mov di, mask MF_RECORD
call ObjMessage
mov cx, di
pop si
; the process, which will see that this message makes it
; to the NavControl.
mov ax, MSG_GEN_SEND_TO_PROCESS
call ObjCallInstanceNoLock
SetZero
ret
SendMsgToCNCAndSetZFlag endp
BookFileCode ends
| 25.620126 | 79 | 0.552828 | [
"Apache-2.0"
] | BOBBYWY/pcgeos | Library/ConView/Main/mainSpecialLink.asm | 20,368 | Assembly |
; ----------------------------------------------------------------------------------------
; This is a simple asm function called "myfunc" that returns a constant integer 66
; as function should return into RAX or otheinclueded , we use EAX as value is a simple integer
; -----------------------------------------------------------------------------------------
section .text
global myfunc
myfunc:
mov eax,66
ret
| 41.7 | 95 | 0.431655 | [
"Apache-2.0"
] | afterlisp/x64callexplore | explo_cpp1_simplefunc/myfunc.asm | 417 | Assembly |
; A023416: Number of 0's in binary expansion of n.
; 1,0,1,0,2,1,1,0,3,2,2,1,2,1,1,0,4,3,3,2,3,2,2,1,3,2,2,1,2,1,1,0,5,4,4,3,4,3,3,2,4,3,3,2,3,2,2,1,4,3,3,2,3,2,2,1,3,2,2,1,2,1,1,0,6,5,5,4,5,4,4,3,5,4,4,3,4,3,3,2,5,4,4,3,4,3,3,2,4,3,3,2,3,2,2,1,5,4,4,3,4,3,3,2,4,3,3,2,3,2,2,1,4,3,3,2,3,2,2,1,3,2,2,1,2,1,1,0,7,6,6,5,6,5,5,4,6,5,5,4,5,4,4,3,6,5,5,4,5,4,4,3,5,4,4,3,4,3,3,2,6,5,5,4,5,4,4,3,5,4,4,3,4,3,3,2,5,4,4,3,4,3,3,2,4,3,3,2,3,2,2,1,6,5,5,4,5,4,4,3,5,4,4,3,4,3,3,2,5,4,4,3,4,3,3,2,4,3,3,2,3,2,2,1,5,4,4,3,4,3,3,2,4,3,3,2,3,2,2,1,4,3,3,2,3,2,2,1,3,2
mov $8,$0
mov $10,2
lpb $10
clr $0,8
mov $0,$8
sub $10,1
add $0,$10
sub $0,1
mov $5,$0
mov $7,$0
add $7,1
lpb $7
mov $0,$5
sub $7,1
sub $0,$7
mov $2,7
mov $3,1
add $3,$0
lpb $0
div $0,2
add $2,4
add $2,$0
sub $2,2
add $3,1
lpe
mov $1,1
sub $2,$3
mul $1,$2
sub $1,5
add $6,$1
lpe
mov $1,$6
add $1,1
mov $11,$10
lpb $11
mov $9,$1
sub $11,1
lpe
lpe
lpb $8
mov $8,0
sub $9,$1
lpe
mov $1,$9
sub $1,1
| 21.897959 | 501 | 0.470643 | [
"Apache-2.0"
] | jmorken/loda | programs/oeis/023/A023416.asm | 1,073 | Assembly |
;
; z88dk GFX library
;
; Render the "stencil".
; The dithered horizontal lines base their pattern on the Y coordinate
; and on an 'intensity' parameter (0..11).
; Basic concept by Rafael de Oliveira Jannone
;
; Machine code version by Stefano Bodrato, 22/4/2009
;
; stencil_render(unsigned char *stencil, unsigned char intensity)
;
INCLUDE "graphics/grafix.inc"
IF !__CPU_INTEL__ & !__CPU_GBZ80__
SECTION smc_clib
PUBLIC stencil_render
PUBLIC _stencil_render
EXTERN dither_pattern
EXTERN swapgfxbk
EXTERN pixeladdress
EXTERN leftbitmask, rightbitmask
EXTERN swapgfxbk1
EXTERN __graphics_end
;
; $Id: stencil_render.asm,v 1.8 2016-04-22 20:29:52 dom Exp $
;
.stencil_render
._stencil_render
push ix
ld ix,4
add ix,sp
call swapgfxbk
ld bc,__graphics_end
push bc
IF maxy <> 256
ld c,maxy
ELSE
ld c,0
ENDIF
push bc
.yloop pop bc
dec c
;jp z,swapgfxbk1
ret z
push bc
ld d,0
ld e,c
ld l,(ix+2) ; stencil
ld h,(ix+3)
add hl,de
ld a,(hl) ;X1
IF maxy <> 256
ld e,maxy
add hl,de
ELSE
ld e,0
inc h
ENDIF
cp (hl) ; if x1>x2, return
jr nc,yloop
; C still holds Y
push af ; X1
ld a,(hl)
ld b,a ; X2
ld a,(ix+0) ; intensity
call dither_pattern
ld (pattern1+1),a
ld (pattern2+1),a
pop af
ld h,a ; X1
ld l,c ; Y
push bc
call pixeladdress ; bitpos0 = pixeladdress(x,y)
call leftbitmask ; LeftBitMask(bitpos0)
pop bc
push de
ld h,d
ld l,e
call mask_pattern
push af
;ld (hl),a
ld h,b ; X2
ld l,c ; Y
call pixeladdress ; bitpos1 = pixeladdress(x+width-1,y)
call rightbitmask ; RightBitMask(bitpos1)
ld (bitmaskr+1),a ; bitmask1 = LeftBitMask(bitpos0)
pop af ; pattern to be drawn (left-masked)
pop hl ; adr0
push hl
ex de,hl
and a
sbc hl,de
jr z,onebyte ; area is within the same address...
ld b,l ; number of full bytes in a row
pop hl
;ld de,8
ld (hl),a ; (offset) = (offset) AND bitmask0
;add hl,de
inc hl ; offset += 1 (8 bits)
.pattern2 ld a,0
dec b
jr z,bitmaskr
.fill_row_loop ; do
ld (hl),a ; (offset) = pattern
;add hl,de
inc hl ; offset += 1 (8 bits)
djnz fill_row_loop ; while ( r-- != 0 )
.bitmaskr ld a,0
call mask_pattern
ld (hl),a
jr yloop
.onebyte pop hl
ld (pattern1+1),a
jr bitmaskr
; Prepare an edge byte, basing on the byte mask in A
; and on the pattern being set in (pattern1+1)
.mask_pattern
ld d,a ; keep a copy of mask
and (hl) ; mask data on screen
ld e,a ; save masked data
ld a,d ; retrieve mask
cpl ; invert it
.pattern1 and 0 ; prepare fill pattern portion
or e ; mix with masked data
ret
ENDIF
| 17.037267 | 70 | 0.633248 | [
"Unlicense"
] | drunkfly/gamemyx | Tools/z88dk/libsrc/gfx/narrow/stencil_render.asm | 2,743 | Assembly |
; Phantasy Star tile/tilemap decompression routines
;
; WLA DX warning:
;
; Great as it is, sometimes WLA DX is buggy, and I've especially found
; this with anonymous labels. If you're gettng screwy results, a
; temporary fix is often to change the anonymous labels (-, +, __, etc)
; to named labels.
;
; Usage notes:
;
; Tile loaders:
;
; ld de,<target VRAM address ORed with $4000>
; ld hl,<data address>
; call LoadTiles4BitRLE
;
; or
;
; ld de,<target VRAM address ORed with $4000>
; ld hl,<data address>
; call LoadTiles4BitRLENoDI
;
; The NoDI one does not di/ei around the VRAM accesses, so it's a bit
; faster but will be messed up by VBlanks.
;
; Tilemap loader 1:
;
; You need to define a constant called TileMapData. This must be a RAM
; address of a copy of the tilemap which you'll have to copy into VRAM
; during the VBlank.
;
; ld hl,<data address>
; call LoadTilemapToTileMapData
;
; I haven't supplied the code to do the copying from RAM to VRAM.
;
; Tilemap loader 2:
;
; ld de,<target VRAM address ORed with $4000>
; ld hl,<data address>
; call LoadTilemapToVRAM
;
; This is one I wrote myself :) based on the tile loader. It loads the
; tilemap directly into VRAM. It does not offer a version with di/ei
; around VRAM accesses, because updating the tilemap during the active
; display is generally bad; if you really want, you can modify it to
; do that.
;
; Note:
;
; Phantasy Star locates its SetVRAMAddressToDE function at offset
; $0008, so it can do
; rst $08 (1 byte, 11 clock cycles)
; instead of
; call SetVRAMAddressToDE (3 bytes, 17 clock cycles)
; If your code is using that then either define UseRst yourself, or
; uncomment the next line.
;.define UseRst
.section "SetVRAMAddressToDE" free
SetVRAMAddressToDE:
ld a,e
out ($bf),a
ld a,d
out ($bf),a
ret
.ends
.section "Tile loader (4 bpp RLE, no di/ei)" free
; Decompresses tile data from hl to VRAM address de
LoadTiles4BitRLENoDI:
ld b,$04
-:push bc
push de
call _f ; called 4 times for 4 bitplanes
pop de
inc de
pop bc
djnz -
ret
_NotAnonymous:
__:
ld a,(hl) ; read count byte <----+
inc hl ; increment pointer |
or a ; return if zero |
ret z ; |
; |
ld c,a ; get low 7 bits in b |
and $7f ; |
ld b,a ; |
ld a,c ; set z flag if high |
and $80 ; bit = 0 |
; |
-: ; |
.ifdef UseRst ; SetVRAMAddressToDE<+ |
rst $08 ; | |
.else ; | |
call SetVRAMAddressToDE ; | |
.endif ; | |
ld a,(hl) ; Get data byte in a | |
out ($be),a ; Write it to VRAM | |
jp z,+ ; If z flag then -+ | |
; skip inc hl | | |
inc hl ; | | |
; | | |
+:inc de ; Add 4 to de <----+ | |
inc de ; | |
inc de ; | |
inc de ; | |
djnz - ; repeat block -----+ |
; b times |
jp nz,_b ; If not z flag -------+
inc hl ; inc hl here instead |
jp _b ; repeat forever ------+
; (zero count byte quits)
.ends
.section "Phantasy Star Tile loader (4 bpp RLE, with di/ei)" free
LoadTiles4BitRLE: ; Same as NoDI only with a di/ei around the VRAM access (because VBlanks will mess it up)
ld b,$04 ; 4 bitplanes
-:push bc
push de
call _f ; called 4 times for 4 bitplanes
pop de
inc de
pop bc
djnz -
ret
__:
ld a,(hl) ; header byte
inc hl ; data byte
or a
ret z ; exit at zero terminator
ld c,a ; c = header byte
and $7f
ld b,a ; b = count
ld a,c
and $80 ; z flag = high bit
-:di
.ifdef UseRst
rst $08
.else
call SetVRAMAddressToDE
.endif
ld a,(hl)
out ($be),a ; output data
ei
jp z,+ ; if z flag then don't move to next data byte
inc hl
+:inc de ; move target forward 4 bytes
inc de
inc de
inc de
djnz - ; repeat b times
jp nz,_b
inc hl
jp _b
.ends
.section "Decompress to TileMapData" free
; Copies data from (hl) to TileMapData
; with RLE decompression and 2-interleaving
; data format:
; Header: $fccccccc
; f = flag: 1 = not RLE, 0 = RLE
; ccccccc = count
; Then [count] bytes are copied to even bytes starting at TileMapData
; Then the process is repeated for the odd bytes
LoadTilemapToTileMapData:
ld b,$00 ; b=0
ld de,TileMapData
call _f ; Process even bytes first -------------+
inc hl ; and odd bytes second |
ld de,TileMapData+1 ; |
__:ld a,(hl) ; Get data count in a <-----------------+
or a ; \ return |
ret z ; / if zero |
jp m,+ ; if bit 8 is set then ---------------+ |
; else: | |
ld c,a ; put it in c -> bc = data count | |
inc hl ; move hl pointer to next byte (data) | |
-:ldi ; copy 1 byte from hl to de, <------+ | |
; inc hl, inc de, dec bc | | |
dec hl ; move hl pointer back (RLE) | | |
inc de ; skip dest byte | | |
jp pe,- ; if bc!=0 then repeat -------------+ | |
inc hl ; move past RLE'd byte | |
jp _b ; repeat -----------------------------|-+
+:and $7f ; (if bit 8 is set:) unset it <-------+ |
ld c,a ; put it in c -> bc = data count |
inc hl ; move hl pointer to next byte (data) |
-:ldi ; copy 1 byte from hl to de, <--------+ |
; inc hl, inc de, dec bc | |
inc de ; skip dest byte | |
jp pe,- ; if bc!=0 then repeat ---------------+ |
jp _b ; repeat -------------------------------+
.ends
.section "Decompress tilemap to VRAM" free
; Decompresses tilemap data from hl to VRAM address de
; This isn't from Phantasy Star; it's the tile routine modified for
; interleaving 2 instead of 4
LoadTilemapToVRAM:
push de
call _f
pop de
inc de
call _f
ret
__:
ld a,(hl) ; read count byte <----+
inc hl ; increment pointer |
or a ; return if zero |
ret z ; |
; |
ld c,a ; get low 7 bits in b |
and $7f ; |
ld b,a ; |
ld a,c ; set z flag if high |
and $80 ; bit = 0 |
; |
-:di ; |
.ifdef UseRst ; SetVRAMAddressToDE<+ |
rst $08 ; | |
.else ; | |
call SetVRAMAddressToDE ; | |
.endif ; | |
ld a,(hl) ; Get data byte in a | |
out ($be),a ; Write it to VRAM | |
ei
jr z,+ ; If z flag then -+ | |
; skip inc hl | | |
inc hl ; | | |
; | | |
+:inc de ; Add 2 to de <----+ | |
inc de ; | |
djnz - ; repeat block -----+ |
; b times |
jr nz,_b ; If not z flag -------+
inc hl ; inc hl here instead |
jr _b ; repeat forever ------+
; (zero count byte quits)
.ends
| 33.429719 | 110 | 0.444137 | [
"MIT"
] | maxim-zhao/bmp2tile | demo/Phantasy Star decompressor.asm | 8,324 | Assembly |
[BITS 32]
[global _start]
[ORG 0x100000]
;If using '-f bin' we need to specify the
;origin point for our code with ORG directive
;multiboot loaders load us at physical
;address 0x100000
MULTIBOOT_AOUT_KLUDGE equ 1 << 16
;FLAGS[16] indicates to GRUB we are not
;an ELF executable and the fields
;header address, load address, load end address;
;bss end address and entry address will be available
;in Multiboot header
MULTIBOOT_ALIGN equ 1<<0
; align loaded modules on page boundaries
MULTIBOOT_MEMINFO equ 1<<1
; provide memory map
MULTIBOOT_VBE_MODE equ 1<<2
MULTIBOOT_HEADER_MAGIC equ 0x1BADB002
;magic number GRUB searches for in the first 8k
;of the kernel file GRUB is told to load
MULTIBOOT_HEADER_FLAGS equ MULTIBOOT_AOUT_KLUDGE|MULTIBOOT_ALIGN|MULTIBOOT_MEMINFO|MULTIBOOT_VBE_MODE
CHECKSUM equ -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS)
_start:
xor eax, eax ;Clear eax and ebx in the event
xor ebx, ebx ;we are not loaded by GRUB.
jmp multiboot_entry ;Jump over the multiboot header
align 4 ;Multiboot header must be 32
;bits aligned to avoid error 13
multiboot_header:
dd MULTIBOOT_HEADER_MAGIC ;magic number
dd MULTIBOOT_HEADER_FLAGS ;flags
dd CHECKSUM ;checksum
dd multiboot_header ;header address
dd _start ;load address of code entry point
;in our case _start
dd 00 ;load end address : not necessary
dd 00 ;bss end address : not necessary
dd multiboot_entry ;entry address GRUB will start at
; Uncomment this and "|MULTIBOOT_VBE_MODE" in MULTIBOOT_HEADER_FLAGS to enable VBE
dd 00
; Safe resolution
dd 1024
dd 768
dd 32
multiboot_entry:
mov esp, STACKTOP ;Setup the stack
push 0 ;Reset EFLAGS
popf
push eax ;2nd argument is magic number
push ebx ;1st argument multiboot info pointer
mov [multiboot_pointer],ebx
jmp Enter_Long_Mode
cli
hlt
jmp $
multiboot_pointer:
dq 0
ALIGN 4
IDT:
.Length dw 0
.Base dd 0
; Function to switch directly to long mode from real mode.
; Identity maps the first 1GiB.
; Uses Intel syntax.
; es:edi Should point to a valid page-aligned 16KiB buffer, for the PML4, PDPT, PD and a PT.
; ss:esp Should point to memory that can be used as a small (1 uint32_t) stack
Enter_Long_Mode:
mov edi, P4_TABLE
; Zero out the 16KiB buffer.
; Since we are doing a rep stosd, count should be bytes/4.
push di ; REP STOSD alters DI.
; map first P4 entry to P3 table
mov eax, P3_TABLE
or eax, 0b11 ; present + writable
mov [P4_TABLE], eax
; map first P3 entry to P2 table
mov eax, P2_TABLE
or eax, 0b11 ; present + writable
mov [P3_TABLE], eax
; map each P2 entry to a huge 2MiB page
mov ecx, 0 ; counter variable
.Map_P2_Table:
; map ecx-th P2 entry to a huge page that starts at address 2MiB*ecx
mov eax, 0x200000 ; 2MiB
mul ecx ; start address of ecx-th page
or eax, 0b10000011 ; present + writable + huge
mov [P2_TABLE + ecx * 8], eax ; map ecx-th entry
inc ecx ; increase counter
cmp ecx, 512 ; if counter == 512, the whole P2 table is mapped
jne .Map_P2_Table ; else map the next entry
;1024MB of memory should be mapped now
pop di ; Restore DI.
; Disable IRQs
mov al, 0xFF ; Out 0xFF to 0xA1 and 0x21 to disable all IRQs.
out 0xA1, al
out 0x21, al
cli
nop
nop
lidt [IDT] ; Load a zero length IDT so that any NMI causes a triple fault.
; Enter long mode.
mov eax, 10100000b ; Set the PAE and PGE bit.
mov cr4, eax
mov edx, edi ; Point CR3 at the PML4.
mov cr3, edx
mov ecx, 0xC0000080 ; Read from the EFER MSR.
rdmsr
or eax, 0x00000100 ; Set the LME bit.
wrmsr
mov ebx, cr0 ; Activate long mode -
or ebx,0x80000001 ; - by enabling paging and protection simultaneously.
mov cr0, ebx
lgdt [GDT.Pointer] ; Load GDT.Pointer defined below.
sti
jmp 0x0008:Main ; Load CS with 64 bit segment and flush the instruction cache
; Global Descriptor Table
GDT:
.Null:
dq 0x0000000000000000 ; Null Descriptor - should be present.
.Code:
dq 0x00209A0000000000 ; 64-bit code descriptor (exec/read).
dq 0x0000920000000000 ; 64-bit data descriptor (read/write).
ALIGN 4
dw 0 ; Padding to make the "address of the GDT" field aligned on a 4-byte boundary
.Pointer:
dw $ - GDT - 1 ; 16-bit Size (Limit) of GDT.
dd GDT ; 32-bit Base Address of GDT. (CPU will zero extend to 64-bit)
struc DOSHeader
.e_magic: resb 2
.e_cblp: resb 2
.e_cp: resb 2
.e_crlc: resb 2
.e_cparhdr: resb 2
.e_minalloc: resb 2
.e_maxalloc: resb 2
.e_ss: resb 2
.e_sp: resb 2
.e_csum: resb 2
.e_ip: resb 2
.e_cs: resb 2
.e_lfarlc: resb 2
.e_ovno: resb 2
.e_res1: resb 8
.e_oemid: resb 2
.e_oeminfo: resb 2
.e_res2: resb 20
.e_lfanew: resb 4
endstruc
struc NTHeader
.Signature: resb 4
.Machine: resb 2
.NumberOfSections: resb 2
.TimeDateStamp: resb 4
.PointerToSymbolTable: resb 4
.NumberOfSymbols: resb 4
.SizeOfOptionalHeader: resb 2
.Characteristics: resb 2
.Magic: resb 2
.MajorLinkerVersion: resb 1
.MinorLinkerVersion: resb 1
.SizeOfCode: resb 4
.SizeOfInitializedData: resb 4
.SizeOfUninitializedData: resb 4
.AddressOfEntryPoint: resb 4
.BaseOfCode: resb 4
.ImageBase: resb 8
.SectionAlignment: resb 4
.FileAlignment: resb 4
.MajorOperatingSystemVersion: resb 2
.MinorOperatingSystemVersion: resb 2
.MajorImageVersion: resb 2
.MinorImageVersion: resb 2
.MajorSubsystemVersion: resb 2
.MinorSubsystemVersion: resb 2
.Win32VersionValue: resb 4
.SizeOfImage: resb 4
.SizeOfHeaders: resb 4
.CheckSum: resb 4
.Subsystem: resb 2
.DllCharacteristics: resb 2
.SizeOfStackReserve: resb 8
.SizeOfStackCommit: resb 8
.SizeOfHeapReserve: resb 8
.SizeOfHeapCommit: resb 8
.LoaderFlags: resb 4
.NumberOfRvaAndSizes: resb 4
.Tables: resb 128
endstruc
struc SectionHeader
.Name: resb 8
.PhysicalAddress_VirtualSize: resb 4
.VirtualAddress: resb 4
.SizeOfRawData: resb 4
.PointerToRawData: resb 4
.PointerToRelocations: resb 4
.PointerToLineNumbers: resb 4
.NumberOfRelocations: resb 2
.NumberOfLineNumbers: resb 2
.Characteristics: resb 4
endstruc
LOAD_IMAGE_PARAMS_STACK_SIZE equ 64
[BITS 64]
Main:
mov ax, 0x0010
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
mov ss, ax
mov rsp,STACKTOP
mov rbp,rsp
sub rsp,LOAD_IMAGE_PARAMS_STACK_SIZE
xor rbx,rbx
mov ebx,[EXE+DOSHeader.e_lfanew]
lea ebx,[ebx+EXE+NTHeader.NumberOfSections]
xor rcx,rcx
mov cx,[rbx]
mov [rsp+16],rcx
xor rbx,rbx
mov ebx,[EXE+DOSHeader.e_lfanew]
lea ebx,[ebx+EXE+NTHeader.ImageBase]
mov rbx,[rbx]
mov [rsp+24],rbx
xor rbx,rbx
mov ebx,[EXE+DOSHeader.e_lfanew]
lea ebx,[ebx+EXE+NTHeader.AddressOfEntryPoint]
mov ebx,[ebx]
mov rax,[rsp+24]
add rbx,rax
mov [rsp+8],rbx
xor rbx,rbx
mov ebx,[EXE+DOSHeader.e_lfanew]
lea ebx,[ebx+EXE+NTHeader.SizeOfImage]
mov ebx,[ebx]
mov [rsp+48],rbx
mov rdi,[rsp+24]
mov rcx,[rsp+48]
mov rax,0
rep stosb
xor rbx,rbx
mov ebx,[EXE+DOSHeader.e_lfanew]
lea ebx,[ebx+EXE+NTHeader_size]
mov r15,0
LoadSection:
xor rsi,rsi
xor rdi,rdi
xor rcx,rcx
xor r13,r13
lea esi,[ebx+SectionHeader.PointerToRawData]
mov esi,[esi]
add rsi,EXE
lea ecx,[ebx+SectionHeader.SizeOfRawData]
mov ecx,[ecx]
lea edi,[ebx+SectionHeader.VirtualAddress]
mov edi,[edi]
mov rax,[rsp+24]
add rdi,rax
lea r13d,[ebx+SectionHeader.Name]
mov r13,[r13]
mov qword r14,0x73656C75646F6D2E
cmp qword r13,r14
jne Skip
mov qword [rsp+32],rdi
Skip:
rep movsb
inc r15
add ebx,SectionHeader_size
mov r14,[rsp+16]
cmp r15,r14
jne LoadSection
mov rcx,[multiboot_pointer]
mov rdx,[rsp+32]
mov rax,[rsp+8]
add rsp,LOAD_IMAGE_PARAMS_STACK_SIZE
call rax
cli
hlt
jmp $
align 4096
STACKBOTTOM:
resb 32768
STACKTOP:
P4_TABLE:
resb 4096
P3_TABLE:
resb 4096
P2_TABLE:
resb 4096
align 4096
EXE:
| 27.623188 | 115 | 0.591815 | [
"MIT"
] | nifanfa/OS-Sharp64 | Tools/EntryPoint.asm | 9,530 | Assembly |
; A010052: Characteristic function of squares: a(n) = 1 if n is a square, otherwise 0.
; 1,1,0,0,1,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
mov $2,1
lpb $0
sub $2,2
add $0,$2
lpe
bin $1,$0
mov $0,$1
| 32.090909 | 201 | 0.552408 | [
"Apache-2.0"
] | ckrause/cm | programs/oeis/010/A010052.asm | 353 | Assembly |
; A083708: G.f.: (x+4*x^3+x^5)/((1-x)^2*(1-x^2)^2*(1-x^3)^2).
; 0,1,2,9,18,39,72,126,204,324,484,710,1008,1401,1902,2547,3342,4335,5544,7012,8768,10872,13344,16260,19656,23601,28146,33381,39346,46151,53856,62562,72348,83340,95604,109290,124488,141337,159950,180495,203070,227871
lpb $0
mov $2,$0
trn $0,3
seq $2,83707 ; G.f.: (x+4*x^3+x^5)/((1-x)^2*(1-x^2)^2*(1-x^3)).
add $1,$2
lpe
mov $0,$1
| 36.545455 | 216 | 0.629353 | [
"Apache-2.0"
] | ckrause/cm | programs/oeis/083/A083708.asm | 402 | Assembly |
.model small
.stack 100h
.data
bytes db 65,66
words dw 45h
.code
mov ax, @data
mov ds, ax
mov bp, offset words
mov ax, 82h
mov si,0
sub word ptr [ds:bp],2
mov ax, [ds:bp]
;despliega cx veces lo que esta contenido en AL
mov AH,0ah
xor bx,bx
mov cx,1
int 10h
fin:
mov ah,4ch
int 21h
end
| 13.214286 | 51 | 0.548649 | [
"Apache-2.0"
] | MiguelGomez/labs | Assembly/prueba.asm | 370 | Assembly |
;******************************************************************************
;* MMX optimized deinterlacing functions
;* Copyright (c) 2010 Vitor Sessak
;* Copyright (c) 2002 Michael Niedermayer
;*
;* This file is part of FFmpeg.
;*
;* FFmpeg is free software; you can redistribute it and/or
;* modify it under the terms of the GNU Lesser General Public
;* License as published by the Free Software Foundation; either
;* version 2.1 of the License, or (at your option) any later version.
;*
;* FFmpeg is distributed in the hope that it will be useful,
;* but WITHOUT ANY WARRANTY; without even the implied warranty of
;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;* Lesser General Public License for more details.
;*
;* You should have received a copy of the GNU Lesser General Public
;* License along with FFmpeg; if not, write to the Free Software
;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
;******************************************************************************
%include "libavutil/x86/x86util.asm"
SECTION_RODATA
cextern pw_4
SECTION .text
%macro DEINTERLACE 1
%ifidn %1, inplace
;void ff_deinterlace_line_inplace_mmx(const uint8_t *lum_m4, const uint8_t *lum_m3, const uint8_t *lum_m2, const uint8_t *lum_m1, const uint8_t *lum, int size)
cglobal deinterlace_line_inplace_mmx, 6,6,7, lum_m4, lum_m3, lum_m2, lum_m1, lum, size
%else
;void ff_deinterlace_line_mmx(uint8_t *dst, const uint8_t *lum_m4, const uint8_t *lum_m3, const uint8_t *lum_m2, const uint8_t *lum_m1, const uint8_t *lum, int size)
cglobal deinterlace_line_mmx, 7,7,7, dst, lum_m4, lum_m3, lum_m2, lum_m1, lum, size
%endif
pxor mm7, mm7
movq mm6, [pw_4]
.nextrow:
movd mm0, [lum_m4q]
movd mm1, [lum_m3q]
movd mm2, [lum_m2q]
%ifidn %1, inplace
movd [lum_m4q], mm2
%endif
movd mm3, [lum_m1q]
movd mm4, [lumq]
punpcklbw mm0, mm7
punpcklbw mm1, mm7
punpcklbw mm2, mm7
punpcklbw mm3, mm7
punpcklbw mm4, mm7
paddw mm1, mm3
psllw mm2, 1
paddw mm0, mm4
psllw mm1, 2
paddw mm2, mm6
paddw mm1, mm2
psubusw mm1, mm0
psrlw mm1, 3
packuswb mm1, mm7
%ifidn %1, inplace
movd [lum_m2q], mm1
%else
movd [dstq], mm1
add dstq, 4
%endif
add lum_m4q, 4
add lum_m3q, 4
add lum_m2q, 4
add lum_m1q, 4
add lumq, 4
sub sized, 4
jg .nextrow
REP_RET
%endmacro
DEINTERLACE ""
DEINTERLACE inplace
| 30.518072 | 166 | 0.641927 | [
"MIT"
] | DFabric/InBrowserTools | apps/audioconverter/ffmpeg.js/libavcodec/x86/deinterlace.asm | 2,533 | Assembly |
; ---------------------------------------------------------------------------
; Animation script - doors (SBZ)
; ---------------------------------------------------------------------------
dc.w Ani_obj2A_Shut-Ani_obj2A
dc.w Ani_obj2A_Open-Ani_obj2A
Ani_obj2A_Shut: dc.b 0, 8, 7, 6, 5, 4, 3, 2, 1, 0, $FE, 1
Ani_obj2A_Open: dc.b 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, $FE, 1
even | 46.875 | 77 | 0.370667 | [
"Apache-2.0"
] | NatsumiFox/AMPS-Sonic-1-2005 | _anim/obj2A.asm | 375 | Assembly |
extern m7_ippsDLPGetSize:function
extern n8_ippsDLPGetSize:function
extern y8_ippsDLPGetSize:function
extern e9_ippsDLPGetSize:function
extern l9_ippsDLPGetSize:function
extern n0_ippsDLPGetSize:function
extern k0_ippsDLPGetSize:function
extern ippcpJumpIndexForMergedLibs
extern ippcpSafeInit:function
segment .data
align 8
dq .Lin_ippsDLPGetSize
.Larraddr_ippsDLPGetSize:
dq m7_ippsDLPGetSize
dq n8_ippsDLPGetSize
dq y8_ippsDLPGetSize
dq e9_ippsDLPGetSize
dq l9_ippsDLPGetSize
dq n0_ippsDLPGetSize
dq k0_ippsDLPGetSize
segment .text
global ippsDLPGetSize:function (ippsDLPGetSize.LEndippsDLPGetSize - ippsDLPGetSize)
.Lin_ippsDLPGetSize:
db 0xf3, 0x0f, 0x1e, 0xfa
call ippcpSafeInit wrt ..plt
align 16
ippsDLPGetSize:
db 0xf3, 0x0f, 0x1e, 0xfa
mov rax, qword [rel ippcpJumpIndexForMergedLibs wrt ..gotpc]
movsxd rax, dword [rax]
lea r11, [rel .Larraddr_ippsDLPGetSize]
mov r11, qword [r11+rax*8]
jmp r11
.LEndippsDLPGetSize:
| 25.974359 | 83 | 0.782823 | [
"Apache-2.0"
] | zyktrcn/ippcp | _build/dispatcher/jmp_ippsDLPGetSize_1b609b9b.asm | 1,013 | Assembly |
.macosx_version_min 10, 10
.section __TEXT,__text,regular,pure_instructions
.align 4, 0x90
.globl _PyToken_OneChar
_PyToken_OneChar:
pushl %ebp
movl %esp, %ebp
movl 8(%ebp), %ecx
cmpl $93, %ecx
jg L0000001C
L0000000B:
cmpl $57, %ecx
jg L0000002D
L00000010:
cmpl $37, %ecx
jne L00000061
L00000015:
movl $24, %eax
popl %ebp
ret
L0000001C:
cmpl $95, %ecx
jg L00000050
L00000021:
cmpl $94, %ecx
jne L00000091
L00000026:
movl $33, %eax
popl %ebp
ret
L0000002D:
addl $-58, %ecx
cmpl $6, %ecx
ja L00000091
L00000035:
call L0000003A
L0000003A:
popl %edx
movl $11, %eax
addl L000000A8-L0000003A(%edx,%ecx,4), %edx
jmp *%edx
L00000049:
movl $22, %eax
popl %ebp
ret
L00000050:
cmpl $124, %ecx
jg L0000006D
L00000055:
cmpl $96, %ecx
jne L00000079
L0000005A:
movl $25, %eax
popl %ebp
ret
L00000061:
cmpl $46, %ecx
jne L00000091
L00000066:
movl $23, %eax
popl %ebp
ret
L0000006D:
cmpl $125, %ecx
jne L00000085
L00000072:
movl $27, %eax
popl %ebp
ret
L00000079:
cmpl $123, %ecx
jne L00000091
L0000007E:
movl $26, %eax
popl %ebp
ret
L00000085:
cmpl $126, %ecx
jne L00000091
L0000008A:
movl $32, %eax
popl %ebp
ret
L00000091:
movl $51, %eax
L00000096:
popl %ebp
ret
L00000098:
movl $21, %eax
popl %ebp
ret
L0000009F:
movl $50, %eax
popl %ebp
ret
.align 2, 0x90
L000000A8:
.long L00000096-L0000003A
.long L00000091-L0000003A
.long L00000091-L0000003A
.long L00000049-L0000003A
.long L00000098-L0000003A
.long L00000091-L0000003A
.long L0000009F-L0000003A
# ----------------------
.align 4, 0x90
.globl _PyToken_TwoChars
_PyToken_TwoChars:
pushl %ebp
movl %esp, %ebp
movl 12(%ebp), %ecx
movl 8(%ebp), %eax
cmpl $60, %eax
jg L00000103
L000000DE:
addl $-33, %eax
cmpl $14, %eax
ja L0000018A
L000000EA:
call L000000EF
L000000EF:
popl %edx
addl L000001B0-L000000EF(%edx,%eax,4), %edx
jmp *%edx
L000000F9:
movl $29, %eax
jmp L00000185
L00000103:
cmpl $93, %eax
jg L00000114
L00000108:
cmpl $61, %eax
jne L00000120
L0000010D:
movl $28, %eax
jmp L00000185
L00000114:
cmpl $94, %eax
jne L00000142
L00000119:
movl $44, %eax
jmp L00000185
L00000120:
cmpl $62, %eax
jne L0000018A
L00000125:
cmpl $62, %ecx
movl $35, %eax
movl $51, %edx
cmove %eax, %edx
cmpl $61, %ecx
movl $31, %eax
cmovne %edx, %eax
popl %ebp
ret
L00000142:
cmpl $124, %eax
jne L0000018A
L00000147:
movl $43, %eax
jmp L00000185
L0000014E:
movl $41, %eax
jmp L00000185
L00000155:
movl $42, %eax
jmp L00000185
L0000015C:
cmpl $61, %ecx
movl $39, %eax
movl $51, %edx
cmove %eax, %edx
cmpl $42, %ecx
movl $36, %eax
cmovne %edx, %eax
popl %ebp
ret
L00000179:
movl $37, %eax
jmp L00000185
L00000180:
movl $38, %eax
L00000185:
cmpl $61, %ecx
je L0000018F
L0000018A:
movl $51, %eax
L0000018F:
popl %ebp
ret
L00000191:
cmpl $61, %ecx
movl $40, %eax
movl $51, %edx
cmove %eax, %edx
cmpl $47, %ecx
movl $48, %eax
cmovne %edx, %eax
popl %ebp
ret
.align 2, 0x90
L000001B0:
.long L000000F9-L000000EF
.long L0000018A-L000000EF
.long L0000018A-L000000EF
.long L0000018A-L000000EF
.long L0000014E-L000000EF
.long L00000155-L000000EF
.long L0000018A-L000000EF
.long L0000018A-L000000EF
.long L0000018A-L000000EF
.long L0000015C-L000000EF
.long L00000179-L000000EF
.long L0000018A-L000000EF
.long L00000180-L000000EF
.long L0000018A-L000000EF
.long L00000191-L000000EF
# ----------------------
.align 4, 0x90
.globl _main
_main:
pushl %ebp
movl %esp, %ebp
pushl %edi
pushl %esi
movl $51, %ecx
movl 8(%ebp), %edx
cmpl $93, %edx
jg L00000216
L00000202:
cmpl $57, %edx
jg L0000022A
L00000207:
cmpl $37, %edx
jne L00000263
L0000020C:
movl $24, %eax
jmp L000002C8
L00000216:
cmpl $95, %edx
jg L00000252
L0000021B:
cmpl $94, %edx
jne L00000293
L00000220:
movl $33, %eax
jmp L000002C8
L0000022A:
leal -58(%edx), %esi
cmpl $6, %esi
ja L00000293
L00000232:
call L00000237
L00000237:
popl %edi
movl $11, %eax
addl L000002D0-L00000237(%edi,%esi,4), %edi
jmp *%edi
L00000246:
movl $28, %ecx
movl $22, %eax
jmp L000002C8
L00000252:
cmpl $124, %edx
jg L0000026F
L00000257:
cmpl $96, %edx
jne L0000027B
L0000025C:
movl $25, %eax
jmp L000002C8
L00000263:
cmpl $46, %edx
jne L00000293
L00000268:
movl $23, %eax
jmp L000002C8
L0000026F:
cmpl $125, %edx
jne L00000287
L00000274:
movl $27, %eax
jmp L000002C8
L0000027B:
cmpl $123, %edx
jne L00000293
L00000280:
movl $26, %eax
jmp L000002C8
L00000287:
cmpl $126, %edx
jne L00000293
L0000028C:
movl $32, %eax
jmp L000002C8
L00000293:
movl $51, %eax
cmpl $42, %edx
jne L000002A4
L0000029D:
movl $36, %ecx
jmp L000002C8
L000002A4:
cmpl $47, %edx
jne L000002B0
L000002A9:
movl $48, %ecx
jmp L000002C8
L000002B0:
movl $51, %ecx
jmp L000002C8
L000002B7:
movl $35, %ecx
movl $21, %eax
jmp L000002C8
L000002C3:
movl $50, %eax
L000002C8:
addl %ecx, %eax
popl %esi
popl %edi
popl %ebp
ret
.align 2, 0x90
L000002D0:
.long L000002C8-L00000237
.long L00000293-L00000237
.long L00000293-L00000237
.long L00000246-L00000237
.long L000002B7-L00000237
.long L00000293-L00000237
.long L000002C3-L00000237
# ----------------------
.subsections_via_symbols
| 18.617211 | 55 | 0.570768 | [
"Apache-2.0"
] | LRGH/plasmasm | non_regression/switch_x86_macosx.o.asm | 6,274 | Assembly |
; 8 x 8 to 16 bit multiplication
; In: B, C multiplicands
; Out: HL product
; Pollutes: AF, F', BC, DE
INCLUDE "config_rc2014_private.inc"
SECTION code_user
PUBLIC MUL8
MUL8:
ld l,c ; 4
ld c,__IO_LUT_OPERAND_LATCH ; 7 operand latch address
out (c),l ; 12 operand X from L
in l,(c) ; 12 result Z LSB to L
inc c ; 4 result MSB address
in h,(c) ; 12 result Z MSB to H
ret ; 10
| 27.8 | 62 | 0.473022 | [
"MIT"
] | feilipu/z80_crypto | test/mul8bit.asm | 556 | Assembly |
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r13
push %r8
push %r9
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_UC_ht+0x1a09e, %rsi
dec %r8
movb (%rsi), %r10b
nop
nop
cmp $65410, %r11
lea addresses_normal_ht+0x75b, %r9
nop
nop
nop
nop
and %r13, %r13
movups (%r9), %xmm6
vpextrq $1, %xmm6, %rbx
nop
nop
nop
add %rsi, %rsi
lea addresses_normal_ht+0x162df, %r8
cmp $58954, %r10
mov $0x6162636465666768, %r9
movq %r9, %xmm6
vmovups %ymm6, (%r8)
nop
nop
nop
inc %r13
lea addresses_WC_ht+0xb09e, %r8
nop
and %rsi, %rsi
mov $0x6162636465666768, %r11
movq %r11, (%r8)
nop
nop
nop
nop
nop
sub $30259, %r8
lea addresses_D_ht+0x5f3e, %rsi
lea addresses_D_ht+0x18bd2, %rdi
nop
nop
and $26859, %r11
mov $90, %rcx
rep movsb
nop
nop
nop
nop
sub %r11, %r11
lea addresses_WC_ht+0x2124, %rsi
clflush (%rsi)
nop
nop
nop
nop
nop
and %r10, %r10
mov (%rsi), %ecx
nop
sub %r10, %r10
lea addresses_A_ht+0x12d3e, %rsi
lea addresses_UC_ht+0x14b1e, %rdi
nop
nop
nop
nop
add $59626, %rbx
mov $58, %rcx
rep movsb
nop
nop
nop
nop
nop
xor %r11, %r11
lea addresses_UC_ht+0x1ef3e, %rsi
lea addresses_UC_ht+0x10eb6, %rdi
and $558, %rbx
mov $111, %rcx
rep movsl
nop
nop
nop
nop
nop
xor %rsi, %rsi
lea addresses_WC_ht+0x17fde, %rsi
lea addresses_A_ht+0x1d4e6, %rdi
sub $23860, %r9
mov $101, %rcx
rep movsq
nop
nop
nop
nop
nop
cmp %rsi, %rsi
lea addresses_normal_ht+0x11f3e, %r13
nop
xor %r10, %r10
mov (%r13), %cx
add $29979, %r10
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r9
pop %r8
pop %r13
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r9
push %rax
push %rbx
push %rcx
push %rdi
push %rdx
// Load
lea addresses_A+0xf94e, %r9
nop
nop
sub %r13, %r13
movups (%r9), %xmm4
vpextrq $0, %xmm4, %rdi
nop
nop
nop
nop
cmp %rdi, %rdi
// Store
lea addresses_WC+0x1f7be, %rax
nop
cmp $52602, %rdi
mov $0x5152535455565758, %r13
movq %r13, %xmm7
vmovntdq %ymm7, (%rax)
nop
nop
nop
nop
xor $46892, %rdi
// Load
lea addresses_PSE+0x1e0de, %rax
nop
nop
nop
nop
and %rdx, %rdx
mov (%rax), %ebx
nop
nop
nop
nop
nop
and %rax, %rax
// Load
lea addresses_WC+0x1b356, %rdx
cmp $55115, %rcx
movb (%rdx), %r13b
nop
and %r13, %r13
// Faulty Load
lea addresses_A+0x1cf3e, %r13
nop
nop
nop
add $61951, %rdi
vmovntdqa (%r13), %ymm3
vextracti128 $1, %ymm3, %xmm3
vpextrq $0, %xmm3, %rdx
lea oracles, %rax
and $0xff, %rdx
shlq $12, %rdx
mov (%rax,%rdx,1), %rdx
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r9
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_A', 'same': False, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A', 'same': False, 'size': 16, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_WC', 'same': False, 'size': 32, 'congruent': 6, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_PSE', 'same': False, 'size': 4, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WC', 'same': False, 'size': 1, 'congruent': 3, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_A', 'same': True, 'size': 32, 'congruent': 0, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_UC_ht', 'same': False, 'size': 1, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_normal_ht', 'same': True, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WC_ht', 'same': True, 'size': 8, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_D_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 4, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_UC_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_WC_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 2, 'congruent': 11, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'}
{'ec': 1, '16': 20, 'ef': 1, '35': 50, '48': 145, 'f4': 1, '00': 28, '06': 1}
06 35 48 35 48 48 00 48 48 48 48 48 00 48 00 00 48 48 48 48 48 48 48 48 16 48 48 00 48 48 00 00 48 16 48 48 48 48 35 48 35 48 48 48 35 16 48 16 ec 35 35 48 48 35 35 48 48 48 16 16 16 48 48 48 48 48 48 48 48 48 48 48 00 00 35 48 48 48 48 48 16 35 48 00 48 48 48 00 48 48 48 48 00 00 35 35 35 48 48 35 35 35 00 35 35 48 35 00 35 35 35 48 35 48 35 35 16 48 48 16 48 48 35 48 48 48 00 48 48 16 48 48 48 48 48 35 48 48 48 48 35 48 48 48 48 48 48 48 48 48 35 35 00 00 48 48 48 48 48 16 48 35 35 ef 16 35 48 35 48 35 35 35 f4 48 35 16 48 00 00 48 48 48 48 48 00 48 48 48 48 00 48 48 48 48 48 48 48 00 48 48 48 48 48 00 48 16 00 48 48 00 48 48 48 48 48 00 48 16 48 35 35 48 35 00 16 35 35 48 48 48 48 48 35 48 35 48 48 16 35 35 48 35 48 16 35 48 16
*/
| 23.504348 | 740 | 0.646689 | [
"MIT"
] | danielmgmi/medusa | Transynther/_processed/AVXALIGN/_ht_st_zr_un_/i3-7100_9_0x84_notsx.log_247_2540.asm | 5,406 | Assembly |
; A267353: Total number of ON (black) cells after n iterations of the "Rule 123" elementary cellular automaton starting with a single ON (black) cell.
; 1,3,6,12,15,25,28,42,45,63,66,88,91,117,120,150,153,187,190,228,231,273,276,322,325,375,378,432,435,493,496,558,561,627,630,700,703,777,780,858,861,943,946,1032,1035,1125,1128,1222,1225,1323,1326,1428,1431,1537,1540,1650,1653,1767,1770,1888,1891,2013,2016,2142,2145,2275,2278,2412,2415,2553,2556,2698,2701,2847,2850,3000,3003,3157,3160,3318,3321,3483,3486,3652,3655,3825,3828,4002,4005,4183,4186,4368,4371,4557,4560,4750,4753,4947,4950,5148
mov $1,$0
mul $1,$0
add $1,$0
div $0,2
mul $0,2
bin $0,2
sub $1,$0
mov $0,$1
add $0,1
| 52.384615 | 442 | 0.73862 | [
"Apache-2.0"
] | ckrause/loda-programs | oeis/267/A267353.asm | 681 | Assembly |
;
;
; Copyright (c) 2015 - 2021 by blindtiger ( blindtiger@foxmail.com )
;
; The contents of this file are subject to the Mozilla Public License Version
; 2.0 (the "License") you may not use this file except in compliance with
; the License. You may obtain a copy of the License at
; http://www.mozilla.org/MPL/
;
; Software distributed under the License is distributed on an "AS IS" basis,
; WITHOUT WARRANTY OF ANY KIND, either express or implied. SEe the License
; for the specific language governing rights and limitations under the
; License.
;
; The Initial Developer of the Original Code is blindtiger.
;
;
.686p
.xlist
include ks386.inc
include callconv.inc
.list
_TEXT$00 SEGMENT PAGE 'CODE'
_TEXT$00 ends
end
| 23.151515 | 77 | 0.710733 | [
"MIT"
] | 9176324/Daat | Projects/Daat/I386/I386.asm | 764 | Assembly |
%ifdef CONFIG
{
"RegData": {
"XMM0": ["0xFFFFFFFFFFFFFFFF", "0x0"],
"XMM1": ["0x0", "0xFFFFFFFF00000000"],
"XMM2": ["0xFFFFFFFFFFFFFFFF", "0xFFFFFFFF00000000"],
"XMM3": ["0xFFFFFFFF00000000", "0xFFFFFFFFFFFFFFFF"],
"XMM4": ["0x0", "0xFFFFFFFFFFFFFFFF"],
"XMM5": ["0xFFFFFFFFFFFFFFFF", "0x00000000FFFFFFFF"],
"XMM6": ["0x0000000000000000", "0x00000000FFFFFFFF"],
"XMM7": ["0x00000000FFFFFFFF", "0x0000000000000000"]
},
"MemoryRegions": {
"0x100000000": "4096"
}
}
%endif
mov rdx, 0xe0000000
mov rax, 0x3f80000040000000
mov [rdx + 8 * 0], rax
mov rax, 0x4000000040800000
mov [rdx + 8 * 1], rax
mov rax, 0x3f80000040000000
mov [rdx + 8 * 2], rax
mov rax, 0x40a000003f800000
mov [rdx + 8 * 3], rax
movapd xmm0, [rdx + 8 * 0]
movapd xmm1, [rdx + 8 * 0]
movapd xmm2, [rdx + 8 * 0]
movapd xmm3, [rdx + 8 * 0]
movapd xmm4, [rdx + 8 * 0]
movapd xmm5, [rdx + 8 * 0]
movapd xmm6, [rdx + 8 * 0]
movapd xmm7, [rdx + 8 * 0]
movapd xmm8, [rdx + 8 * 2]
cmpps xmm0, xmm8, 0x00 ; EQ
cmpps xmm1, xmm8, 0x01 ; LT
cmpps xmm2, xmm8, 0x02 ; LTE
cmpps xmm4, xmm8, 0x04 ; NEQ
cmpps xmm5, xmm8, 0x05 ; NLT
cmpps xmm6, xmm8, 0x06 ; NLTE
; Unordered and Ordered tests need to be special cased
mov rax, 0x0000000000000000
mov [rdx + 8 * 0], rax
mov rax, 0x7FC000007FC00000
mov [rdx + 8 * 1], rax
mov rax, 0x7FC0000000000000
mov [rdx + 8 * 2], rax
mov rax, 0x7FC0000000000000
mov [rdx + 8 * 3], rax
movapd xmm3, [rdx + 8 * 0]
movapd xmm7, [rdx + 8 * 0]
movapd xmm8, [rdx + 8 * 2]
; Unordered will return true when either input is nan
; [0.0, 0.0, nan, nan] unord [0.0, nan, 0.0, nan] = [0, 1, 1, 1]
cmpps xmm3, xmm8, 0x03 ; Unordered
; Ordered will return true when both inputs are NOT nan
; [0.0, 0.0, nan, nan] ord [0.0, nan, 0.0, nan] = [1, 0, 0, 0]
cmpps xmm7, xmm8, 0x07 ; Ordered
hlt
hlt
| 24.917808 | 64 | 0.639912 | [
"MIT"
] | Azkali/FEX | unittests/ASM/TwoByte/0F_C2.asm | 1,819 | Assembly |
*
* Sprite qjump
*
* Mode 4
* +|-------------------------------+
* - aaa -
* | aaaaaaa |
* | aaaa aaaa |
* | aa aa |
* |aaa aaa |
* |aa aa |
* |aa aa a a a a |
* |aa aa a a aa aa |
* |aa aa a a a a a a aaa |
* |aa aa a a a a a a a|
* |aa aa a a a a a a a|
* |aa aa a aa a a aaa |
* |aaa aa aa a a a |
* | aa aaaa aa aaaaaaaa a |
* | aaaa aaaaa aaaaaaaaaaaa |
* | aaaaaaaaaaaaaaaaa aaaaaa |
* | aaa aaaaaa aaaa |
* +|-------------------------------+
*
section sprite
xdef meb_qjmp
meb_qjmp
dc.w $0100,$0000
dc.w 32,17,0,0
dc.l 0
dc.l sm4_qjump-*
dc.l 0
sm4_qjump
dc.w $0E0E,$0000
dc.w $0000,$0000
dc.w $3F3F,$8080
dc.w $0000,$0000
dc.w $7B7B,$C0C0
dc.w $0000,$0000
dc.w $6060,$C0C0
dc.w $0000,$0000
dc.w $E0E0,$E0E0
dc.w $0000,$0000
dc.w $C0C0,$6060
dc.w $0000,$0000
dc.w $C0C0,$6060
dc.w $4A4A,$2020
dc.w $C0C0,$6060
dc.w $4B4B,$6060
dc.w $C0C0,$6161
dc.w $4A4A,$AEAE
dc.w $C0C0,$6161
dc.w $4A4A,$2929
dc.w $C0C0,$6161
dc.w $4A4A,$2929
dc.w $C0C0,$6161
dc.w $3232,$2E2E
dc.w $E3E3,$6969
dc.w $0000,$0808
dc.w $6363,$C6C6
dc.w $3F3F,$C8C8
dc.w $7979,$F0F0
dc.w $FFFF,$F0F0
dc.w $3F3F,$FFFF
dc.w $E0E0,$7E7E
dc.w $0E0E,$1F1F
dc.w $8080,$1E1E
dc.w $3F3F,$FFFF
dc.w $E0E0,$7E7E
dc.w $0E0E,$1F1F
dc.w $8080,$1E1E
dc.w $3F3F,$FFFF
dc.w $E0E0,$7E7E
dc.w $0E0E,$1F1F
dc.w $8080,$1E1E
dc.w $0E0E,$1F1F
dc.w $8080,$1E1E
dc.w $0000,$0000
dc.w $0000,$0000
dc.w $0E0E,$1F1F
dc.w $8080,$1E1E
dc.w $0000,$0000
dc.w $0000,$0000
dc.w $0000,$0000
| 28.390805 | 42 | 0.340081 | [
"MIT"
] | olifink/qspread | src/util/sprite/qjmp.asm | 2,470 | Assembly |
dnl AMD64 mpn_popcount -- population count.
dnl Copyright 2008, 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 cycles/limb
C AMD K8,K9 n/a
C AMD K10 1.125
C Intel P4 n/a
C Intel core2 n/a
C Intel corei 1.25
C Intel atom n/a
C VIA nano n/a
C * The zero-offset of popcount is misassembled to the offset-less form, which
C is one byte shorter and therefore will mess up the switching code.
C * The outdated gas used in FreeBSD and NetBSD cannot handle the POPCNT insn,
C which is the main reason for our usage of '.byte'.
C TODO
C * Improve switching code, the current code sucks.
define(`up', `%rdi')
define(`n', `%rsi')
ABI_SUPPORT(DOS64)
ABI_SUPPORT(STD64)
ASM_START()
TEXT
ALIGN(32)
PROLOGUE(mpn_popcount)
FUNC_ENTRY(2)
ifelse(1,1,`
lea (up,n,8), up
C mov R32(n), R32(%rcx)
C neg R32(%rcx)
imul $-1, R32(n), R32(%rcx)
and $8-1, R32(%rcx)
neg n
mov R32(%rcx), R32(%rax)
neg %rax
lea (up,%rax,8),up
xor R32(%rax), R32(%rax)
lea (%rcx,%rcx,4), %rcx
lea L(top)(%rip), %rdx
lea (%rdx,%rcx,2), %rdx
jmp *%rdx
',`
lea (up,n,8), up
mov R32(n), R32(%rcx)
neg R32(%rcx)
and $8-1, R32(%rcx)
neg n
mov R32(%rcx), R32(%rax)
shl $3, R32(%rax)
sub %rax, up
xor R32(%rax), R32(%rax)
C add R32(%rcx), R32(%rcx) C 2x
C lea (%rcx,%rcx,4), %rcx C 10x
imul $10, R32(%rcx)
lea L(top)(%rip), %rdx
add %rcx, %rdx
jmp *%rdx
')
ALIGN(32)
L(top):
C 0 = n mod 8
.byte 0xf3,0x4c,0x0f,0xb8,0x44,0xf7,0x00 C popcnt 0(up,n,8), %r8
add %r8, %rax
C 7 = n mod 8
.byte 0xf3,0x4c,0x0f,0xb8,0x4c,0xf7,0x08 C popcnt 8(up,n,8), %r9
add %r9, %rax
C 6 = n mod 8
.byte 0xf3,0x4c,0x0f,0xb8,0x44,0xf7,0x10 C popcnt 16(up,n,8), %r8
add %r8, %rax
C 5 = n mod 8
.byte 0xf3,0x4c,0x0f,0xb8,0x4c,0xf7,0x18 C popcnt 24(up,n,8), %r9
add %r9, %rax
C 4 = n mod 8
.byte 0xf3,0x4c,0x0f,0xb8,0x44,0xf7,0x20 C popcnt 32(up,n,8), %r8
add %r8, %rax
C 3 = n mod 8
.byte 0xf3,0x4c,0x0f,0xb8,0x4c,0xf7,0x28 C popcnt 40(up,n,8), %r9
add %r9, %rax
C 2 = n mod 8
.byte 0xf3,0x4c,0x0f,0xb8,0x44,0xf7,0x30 C popcnt 48(up,n,8), %r8
add %r8, %rax
C 1 = n mod 8
.byte 0xf3,0x4c,0x0f,0xb8,0x4c,0xf7,0x38 C popcnt 56(up,n,8), %r9
add %r9, %rax
add $8, n
js L(top)
FUNC_EXIT()
ret
EPILOGUE()
| 23.654676 | 79 | 0.675791 | [
"ECL-2.0",
"Apache-2.0"
] | 12mohaned/chapel | third-party/gmp/gmp-src/mpn/x86_64/k10/popcount.asm | 3,288 | Assembly |
;
; Copyright (c) 2010 The WebM project authors. All Rights Reserved.
;
; Use of this source code is governed by a BSD-style license
; that can be found in the LICENSE file in the root of the source
; tree. An additional intellectual property rights grant can be found
; in the file PATENTS. All contributing project authors may
; be found in the AUTHORS file in the root of the source tree.
;
%include "vpx_config.asm"
; 32/64 bit compatibility macros
;
; In general, we make the source use 64 bit syntax, then twiddle with it using
; the preprocessor to get the 32 bit syntax on 32 bit platforms.
;
%ifidn __OUTPUT_FORMAT__,elf32
%define ABI_IS_32BIT 1
%elifidn __OUTPUT_FORMAT__,macho32
%define ABI_IS_32BIT 1
%elifidn __OUTPUT_FORMAT__,win32
%define ABI_IS_32BIT 1
%elifidn __OUTPUT_FORMAT__,aout
%define ABI_IS_32BIT 1
%else
%define ABI_IS_32BIT 0
%endif
%if ABI_IS_32BIT
%define rax eax
%define rbx ebx
%define rcx ecx
%define rdx edx
%define rsi esi
%define rdi edi
%define rsp esp
%define rbp ebp
%define movsxd mov
%macro movq 2
%ifidn %1,eax
movd %1,%2
%elifidn %2,eax
movd %1,%2
%elifidn %1,ebx
movd %1,%2
%elifidn %2,ebx
movd %1,%2
%elifidn %1,ecx
movd %1,%2
%elifidn %2,ecx
movd %1,%2
%elifidn %1,edx
movd %1,%2
%elifidn %2,edx
movd %1,%2
%elifidn %1,esi
movd %1,%2
%elifidn %2,esi
movd %1,%2
%elifidn %1,edi
movd %1,%2
%elifidn %2,edi
movd %1,%2
%elifidn %1,esp
movd %1,%2
%elifidn %2,esp
movd %1,%2
%elifidn %1,ebp
movd %1,%2
%elifidn %2,ebp
movd %1,%2
%else
movq %1,%2
%endif
%endmacro
%endif
; LIBVPX_YASM_WIN64
; Set LIBVPX_YASM_WIN64 if output is Windows 64bit so the code will work if x64
; or win64 is defined on the Yasm command line.
%ifidn __OUTPUT_FORMAT__,win64
%define LIBVPX_YASM_WIN64 1
%elifidn __OUTPUT_FORMAT__,x64
%define LIBVPX_YASM_WIN64 1
%else
%define LIBVPX_YASM_WIN64 0
%endif
; sym()
; Return the proper symbol name for the target ABI.
;
; Certain ABIs, notably MS COFF and Darwin MACH-O, require that symbols
; with C linkage be prefixed with an underscore.
;
%ifidn __OUTPUT_FORMAT__,elf32
%define sym(x) x
%elifidn __OUTPUT_FORMAT__,elf64
%define sym(x) x
%elifidn __OUTPUT_FORMAT__,elfx32
%define sym(x) x
%elif LIBVPX_YASM_WIN64
%define sym(x) x
%else
%define sym(x) _ %+ x
%endif
; PRIVATE
; Macro for the attribute to hide a global symbol for the target ABI.
; This is only active if CHROMIUM is defined.
;
; Chromium doesn't like exported global symbols due to symbol clashing with
; plugins among other things.
;
; Requires Chromium's patched copy of yasm:
; http://src.chromium.org/viewvc/chrome?view=rev&revision=73761
; http://www.tortall.net/projects/yasm/ticket/236
;
%ifdef CHROMIUM
%ifidn __OUTPUT_FORMAT__,elf32
%define PRIVATE :hidden
%elifidn __OUTPUT_FORMAT__,elf64
%define PRIVATE :hidden
%elifidn __OUTPUT_FORMAT__,elfx32
%define PRIVATE :hidden
%elif LIBVPX_YASM_WIN64
%define PRIVATE
%else
%define PRIVATE :private_extern
%endif
%else
%define PRIVATE
%endif
; arg()
; Return the address specification of the given argument
;
%if ABI_IS_32BIT
%define arg(x) [ebp+8+4*x]
%else
; 64 bit ABI passes arguments in registers. This is a workaround to get up
; and running quickly. Relies on SHADOW_ARGS_TO_STACK
%if LIBVPX_YASM_WIN64
%define arg(x) [rbp+16+8*x]
%else
%define arg(x) [rbp-8-8*x]
%endif
%endif
; REG_SZ_BYTES, REG_SZ_BITS
; Size of a register
%if ABI_IS_32BIT
%define REG_SZ_BYTES 4
%define REG_SZ_BITS 32
%else
%define REG_SZ_BYTES 8
%define REG_SZ_BITS 64
%endif
; ALIGN_STACK <alignment> <register>
; This macro aligns the stack to the given alignment (in bytes). The stack
; is left such that the previous value of the stack pointer is the first
; argument on the stack (ie, the inverse of this macro is 'pop rsp.')
; This macro uses one temporary register, which is not preserved, and thus
; must be specified as an argument.
%macro ALIGN_STACK 2
mov %2, rsp
and rsp, -%1
lea rsp, [rsp - (%1 - REG_SZ_BYTES)]
push %2
%endmacro
;
; The Microsoft assembler tries to impose a certain amount of type safety in
; its register usage. YASM doesn't recognize these directives, so we just
; %define them away to maintain as much compatibility as possible with the
; original inline assembler we're porting from.
;
%idefine PTR
%idefine XMMWORD
%idefine MMWORD
; PIC macros
;
%if ABI_IS_32BIT
%if CONFIG_PIC=1
%ifidn __OUTPUT_FORMAT__,elf32
%define GET_GOT_SAVE_ARG 1
%define WRT_PLT wrt ..plt
%macro GET_GOT 1
extern _GLOBAL_OFFSET_TABLE_
push %1
call %%get_got
%%sub_offset:
jmp %%exitGG
%%get_got:
mov %1, [esp]
add %1, _GLOBAL_OFFSET_TABLE_ + $$ - %%sub_offset wrt ..gotpc
ret
%%exitGG:
%undef GLOBAL
%define GLOBAL(x) x + %1 wrt ..gotoff
%undef RESTORE_GOT
%define RESTORE_GOT pop %1
%endmacro
%elifidn __OUTPUT_FORMAT__,macho32
%define GET_GOT_SAVE_ARG 1
%macro GET_GOT 1
push %1
call %%get_got
%%get_got:
pop %1
%undef GLOBAL
%define GLOBAL(x) x + %1 - %%get_got
%undef RESTORE_GOT
%define RESTORE_GOT pop %1
%endmacro
%endif
%endif
%ifdef CHROMIUM
%ifidn __OUTPUT_FORMAT__,macho32
%define HIDDEN_DATA(x) x:private_extern
%else
%define HIDDEN_DATA(x) x
%endif
%else
%define HIDDEN_DATA(x) x
%endif
%else
%macro GET_GOT 1
%endmacro
%define GLOBAL(x) rel x
%ifidn __OUTPUT_FORMAT__,elf64
%define WRT_PLT wrt ..plt
%define HIDDEN_DATA(x) x:data hidden
%elifidn __OUTPUT_FORMAT__,elfx32
%define WRT_PLT wrt ..plt
%define HIDDEN_DATA(x) x:data hidden
%elifidn __OUTPUT_FORMAT__,macho64
%ifdef CHROMIUM
%define HIDDEN_DATA(x) x:private_extern
%else
%define HIDDEN_DATA(x) x
%endif
%else
%define HIDDEN_DATA(x) x
%endif
%endif
%ifnmacro GET_GOT
%macro GET_GOT 1
%endmacro
%define GLOBAL(x) x
%endif
%ifndef RESTORE_GOT
%define RESTORE_GOT
%endif
%ifndef WRT_PLT
%define WRT_PLT
%endif
%if ABI_IS_32BIT
%macro SHADOW_ARGS_TO_STACK 1
%endm
%define UNSHADOW_ARGS
%else
%if LIBVPX_YASM_WIN64
%macro SHADOW_ARGS_TO_STACK 1 ; argc
%if %1 > 0
mov arg(0),rcx
%endif
%if %1 > 1
mov arg(1),rdx
%endif
%if %1 > 2
mov arg(2),r8
%endif
%if %1 > 3
mov arg(3),r9
%endif
%endm
%else
%macro SHADOW_ARGS_TO_STACK 1 ; argc
%if %1 > 0
push rdi
%endif
%if %1 > 1
push rsi
%endif
%if %1 > 2
push rdx
%endif
%if %1 > 3
push rcx
%endif
%if %1 > 4
push r8
%endif
%if %1 > 5
push r9
%endif
%if %1 > 6
%assign i %1-6
%assign off 16
%rep i
mov rax,[rbp+off]
push rax
%assign off off+8
%endrep
%endif
%endm
%endif
%define UNSHADOW_ARGS mov rsp, rbp
%endif
; Win64 ABI requires that XMM6:XMM15 are callee saved
; SAVE_XMM n, [u]
; store registers 6-n on the stack
; if u is specified, use unaligned movs.
; Win64 ABI requires 16 byte stack alignment, but then pushes an 8 byte return
; value. Typically we follow this up with 'push rbp' - re-aligning the stack -
; but in some cases this is not done and unaligned movs must be used.
%if LIBVPX_YASM_WIN64
%macro SAVE_XMM 1-2 a
%if %1 < 6
%error Only xmm registers 6-15 must be preserved
%else
%assign last_xmm %1
%define movxmm movdq %+ %2
%assign xmm_stack_space ((last_xmm - 5) * 16)
sub rsp, xmm_stack_space
%assign i 6
%rep (last_xmm - 5)
movxmm [rsp + ((i - 6) * 16)], xmm %+ i
%assign i i+1
%endrep
%endif
%endmacro
%macro RESTORE_XMM 0
%ifndef last_xmm
%error RESTORE_XMM must be paired with SAVE_XMM n
%else
%assign i last_xmm
%rep (last_xmm - 5)
movxmm xmm %+ i, [rsp +((i - 6) * 16)]
%assign i i-1
%endrep
add rsp, xmm_stack_space
; there are a couple functions which return from multiple places.
; otherwise, we could uncomment these:
; %undef last_xmm
; %undef xmm_stack_space
; %undef movxmm
%endif
%endmacro
%else
%macro SAVE_XMM 1-2
%endmacro
%macro RESTORE_XMM 0
%endmacro
%endif
; Name of the rodata section
;
; .rodata seems to be an elf-ism, as it doesn't work on OSX.
;
%ifidn __OUTPUT_FORMAT__,macho64
%define SECTION_RODATA section .text
%elifidn __OUTPUT_FORMAT__,macho32
%macro SECTION_RODATA 0
section .text
%endmacro
%elifidn __OUTPUT_FORMAT__,aout
%define SECTION_RODATA section .data
%else
%define SECTION_RODATA section .rodata
%endif
; Tell GNU ld that we don't require an executable stack.
%ifidn __OUTPUT_FORMAT__,elf32
section .note.GNU-stack noalloc noexec nowrite progbits
section .text
%elifidn __OUTPUT_FORMAT__,elf64
section .note.GNU-stack noalloc noexec nowrite progbits
section .text
%elifidn __OUTPUT_FORMAT__,elfx32
section .note.GNU-stack noalloc noexec nowrite progbits
section .text
%endif
; On Android platforms use lrand48 when building postproc routines. Prior to L
; rand() was not available.
%if CONFIG_POSTPROC=1
%ifdef __ANDROID__
extern sym(lrand48)
%define LIBVPX_RAND lrand48
%else
extern sym(rand)
%define LIBVPX_RAND rand
%endif
%endif ; CONFIG_POSTPROC
| 23.014742 | 79 | 0.686559 | [
"BSD-3-Clause"
] | ittiamvpx/libvpx | vpx_ports/x86_abi_support.asm | 9,367 | Assembly |
; A054114: T(2n+1,n), array T as in A054110.
; 1,8,28,98,350,1274,4706,17576,66196,250952,956384,3660540,14061140,54177740,209295260,810375650,3143981870,12219117170,47564380970,185410909790,723668784230,2827767747950,11061198475550,43308802158650,169719408596402,665637941544506
lpb $0,1
mov $1,$0
cal $1,66796 ; a(n) = Sum_{i=1..n} binomial(2*i,i).
sub $1,1
mul $0,$1
mod $0,$1
lpe
add $1,1
| 33.666667 | 234 | 0.737624 | [
"Apache-2.0"
] | karttu/loda | programs/oeis/054/A054114.asm | 404 | Assembly |
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r14
push %r8
push %r9
push %rcx
push %rdi
push %rsi
lea addresses_UC_ht+0xe947, %r11
nop
nop
nop
add $57064, %r10
movb (%r11), %cl
add %rcx, %rcx
lea addresses_WT_ht+0x2854, %r10
nop
add %r9, %r9
movb (%r10), %r8b
cmp %rdi, %rdi
lea addresses_UC_ht+0x728f, %r10
nop
nop
nop
nop
nop
and $43705, %r11
mov (%r10), %r8d
nop
nop
nop
nop
and $23034, %rdi
lea addresses_D_ht+0x1c40f, %rsi
lea addresses_normal_ht+0x147cb, %rdi
clflush (%rsi)
nop
add $48535, %r14
mov $47, %rcx
rep movsq
cmp %r11, %r11
lea addresses_D_ht+0x1b02f, %rsi
lea addresses_D_ht+0xebcf, %rdi
nop
nop
nop
nop
nop
dec %r10
mov $85, %rcx
rep movsw
nop
nop
nop
nop
inc %rcx
lea addresses_A_ht+0x1bd4f, %rsi
lea addresses_UC_ht+0x1b1cf, %rdi
nop
nop
nop
and $32304, %r14
mov $21, %rcx
rep movsw
nop
nop
nop
nop
xor $58227, %rsi
lea addresses_A_ht+0x14dcf, %rsi
lea addresses_D_ht+0x14f0f, %rdi
clflush (%rdi)
nop
nop
nop
nop
nop
sub %r11, %r11
mov $9, %rcx
rep movsb
nop
nop
xor %rdi, %rdi
lea addresses_WT_ht+0x95b8, %rcx
nop
nop
nop
nop
cmp $50558, %rdi
movl $0x61626364, (%rcx)
nop
nop
and %r10, %r10
lea addresses_WT_ht+0xf277, %rdi
xor %r8, %r8
movb (%rdi), %r11b
nop
nop
nop
sub $25567, %rcx
lea addresses_UC_ht+0x15dcf, %rsi
nop
dec %r8
mov $0x6162636465666768, %r9
movq %r9, (%rsi)
nop
nop
cmp %r11, %r11
lea addresses_WT_ht+0xf90d, %rsi
lea addresses_UC_ht+0x9a7f, %rdi
clflush (%rdi)
nop
nop
nop
nop
add %r9, %r9
mov $36, %rcx
rep movsq
nop
and $27623, %rsi
lea addresses_A_ht+0x1913f, %rsi
lea addresses_WC_ht+0x163cf, %rdi
add $47417, %r14
mov $122, %rcx
rep movsq
and $15768, %r10
lea addresses_A_ht+0x1e4cf, %rdi
nop
nop
nop
nop
nop
xor $13574, %r14
mov $0x6162636465666768, %r9
movq %r9, %xmm0
movups %xmm0, (%rdi)
nop
nop
xor %r9, %r9
pop %rsi
pop %rdi
pop %rcx
pop %r9
pop %r8
pop %r14
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r14
push %r15
push %r8
push %r9
push %rdi
// Store
lea addresses_US+0xc1cf, %r14
nop
nop
add %r9, %r9
movl $0x51525354, (%r14)
nop
nop
nop
nop
nop
and $7661, %r14
// Load
lea addresses_WT+0x1d04f, %r12
nop
nop
nop
nop
and $63745, %r10
mov (%r12), %r8
// Exception!!!
nop
mov (0), %r15
and %r12, %r12
// Faulty Load
lea addresses_US+0x11bcf, %r8
nop
nop
nop
xor $46222, %r12
vmovups (%r8), %ymm5
vextracti128 $1, %ymm5, %xmm5
vpextrq $1, %xmm5, %r14
lea oracles, %r12
and $0xff, %r14
shlq $12, %r14
mov (%r12,%r14,1), %r14
pop %rdi
pop %r9
pop %r8
pop %r15
pop %r14
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_US'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 9, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_US'}}
{'src': {'congruent': 7, 'AVXalign': False, 'same': False, 'size': 8, 'NT': True, 'type': 'addresses_WT'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 32, 'NT': False, 'type': 'addresses_US'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 3, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 0, 'AVXalign': True, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 6, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 6, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'congruent': 2, 'same': False, 'type': 'addresses_normal_ht'}}
{'src': {'congruent': 4, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'congruent': 11, 'same': False, 'type': 'addresses_D_ht'}}
{'src': {'congruent': 7, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'congruent': 9, 'same': False, 'type': 'addresses_UC_ht'}}
{'src': {'congruent': 9, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'congruent': 3, 'same': True, 'type': 'addresses_D_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_WT_ht'}}
{'src': {'congruent': 1, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 8, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_UC_ht'}}
{'src': {'congruent': 1, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 4, 'same': False, 'type': 'addresses_UC_ht'}}
{'src': {'congruent': 4, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'congruent': 11, 'same': False, 'type': 'addresses_WC_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 7, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_A_ht'}}
{'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
*/
| 33.271186 | 2,999 | 0.655374 | [
"MIT"
] | danielmgmi/medusa | Transynther/_processed/US/_zr_/i7-7700_9_0xca.log_21829_939.asm | 7,852 | Assembly |
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r14
push %r8
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_normal_ht+0x78e5, %rsi
lea addresses_normal_ht+0x48e5, %rdi
clflush (%rsi)
sub %r11, %r11
mov $120, %rcx
rep movsb
nop
nop
nop
add %r14, %r14
lea addresses_A_ht+0x156e5, %r8
nop
nop
xor %rdi, %rdi
movl $0x61626364, (%r8)
nop
nop
nop
nop
sub $6565, %r14
lea addresses_A_ht+0x6233, %r14
nop
nop
sub %rsi, %rsi
movups (%r14), %xmm4
vpextrq $1, %xmm4, %rdi
nop
nop
nop
lfence
lea addresses_WT_ht+0x17ae5, %rsi
lea addresses_WC_ht+0x1bee5, %rdi
clflush (%rdi)
nop
nop
nop
nop
sub %r11, %r11
mov $109, %rcx
rep movsq
nop
and %rdi, %rdi
lea addresses_WT_ht+0x7565, %rsi
lea addresses_WT_ht+0x22e5, %rdi
nop
nop
nop
lfence
mov $91, %rcx
rep movsb
nop
nop
add $25589, %r14
lea addresses_WT_ht+0x8565, %r14
nop
cmp %rdi, %rdi
movups (%r14), %xmm1
vpextrq $0, %xmm1, %rsi
nop
nop
nop
nop
nop
cmp $34382, %rdi
lea addresses_WC_ht+0x8865, %rsi
lea addresses_normal_ht+0x1ca85, %rdi
nop
nop
xor %rdx, %rdx
mov $98, %rcx
rep movsw
nop
nop
nop
nop
and %r11, %r11
lea addresses_A_ht+0x142e5, %rsi
inc %r11
mov (%rsi), %r14
nop
mfence
lea addresses_UC_ht+0x13ae5, %rsi
nop
nop
nop
nop
inc %r8
movw $0x6162, (%rsi)
nop
xor $3299, %rcx
lea addresses_normal_ht+0x102e5, %r8
dec %rdx
and $0xffffffffffffffc0, %r8
vmovaps (%r8), %ymm5
vextracti128 $1, %ymm5, %xmm5
vpextrq $1, %xmm5, %rcx
nop
cmp %r8, %r8
lea addresses_WT_ht+0x10255, %rsi
lea addresses_WC_ht+0x6ce5, %rdi
nop
nop
nop
sub $29072, %r10
mov $73, %rcx
rep movsw
nop
nop
nop
nop
sub $19883, %r8
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r8
pop %r14
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r14
push %r15
push %r8
push %rax
push %rbp
push %rdx
// Load
lea addresses_D+0x18d25, %r8
cmp %r14, %r14
movups (%r8), %xmm1
vpextrq $0, %xmm1, %rax
sub $41390, %r14
// Store
lea addresses_WT+0x1b2e5, %rdx
nop
nop
inc %rbp
movw $0x5152, (%rdx)
nop
nop
sub %rbp, %rbp
// Faulty Load
lea addresses_WT+0x1b2e5, %rbp
nop
inc %rdx
mov (%rbp), %r14d
lea oracles, %rax
and $0xff, %r14
shlq $12, %r14
mov (%rax,%r14,1), %r14
pop %rdx
pop %rbp
pop %rax
pop %r8
pop %r15
pop %r14
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_WT'}, 'OP': 'LOAD'}
{'src': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_D'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 2, 'NT': False, 'type': 'addresses_WT'}}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 4, 'NT': False, 'type': 'addresses_WT'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 2, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'congruent': 9, 'same': False, 'type': 'addresses_normal_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 8, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_A_ht'}}
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 16, 'NT': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 11, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 7, 'same': False, 'type': 'addresses_WC_ht'}}
{'src': {'congruent': 7, 'same': True, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 11, 'same': False, 'type': 'addresses_WT_ht'}}
{'src': {'congruent': 7, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 5, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 5, 'same': False, 'type': 'addresses_normal_ht'}}
{'src': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 8, 'NT': True, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_UC_ht'}}
{'src': {'congruent': 11, 'AVXalign': True, 'same': False, 'size': 32, 'NT': True, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 3, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 9, 'same': False, 'type': 'addresses_WC_ht'}}
{'52': 21829}
52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52
*/
| 36.35 | 2,999 | 0.657909 | [
"MIT"
] | danielmgmi/medusa | Transynther/_processed/NONE/_xt_sm_/i7-7700_9_0xca.log_21829_834.asm | 7,270 | Assembly |
; 16-bit Fibonacci Number Generator for v8cpu
; Vanya A. Sergeev - vsergeev@gmail.com
; 16-bit Fibonacci Numbers are computed and written sequentially across port A (high byte) and port B (low byte)
;
; R0:R1 = Fn-2
; R2:R3 = Fn-1
; R4:R5 = Fn
; R0:R1, R2:R3 initialize to 0
; Initialize R4:R5 to 0x0001
mov R4, 0x00
mov R5, 0x01
; Save a constant 1
mov R11, 0x01
; Save constant for 46368 (biggest 16-bit fibonacci number)
mov R8, 0xB5
mov R9, 0x20
; Address for portA (0x800) in R14:R15
mov R14, 0x08
mov R15, 0x00
fibLoop:
mov R0, R2 ; Fn-2 (hi byte) <= Fn-1 (hi byte)
mov R1, R3 ; Fn-2 (lo byte) <= Fn-1 (lo byte)
mov R2, R4 ; Fn-1 (hi byte) <= Fn (hi byte)
mov R3, R5 ; Fn-1 (lo byte) <= Fn (lo byte)
; R4:R5 contains Fn-1, R0:R1 contains Fn-2
add R5, R1 ; Fn-1 + Fn-2 (lo bytes)
cmp R5, R3 ; Compare the new R5 to the old R5 (R3)
je fibContinue ; No carry occured if they're equal
jl addCarryBit ; If the new R5 is less than the old R5, we had an overflow
; and we need to add the carry bit
fibContinue: add R4, R0 ; Fn-1 + Fn-2 (hi bytes)
; Write R4 to portA, R5 to portB
mov R15, 0x00 ; R14:R15 = 0x0800 = port A address
mov MEM, R4
mov R15, 0x01 ; R14:R15 = 0x0801 = port B address
mov MEM, R5
; Check if we've reached 46368 (biggest 16-bit fibonacci number)
cmp R4, R8
jne fibLoop
cmp R5, R9
jne fibLoop
; Reset to initial conditions
mov R0, 0x00
mov R1, 0x00
mov R2, 0x00
mov R3, 0x00
mov R4, 0x00
mov R5, 0x01
jmp fibLoop
addCarryBit: add R4, R11 ; Hi byte += 1
jmp fibContinue
| 23.358209 | 112 | 0.659425 | [
"MIT"
] | vsergeev/v8cpu | v8cpuasm/programs/fib.asm | 1,565 | Assembly |
# To print integers, place the integer to print in $a0 and then syscall
# with 1. The integer will be printed as a decimal.
.text
main:
li $a0, -45
syscall
li $v0, 10
syscall
.data
| 12.4 | 71 | 0.704301 | [
"MIT"
] | bats64mgutsi/mips-assembly | print_integers.asm | 186 | Assembly |
# mipstest_ext.asm
# 2017202110132@whu.edu.cn 17 March 2018
#
# Test the MIPS processor.
# add, sub, and, or, slt, addi, lw, sw, beq, j have been done in mipstest.asm
# we add sll, lui, slti, bne, jal, ori, addu, subu, jr, andi, srl and jalr instruction
# If successful, it should write the value 7 to address 84 and register $1 should be 0
# Assembly Description Address Machine
main: addi $2, $0, 5 # initialize $2 = 5 0 20020005
addi $3, $0, 12 # initialize $3 = 12 4 2003000c
addi $7, $3, -9 # initialize $7 = 3 8 2067fff7
addi $1, $0, 76 # initialize $1 = 76 c 2001004c
call_a: jalr $31,$1 # jump to cal 10 0020f809
or $4, $7, $2 # $4 <= 3 or 5 = 7 14 00e22025
and $5, $3, $4 # $5 <= 12 and 7 = 4 18 00642824
add $5, $5, $4 # $5 = 4 + 7 = 11 1c 00a42820
beq $5, $7, end # shouldn't be taken 20 10a70017
slt $4, $3, $4 # $4 = 12 < 7 = 0 24 0064202a
beq $4, $0, around # should be taken 28 10800001
addi $5, $0, 0 # shouldn't happen 2c 20050000
around: slt $4, $7, $2 # $4 = 3 < 5 = 1 30 00e2202a
add $7, $4, $5 # $7 = 1 + 11 = 12 34 00853820
sub $7, $7, $2 # $7 = 12 - 5 = 7 38 00e23822
sw $7, 68($3) # [80] = 7 3c ac670044
lw $2, 80($0) # $2 = [80] = 7 40 8c020050
j end # should be taken 44 08000020
addi $2, $0, 1 # shouldn't happen 48 20020001
cal: sll $7, $7, 1 # $7 << 1 = 6 4c 00073840
call_b: jal cal2 # jump to cal2 50 0c000017
addi $31,$0,20 # $31<= 20 54 201f0014
jr $31 # return to call_a 58 03e00008
cal2: lui $1, 0x55AA # $1 <= 0x55AA0000 5c 3c0155aa
slti $1, $1, 0x55AA # $1 <= 0 60 282155aa
bne $1, $0, end # shouldn't be taken 64 14200006
ori $7, $7, 5 # $7 <= 6 or 5 = 7 68 34e70005
andi $1, $7, 5 # $1 <= 7 and 5 = 5 6c 30e10005
addu $1, $7, $1 # $1 = 7+5 = 12 70 00e10821
subu $1, $1, $1 # $1 =12-12 = 0 74 00210823
srl $7, $7, 1 # $7 >> 1 = 3 78 00073842
jr $31 # return to call_b 7c 03e00008
end: sw $2, 84($0) # write adr 84 = 7 80 ac020054
loop: j loop
# $0 = 0 # $1 = 0 # $2 = 7 # $3 = c
# $4 = 1 # $5 = b # $7 = 7 # $31 = 14h
# [0x50] = 7 [0x54] = 7
| 58.125 | 87 | 0.424014 | [
"MIT"
] | Sh-Zh-7/tiny-CPU | assembly/mipstest_extloop.asm | 2,790 | Assembly |
.section .data
strLOCK2:
.asciz "Hello, World!\n"
.section .bss
.section .text
.globl _start
_start:
call main
movl %eax, %ebx
movl $1, %eax
int $0x80
.type main, @function
main:
pushl %ebp
movl %esp, %ebp
subl $4, %esp
movl $5, %ecx
movl %ecx, -4(%ebp)
movl -4(%ebp), %ecx
pushl %ecx
movl $3, %ecx
popl %edx
cmpl %ecx, %edx
jl .l1
movl $strLOCK2, %ecx
pushl %ecx
call printf
popl %ebx
movl $9, %ecx
pushl %ecx
movl -4(%ebp), %ecx
popl %edx
addl %edx, %ecx
pushl %ecx
movl $5, %ecx
pushl %ecx
movl $9, %ecx
popl %edx
addl %edx, %ecx
popl %edx
cmpl %ecx, %edx
jne .ne3
movl $strLOCK2, %ecx
pushl %ecx
call printf
popl %ebx
.ne3:
.l1:
movl $9, %ecx
movl %ecx, %eax
jmp .leaver1
.leaver1:
movl %ebp, %esp
popl %ebp
ret
| 12.866667 | 25 | 0.615285 | [
"MIT"
] | dunderstab/SembleLang | semble.asm | 772 | Assembly |
; A227016: Floor(M(g(n-1)+1,..,g(n))), where M = harmonic mean and g(n) = n(n + 1)(n + 2)/6.
; Submitted by Jamie Morken(s3.)
; 1,2,7,14,27,45,69,101,141,191,252,323,408,506,618,746,890,1052,1233,1432,1653,1895,2159,2447,2759,3097,3462,3853,4274,4724,5204,5716,6260,6838,7451,8098,8783,9505,10265,11065,11905,12787,13712,14679,15692,16750,17854,19006,20206,21456,22757,24108,25513,26971,28483,30051,31675,33357,35098,36897,38758,40680,42664,44712,46824,49002,51247,53558,55939,58389,60909,63501,66165,68903,71716,74603,77568,80610,83730,86930,90210,93572,97017,100544,104157,107855,111639,115511,119471,123521,127662,131893
mov $1,$0
add $0,2
mul $0,2
bin $0,3
sub $0,2
add $1,12
sub $0,$1
div $0,8
add $0,2
| 50.642857 | 497 | 0.736248 | [
"Apache-2.0"
] | ckrause/loda-programs | oeis/227/A227016.asm | 709 | Assembly |
sge r0, c1, c2
setpeq p0, c1, c2
jmp !p0, 3
tex r1, i7, t0
jmp p0, 9
add r2, i9, c2
dp3 r2.w, r2, r2
rsq r2.w, r2.w
mul r2, r2, r2.w
mov r1.x, r2.x
mov r1.y, r2.y
mov r1.z, r2.z
mov r1.w, c2
add r1, r1, i8
mul r1, r1, c3
mov o1, r1 | 14.4375 | 17 | 0.606061 | [
"BSD-3-Clause"
] | Lycheus/GLSL-ATTILA | src/tools/attilaASM/input/fragment.asm | 231 | Assembly |
###############################################################################
# File : addu.asm
# Project : MIPS32 MUX
# Author : Grant Ayers (ayers@cs.stanford.edu)
#
# Standards/Formatting:
# MIPS gas, soft tab, 80 column
#
# Description:
# Test the functionality of the 'addu' instruction.
#
###############################################################################
.section .test, "x"
.balign 4
.set noreorder
.global test
.ent test
test:
lui $s0, 0xbfff # Load the base address 0xbffffff0
ori $s0, 0xfff0
ori $s1, $0, 1 # Prepare the 'done' status
#### Test code start ####
lui $t0, 0xffff # A = 0xfffffffd (-3)
ori $t0, 0xfffd
ori $t1, $0, 0x3 # B = 0x3
addu $t2, $t0, $t1 # C = A + B = 0
sltiu $v0, $t2, 1 # D = 1 if C == 0
#### Test code end ####
sw $v0, 8($s0) # Set the test result
sw $s1, 4($s0) # Set 'done'
$done:
jr $ra
nop
.end test
| 25.093023 | 79 | 0.405931 | [
"MIT"
] | 0xYYY/cannon | mipsevm/test/addu.asm | 1,079 | Assembly |
; A237881: a(n) = 2-adic valuation of prime(n)+prime(n+1).
; 0,3,2,1,3,1,2,1,2,2,2,1,2,1,2,4,3,7,1,4,3,1,2,1,1,2,1,3,1,4,1,2,2,5,2,2,6,1,2,5,3,2,7,1,2,1,1,1,3,1,3,5,2,2,3,2,2,2,1,2,6,3,1,4,1,3,2,2,3,1,3,1,2,4,1,2,1,1,1,2,3,2,5,3,1,2,1,1,2,1,1,1,1,1,1,2,1,2,3,6
seq $0,1043 ; Numbers that are the sum of 2 successive primes.
lpb $0
dif $0,2
add $1,1
lpe
mov $0,$1
| 36.8 | 201 | 0.5625 | [
"Apache-2.0"
] | ckrause/cm | programs/oeis/237/A237881.asm | 368 | Assembly |
%ifdef CONFIG
{
"RegData": {
"MM7": ["0x8000000000000000", "0x3FFF"]
},
"Mode": "32BIT"
}
%endif
fld1
hlt
| 9.076923 | 43 | 0.559322 | [
"MIT"
] | Azkali/FEX | unittests/32Bit_ASM/X87/D9_E8.asm | 118 | Assembly |