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"
; Assumes m_out_buf is a register
; Clobbers RCX
; code is clobbered
; write_bits_always m_bits, m_bit_count, code, count, m_out_buf, tmp1
%macro write_bits 6
%define %%m_bits %1
%define %%m_bit_count %2
%define %%code %3
%define %%count %4
%define %%m_out_buf %5
%define %%tmp1 %6
%ifdef USE_HSWNI
shlx %%code, %%code, %%m_bit_count
%else
mov rcx, %%m_bit_count
shl %%code, cl
%endif
or %%m_bits, %%code
add %%m_bit_count, %%count
movnti [%%m_out_buf], %%m_bits
mov rcx, %%m_bit_count
shr rcx, 3 ; rcx = bytes
add %%m_out_buf, rcx
shl rcx, 3 ; rcx = bits
sub %%m_bit_count, rcx
%ifdef USE_HSWNI
shrx %%m_bits, %%m_bits, rcx
%else
shr %%m_bits, cl
%endif
%endm
%macro write_dword 2
%define %%data %1d
%define %%addr %2
movnti [%%addr], %%data
add %%addr, 4
%endm
| 35.333333 | 72 | 0.693003 | [
"MIT"
] | Abhisheknishant/GKL | src/main/native/compression/isa-l-master/igzip/bitbuf2.asm | 2,544 | Assembly |
; A329938: Beatty sequence for sinh x, where csch x + sech x = 1 .
; 1,3,5,7,9,11,13,15,16,18,20,22,24,26,28,30,32,33,35,37,39,41,43,45,47,48,50,52,54,56,58,60,62,64,65,67,69,71,73,75,77,79,80,82,84,86,88,90,92,94,96,97,99,101,103,105,107,109,111,112,114,116,118
add $0,1
mov $1,32
mul $1,$0
div $1,17
| 37.875 | 195 | 0.653465 | [
"Apache-2.0"
] | jmorken/loda | programs/oeis/329/A329938.asm | 303 | Assembly |
;/*
; * FreeRTOS V202107.00
; * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
; *
; * 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:
; *
; * The above copyright notice and this permission notice shall be included in all
; * copies or substantial portions of the Software.
; *
; * 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.
; *
; * http://www.FreeRTOS.org
; * http://aws.amazon.com/freertos
; *
; * 1 tab == 4 spaces!
; */
;-------------------------------------------------
;
.def vRegTestTask1
.ref ulRegTest1Counter
.if (__TI_VFP_SUPPORT__)
.ref vPortTaskUsesFPU
.endif ;__TI_VFP_SUPPORT__
.text
.arm
vRegTestTask1:
.if (__TI_VFP_SUPPORT__)
; Let the port layer know that this task needs its FPU context saving.
BL vPortTaskUsesFPU
.endif
; Fill each general purpose register with a known value.
mov r0, #0xFF
mov r1, #0x11
mov r2, #0x22
mov r3, #0x33
mov r4, #0x44
mov r5, #0x55
mov r6, #0x66
mov r7, #0x77
mov r8, #0x88
mov r9, #0x99
mov r10, #0xAA
mov r11, #0xBB
mov r12, #0xCC
mov r14, #0xEE
.if (__TI_VFP_SUPPORT__)
; Fill each FPU register with a known value.
vmov d0, r0, r1
vmov d1, r2, r3
vmov d2, r4, r5
vmov d3, r6, r7
vmov d4, r8, r9
vmov d5, r10, r11
vmov d6, r0, r1
vmov d7, r2, r3
vmov d8, r4, r5
vmov d9, r6, r7
vmov d10, r8, r9
vmov d11, r10, r11
vmov d12, r0, r1
vmov d13, r2, r3
vmov d14, r4, r5
vmov d15, r6, r7
.endif
vRegTestLoop1:
; Force yeild
swi #0
.if (__TI_VFP_SUPPORT__)
; Check all the VFP registers still contain the values set above.
; First save registers that are clobbered by the test.
push { r0-r1 }
vmov r0, r1, d0
cmp r0, #0xFF
bne reg1_error_loopf
cmp r1, #0x11
bne reg1_error_loopf
vmov r0, r1, d1
cmp r0, #0x22
bne reg1_error_loopf
cmp r1, #0x33
bne reg1_error_loopf
vmov r0, r1, d2
cmp r0, #0x44
bne reg1_error_loopf
cmp r1, #0x55
bne reg1_error_loopf
vmov r0, r1, d3
cmp r0, #0x66
bne reg1_error_loopf
cmp r1, #0x77
bne reg1_error_loopf
vmov r0, r1, d4
cmp r0, #0x88
bne reg1_error_loopf
cmp r1, #0x99
bne reg1_error_loopf
vmov r0, r1, d5
cmp r0, #0xAA
bne reg1_error_loopf
cmp r1, #0xBB
bne reg1_error_loopf
vmov r0, r1, d6
cmp r0, #0xFF
bne reg1_error_loopf
cmp r1, #0x11
bne reg1_error_loopf
vmov r0, r1, d7
cmp r0, #0x22
bne reg1_error_loopf
cmp r1, #0x33
bne reg1_error_loopf
vmov r0, r1, d8
cmp r0, #0x44
bne reg1_error_loopf
cmp r1, #0x55
bne reg1_error_loopf
vmov r0, r1, d9
cmp r0, #0x66
bne reg1_error_loopf
cmp r1, #0x77
bne reg1_error_loopf
vmov r0, r1, d10
cmp r0, #0x88
bne reg1_error_loopf
cmp r1, #0x99
bne reg1_error_loopf
vmov r0, r1, d11
cmp r0, #0xAA
bne reg1_error_loopf
cmp r1, #0xBB
bne reg1_error_loopf
vmov r0, r1, d12
cmp r0, #0xFF
bne reg1_error_loopf
cmp r1, #0x11
bne reg1_error_loopf
vmov r0, r1, d13
cmp r0, #0x22
bne reg1_error_loopf
cmp r1, #0x33
bne reg1_error_loopf
vmov r0, r1, d14
cmp r0, #0x44
bne reg1_error_loopf
cmp r1, #0x55
bne reg1_error_loopf
vmov r0, r1, d15
cmp r0, #0x66
bne reg1_error_loopf
cmp r1, #0x77
bne reg1_error_loopf
; Restore the registers that were clobbered by the test.
pop {r0-r1}
; VFP register test passed. Jump to the core register test.
b reg1_loopf_pass
reg1_error_loopf:
; If this line is hit then a VFP register value was found to be
; incorrect.
b reg1_error_loopf
reg1_loopf_pass:
.endif ;__TI_VFP_SUPPORT__
; Test each general purpose register to check that it still contains the
; expected known value, jumping to vRegTestError1 if any register contains
; an unexpected value.
cmp r0, #0xFF
bne vRegTestError1
cmp r1, #0x11
bne vRegTestError1
cmp r2, #0x22
bne vRegTestError1
cmp r3, #0x33
bne vRegTestError1
cmp r4, #0x44
bne vRegTestError1
cmp r5, #0x55
bne vRegTestError1
cmp r6, #0x66
bne vRegTestError1
cmp r7, #0x77
bne vRegTestError1
cmp r8, #0x88
bne vRegTestError1
cmp r9, #0x99
bne vRegTestError1
cmp r10, #0xAA
bne vRegTestError1
cmp r11, #0xBB
bne vRegTestError1
cmp r12, #0xCC
bne vRegTestError1
cmp r14, #0xEE
bne vRegTestError1
; This task is still running without jumping to vRegTestError1, so increment
; the loop counter so the check task knows the task is running error free.
stmfd sp!, { r0-r1 }
ldr r0, Count1Const
ldr r1, [r0]
add r1, r1, #1
str r1, [r0]
ldmfd sp!, { r0-r1 }
; Loop again, performing the same tests.
b vRegTestLoop1
Count1Const .word ulRegTest1Counter
vRegTestError1:
b vRegTestError1
;-------------------------------------------------
;
.def vRegTestTask2
.ref ulRegTest2Counter
.text
.arm
;
vRegTestTask2:
.if (__TI_VFP_SUPPORT__)
; Let the port layer know that this task needs its FPU context saving.
BL vPortTaskUsesFPU
.endif
; Fill each general purpose register with a known value.
mov r0, #0xFF000000
mov r1, #0x11000000
mov r2, #0x22000000
mov r3, #0x33000000
mov r4, #0x44000000
mov r5, #0x55000000
mov r6, #0x66000000
mov r7, #0x77000000
mov r8, #0x88000000
mov r9, #0x99000000
mov r10, #0xAA000000
mov r11, #0xBB000000
mov r12, #0xCC000000
mov r14, #0xEE000000
.if (__TI_VFP_SUPPORT__)
; Fill each FPU register with a known value.
vmov d0, r0, r1
vmov d1, r2, r3
vmov d2, r4, r5
vmov d3, r6, r7
vmov d4, r8, r9
vmov d5, r10, r11
vmov d6, r0, r1
vmov d7, r2, r3
vmov d8, r4, r5
vmov d9, r6, r7
vmov d10, r8, r9
vmov d11, r10, r11
vmov d12, r0, r1
vmov d13, r2, r3
vmov d14, r4, r5
vmov d15, r6, r7
.endif
vRegTestLoop2:
.if (__TI_VFP_SUPPORT__)
; Check all the VFP registers still contain the values set above.
; First save registers that are clobbered by the test.
push { r0-r1 }
vmov r0, r1, d0
cmp r0, #0xFF000000
bne reg2_error_loopf
cmp r1, #0x11000000
bne reg2_error_loopf
vmov r0, r1, d1
cmp r0, #0x22000000
bne reg2_error_loopf
cmp r1, #0x33000000
bne reg2_error_loopf
vmov r0, r1, d2
cmp r0, #0x44000000
bne reg2_error_loopf
cmp r1, #0x55000000
bne reg2_error_loopf
vmov r0, r1, d3
cmp r0, #0x66000000
bne reg2_error_loopf
cmp r1, #0x77000000
bne reg2_error_loopf
vmov r0, r1, d4
cmp r0, #0x88000000
bne reg2_error_loopf
cmp r1, #0x99000000
bne reg2_error_loopf
vmov r0, r1, d5
cmp r0, #0xAA000000
bne reg2_error_loopf
cmp r1, #0xBB000000
bne reg2_error_loopf
vmov r0, r1, d6
cmp r0, #0xFF000000
bne reg2_error_loopf
cmp r1, #0x11000000
bne reg2_error_loopf
vmov r0, r1, d7
cmp r0, #0x22000000
bne reg2_error_loopf
cmp r1, #0x33000000
bne reg2_error_loopf
vmov r0, r1, d8
cmp r0, #0x44000000
bne reg2_error_loopf
cmp r1, #0x55000000
bne reg2_error_loopf
vmov r0, r1, d9
cmp r0, #0x66000000
bne reg2_error_loopf
cmp r1, #0x77000000
bne reg2_error_loopf
vmov r0, r1, d10
cmp r0, #0x88000000
bne reg2_error_loopf
cmp r1, #0x99000000
bne reg2_error_loopf
vmov r0, r1, d11
cmp r0, #0xAA000000
bne reg2_error_loopf
cmp r1, #0xBB000000
bne reg2_error_loopf
vmov r0, r1, d12
cmp r0, #0xFF000000
bne reg2_error_loopf
cmp r1, #0x11000000
bne reg2_error_loopf
vmov r0, r1, d13
cmp r0, #0x22000000
bne reg2_error_loopf
cmp r1, #0x33000000
bne reg2_error_loopf
vmov r0, r1, d14
cmp r0, #0x44000000
bne reg2_error_loopf
cmp r1, #0x55000000
bne reg2_error_loopf
vmov r0, r1, d15
cmp r0, #0x66000000
bne reg2_error_loopf
cmp r1, #0x77000000
bne reg2_error_loopf
; Restore the registers that were clobbered by the test.
pop {r0-r1}
; VFP register test passed. Jump to the core register test.
b reg2_loopf_pass
reg2_error_loopf:
; If this line is hit then a VFP register value was found to be
; incorrect.
b reg2_error_loopf
reg2_loopf_pass:
.endif ;__TI_VFP_SUPPORT__
; Test each general purpose register to check that it still contains the
; expected known value, jumping to vRegTestError2 if any register contains
; an unexpected value.
cmp r0, #0xFF000000
bne vRegTestError2
cmp r1, #0x11000000
bne vRegTestError2
cmp r2, #0x22000000
bne vRegTestError2
cmp r3, #0x33000000
bne vRegTestError2
cmp r4, #0x44000000
bne vRegTestError2
cmp r5, #0x55000000
bne vRegTestError2
cmp r6, #0x66000000
bne vRegTestError2
cmp r7, #0x77000000
bne vRegTestError2
cmp r8, #0x88000000
bne vRegTestError2
cmp r9, #0x99000000
bne vRegTestError2
cmp r10, #0xAA000000
bne vRegTestError2
cmp r11, #0xBB000000
bne vRegTestError2
cmp r12, #0xCC000000
bne vRegTestError2
cmp r14, #0xEE000000
bne vRegTestError2
; This task is still running without jumping to vRegTestError2, so increment
; the loop counter so the check task knows the task is running error free.
stmfd sp!, { r0-r1 }
ldr r0, Count2Const
ldr r1, [r0]
add r1, r1, #1
str r1, [r0]
ldmfd sp!, { r0-r1 }
; Loop again, performing the same tests.
b vRegTestLoop2
Count2Const .word ulRegTest2Counter
vRegTestError2:
b vRegTestError2
;-------------------------------------------------
| 23.195506 | 84 | 0.67545 | [
"MIT"
] | ARM-software/CMSIS-FreeRTOS | Demo/CORTEX_R4_RM48_TMS570_CCS5/reg_test.asm | 10,322 | Assembly |
;*****************************************************************************
;* x86inc.asm: x264asm abstraction layer
;*****************************************************************************
;* Copyright (C) 2005-2020 x264 project
;*
;* Authors: Loren Merritt <[email protected]>
;* Henrik Gramner <[email protected]>
;* Anton Mitrofanov <[email protected]>
;* Fiona Glaser <[email protected]>
;*
;* Permission to use, copy, modify, and/or distribute this software for any
;* purpose with or without fee is hereby granted, provided that the above
;* copyright notice and this permission notice appear in all copies.
;*
;* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
;* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
;* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
;* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
;* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
;* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
;* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
;*****************************************************************************
; This is a header file for the x264ASM assembly language, which uses
; NASM/YASM syntax combined with a large number of macros to provide easy
; abstraction between different calling conventions (x86_32, win64, linux64).
; It also has various other useful features to simplify writing the kind of
; DSP functions that are most often used in x264.
; Unlike the rest of x264, this file is available under an ISC license, as it
; has significant usefulness outside of x264 and we want it to be available
; to the largest audience possible. Of course, if you modify it for your own
; purposes to add a new feature, we strongly encourage contributing a patch
; as this feature might be useful for others as well. Send patches or ideas
; to [email protected] .
%include "config.asm"
%ifndef private_prefix
%define private_prefix dav1d
%endif
%ifndef public_prefix
%define public_prefix private_prefix
%endif
%ifndef STACK_ALIGNMENT
%if ARCH_X86_64
%define STACK_ALIGNMENT 16
%else
%define STACK_ALIGNMENT 4
%endif
%endif
%define WIN64 0
%define UNIX64 0
%if ARCH_X86_64
%ifidn __OUTPUT_FORMAT__,win32
%define WIN64 1
%elifidn __OUTPUT_FORMAT__,win64
%define WIN64 1
%elifidn __OUTPUT_FORMAT__,x64
%define WIN64 1
%else
%define UNIX64 1
%endif
%endif
%define FORMAT_ELF 0
%define FORMAT_MACHO 0
%ifidn __OUTPUT_FORMAT__,elf
%define FORMAT_ELF 1
%elifidn __OUTPUT_FORMAT__,elf32
%define FORMAT_ELF 1
%elifidn __OUTPUT_FORMAT__,elf64
%define FORMAT_ELF 1
%elifidn __OUTPUT_FORMAT__,macho
%define FORMAT_MACHO 1
%elifidn __OUTPUT_FORMAT__,macho32
%define FORMAT_MACHO 1
%elifidn __OUTPUT_FORMAT__,macho64
%define FORMAT_MACHO 1
%endif
%ifdef PREFIX
%define mangle(x) _ %+ x
%else
%define mangle(x) x
%endif
%macro SECTION_RODATA 0-1 16
%ifidn __OUTPUT_FORMAT__,win32
SECTION .rdata align=%1
%elif WIN64
SECTION .rdata align=%1
%else
SECTION .rodata align=%1
%endif
%endmacro
%if ARCH_X86_64
%define PIC 1 ; always use PIC on x86-64
default rel
%elifidn __OUTPUT_FORMAT__,win32
%define PIC 0 ; PIC isn't used on 32-bit Windows
%elifndef PIC
%define PIC 0
%endif
%define HAVE_PRIVATE_EXTERN 1
%ifdef __NASM_VER__
%use smartalign
%if __NASM_VERSION_ID__ < 0x020e0000 ; 2.14
%define HAVE_PRIVATE_EXTERN 0
%endif
%endif
; Macros to eliminate most code duplication between x86_32 and x86_64:
; Currently this works only for leaf functions which load all their arguments
; into registers at the start, and make no other use of the stack. Luckily that
; covers most of x264's asm.
; PROLOGUE:
; %1 = number of arguments. loads them from stack if needed.
; %2 = number of registers used. pushes callee-saved regs if needed.
; %3 = number of xmm registers used. pushes callee-saved xmm regs if needed.
; %4 = (optional) stack size to be allocated. The stack will be aligned before
; allocating the specified stack size. If the required stack alignment is
; larger than the known stack alignment the stack will be manually aligned
; and an extra register will be allocated to hold the original stack
; pointer (to not invalidate r0m etc.). To prevent the use of an extra
; register as stack pointer, request a negative stack size.
; %4+/%5+ = list of names to define to registers
; PROLOGUE can also be invoked by adding the same options to cglobal
; e.g.
; cglobal foo, 2,3,7,0x40, dst, src, tmp
; declares a function (foo) that automatically loads two arguments (dst and
; src) into registers, uses one additional register (tmp) plus 7 vector
; registers (m0-m6) and allocates 0x40 bytes of stack space.
; TODO Some functions can use some args directly from the stack. If they're the
; last args then you can just not declare them, but if they're in the middle
; we need more flexible macro.
; RET:
; Pops anything that was pushed by PROLOGUE, and returns.
; REP_RET:
; Use this instead of RET if it's a branch target.
; registers:
; rN and rNq are the native-size register holding function argument N
; rNd, rNw, rNb are dword, word, and byte size
; rNh is the high 8 bits of the word size
; rNm is the original location of arg N (a register or on the stack), dword
; rNmp is native size
%macro DECLARE_REG 2-3
%define r%1q %2
%define r%1d %2d
%define r%1w %2w
%define r%1b %2b
%define r%1h %2h
%define %2q %2
%if %0 == 2
%define r%1m %2d
%define r%1mp %2
%elif ARCH_X86_64 ; memory
%define r%1m [rstk + stack_offset + %3]
%define r%1mp qword r %+ %1 %+ m
%else
%define r%1m [rstk + stack_offset + %3]
%define r%1mp dword r %+ %1 %+ m
%endif
%define r%1 %2
%endmacro
%macro DECLARE_REG_SIZE 3
%define r%1q r%1
%define e%1q r%1
%define r%1d e%1
%define e%1d e%1
%define r%1w %1
%define e%1w %1
%define r%1h %3
%define e%1h %3
%define r%1b %2
%define e%1b %2
%if ARCH_X86_64 == 0
%define r%1 e%1
%endif
%endmacro
DECLARE_REG_SIZE ax, al, ah
DECLARE_REG_SIZE bx, bl, bh
DECLARE_REG_SIZE cx, cl, ch
DECLARE_REG_SIZE dx, dl, dh
DECLARE_REG_SIZE si, sil, null
DECLARE_REG_SIZE di, dil, null
DECLARE_REG_SIZE bp, bpl, null
; t# defines for when per-arch register allocation is more complex than just function arguments
%macro DECLARE_REG_TMP 1-*
%assign %%i 0
%rep %0
CAT_XDEFINE t, %%i, r%1
%assign %%i %%i+1
%rotate 1
%endrep
%endmacro
%macro DECLARE_REG_TMP_SIZE 0-*
%rep %0
%define t%1q t%1 %+ q
%define t%1d t%1 %+ d
%define t%1w t%1 %+ w
%define t%1h t%1 %+ h
%define t%1b t%1 %+ b
%rotate 1
%endrep
%endmacro
DECLARE_REG_TMP_SIZE 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14
%if ARCH_X86_64
%define gprsize 8
%else
%define gprsize 4
%endif
%macro LEA 2
%if ARCH_X86_64
lea %1, [%2]
%elif PIC
call $+5 ; special-cased to not affect the RSB on most CPU:s
pop %1
add %1, (%2)-$+1
%else
mov %1, %2
%endif
%endmacro
%macro PUSH 1
push %1
%ifidn rstk, rsp
%assign stack_offset stack_offset+gprsize
%endif
%endmacro
%macro POP 1
pop %1
%ifidn rstk, rsp
%assign stack_offset stack_offset-gprsize
%endif
%endmacro
%macro PUSH_IF_USED 1-*
%rep %0
%if %1 < regs_used
PUSH r%1
%endif
%rotate 1
%endrep
%endmacro
%macro POP_IF_USED 1-*
%rep %0
%if %1 < regs_used
pop r%1
%endif
%rotate 1
%endrep
%endmacro
%macro LOAD_IF_USED 1-*
%rep %0
%if %1 < num_args
mov r%1, r %+ %1 %+ mp
%endif
%rotate 1
%endrep
%endmacro
%macro SUB 2
sub %1, %2
%ifidn %1, rstk
%assign stack_offset stack_offset+(%2)
%endif
%endmacro
%macro ADD 2
add %1, %2
%ifidn %1, rstk
%assign stack_offset stack_offset-(%2)
%endif
%endmacro
%macro movifnidn 2
%ifnidn %1, %2
mov %1, %2
%endif
%endmacro
%if ARCH_X86_64 == 0
%define movsxd movifnidn
%endif
%macro movsxdifnidn 2
%ifnidn %1, %2
movsxd %1, %2
%endif
%endmacro
%macro ASSERT 1
%if (%1) == 0
%error assertion ``%1'' failed
%endif
%endmacro
%macro DEFINE_ARGS 0-*
%ifdef n_arg_names
%assign %%i 0
%rep n_arg_names
CAT_UNDEF arg_name %+ %%i, q
CAT_UNDEF arg_name %+ %%i, d
CAT_UNDEF arg_name %+ %%i, w
CAT_UNDEF arg_name %+ %%i, h
CAT_UNDEF arg_name %+ %%i, b
CAT_UNDEF arg_name %+ %%i, m
CAT_UNDEF arg_name %+ %%i, mp
CAT_UNDEF arg_name, %%i
%assign %%i %%i+1
%endrep
%endif
%xdefine %%stack_offset stack_offset
%undef stack_offset ; so that the current value of stack_offset doesn't get baked in by xdefine
%assign %%i 0
%rep %0
%xdefine %1q r %+ %%i %+ q
%xdefine %1d r %+ %%i %+ d
%xdefine %1w r %+ %%i %+ w
%xdefine %1h r %+ %%i %+ h
%xdefine %1b r %+ %%i %+ b
%xdefine %1m r %+ %%i %+ m
%xdefine %1mp r %+ %%i %+ mp
CAT_XDEFINE arg_name, %%i, %1
%assign %%i %%i+1
%rotate 1
%endrep
%xdefine stack_offset %%stack_offset
%assign n_arg_names %0
%endmacro
%define required_stack_alignment ((mmsize + 15) & ~15)
%define vzeroupper_required (mmsize > 16 && (ARCH_X86_64 == 0 || xmm_regs_used > 16 || notcpuflag(avx512)))
%define high_mm_regs (16*cpuflag(avx512))
%macro ALLOC_STACK 0-2 0, 0 ; stack_size, n_xmm_regs (for win64 only)
%ifnum %1
%if %1 != 0
%assign %%pad 0
%assign stack_size %1
%if stack_size < 0
%assign stack_size -stack_size
%endif
%if WIN64
%assign %%pad %%pad + 32 ; shadow space
%if mmsize != 8
%assign xmm_regs_used %2
%if xmm_regs_used > 8
%assign %%pad %%pad + (xmm_regs_used-8)*16 ; callee-saved xmm registers
%endif
%endif
%endif
%if required_stack_alignment <= STACK_ALIGNMENT
; maintain the current stack alignment
%assign stack_size_padded stack_size + %%pad + ((-%%pad-stack_offset-gprsize) & (STACK_ALIGNMENT-1))
SUB rsp, stack_size_padded
%else
%assign %%reg_num (regs_used - 1)
%xdefine rstk r %+ %%reg_num
; align stack, and save original stack location directly above
; it, i.e. in [rsp+stack_size_padded], so we can restore the
; stack in a single instruction (i.e. mov rsp, rstk or mov
; rsp, [rsp+stack_size_padded])
%if %1 < 0 ; need to store rsp on stack
%xdefine rstkm [rsp + stack_size + %%pad]
%assign %%pad %%pad + gprsize
%else ; can keep rsp in rstk during whole function
%xdefine rstkm rstk
%endif
%assign stack_size_padded stack_size + ((%%pad + required_stack_alignment-1) & ~(required_stack_alignment-1))
mov rstk, rsp
and rsp, ~(required_stack_alignment-1)
sub rsp, stack_size_padded
movifnidn rstkm, rstk
%endif
WIN64_PUSH_XMM
%endif
%endif
%endmacro
%macro SETUP_STACK_POINTER 0-1 0
%ifnum %1
%if %1 != 0 && required_stack_alignment > STACK_ALIGNMENT
%if %1 > 0
; Reserve an additional register for storing the original stack pointer, but avoid using
; eax/rax for this purpose since it can potentially get overwritten as a return value.
%assign regs_used (regs_used + 1)
%if ARCH_X86_64 && regs_used == 7
%assign regs_used 8
%elif ARCH_X86_64 == 0 && regs_used == 1
%assign regs_used 2
%endif
%endif
%if ARCH_X86_64 && regs_used < 5 + UNIX64 * 3
; Ensure that we don't clobber any registers containing arguments. For UNIX64 we also preserve r6 (rax)
; since it's used as a hidden argument in vararg functions to specify the number of vector registers used.
%assign regs_used 5 + UNIX64 * 3
%endif
%endif
%endif
%endmacro
%if WIN64 ; Windows x64 ;=================================================
DECLARE_REG 0, rcx
DECLARE_REG 1, rdx
DECLARE_REG 2, R8
DECLARE_REG 3, R9
DECLARE_REG 4, R10, 40
DECLARE_REG 5, R11, 48
DECLARE_REG 6, rax, 56
DECLARE_REG 7, rdi, 64
DECLARE_REG 8, rsi, 72
DECLARE_REG 9, rbx, 80
DECLARE_REG 10, rbp, 88
DECLARE_REG 11, R14, 96
DECLARE_REG 12, R15, 104
DECLARE_REG 13, R12, 112
DECLARE_REG 14, R13, 120
%macro PROLOGUE 2-5+ 0, 0 ; #args, #regs, #xmm_regs, [stack_size,] arg_names...
%assign num_args %1
%assign regs_used %2
ASSERT regs_used >= num_args
SETUP_STACK_POINTER %4
ASSERT regs_used <= 15
PUSH_IF_USED 7, 8, 9, 10, 11, 12, 13, 14
ALLOC_STACK %4, %3
%if mmsize != 8 && stack_size == 0
WIN64_SPILL_XMM %3
%endif
LOAD_IF_USED 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14
%if %0 > 4
%ifnum %4
DEFINE_ARGS %5
%else
DEFINE_ARGS %4, %5
%endif
%elifnnum %4
DEFINE_ARGS %4
%endif
%endmacro
%macro WIN64_PUSH_XMM 0
; Use the shadow space to store XMM6 and XMM7, the rest needs stack space allocated.
%if xmm_regs_used > 6 + high_mm_regs
movaps [rstk + stack_offset + 8], xmm6
%endif
%if xmm_regs_used > 7 + high_mm_regs
movaps [rstk + stack_offset + 24], xmm7
%endif
%assign %%xmm_regs_on_stack xmm_regs_used - high_mm_regs - 8
%if %%xmm_regs_on_stack > 0
%assign %%i 8
%rep %%xmm_regs_on_stack
movaps [rsp + (%%i-8)*16 + stack_size + 32], xmm %+ %%i
%assign %%i %%i+1
%endrep
%endif
%endmacro
%macro WIN64_SPILL_XMM 1
%assign xmm_regs_used %1
ASSERT xmm_regs_used <= 16 + high_mm_regs
%assign %%xmm_regs_on_stack xmm_regs_used - high_mm_regs - 8
%if %%xmm_regs_on_stack > 0
; Allocate stack space for callee-saved xmm registers plus shadow space and align the stack.
%assign %%pad %%xmm_regs_on_stack*16 + 32
%assign stack_size_padded %%pad + ((-%%pad-stack_offset-gprsize) & (STACK_ALIGNMENT-1))
SUB rsp, stack_size_padded
%endif
WIN64_PUSH_XMM
%endmacro
%macro WIN64_RESTORE_XMM_INTERNAL 0
%assign %%pad_size 0
%assign %%xmm_regs_on_stack xmm_regs_used - high_mm_regs - 8
%if %%xmm_regs_on_stack > 0
%assign %%i xmm_regs_used - high_mm_regs
%rep %%xmm_regs_on_stack
%assign %%i %%i-1
movaps xmm %+ %%i, [rsp + (%%i-8)*16 + stack_size + 32]
%endrep
%endif
%if stack_size_padded > 0
%if stack_size > 0 && required_stack_alignment > STACK_ALIGNMENT
mov rsp, rstkm
%else
add rsp, stack_size_padded
%assign %%pad_size stack_size_padded
%endif
%endif
%if xmm_regs_used > 7 + high_mm_regs
movaps xmm7, [rsp + stack_offset - %%pad_size + 24]
%endif
%if xmm_regs_used > 6 + high_mm_regs
movaps xmm6, [rsp + stack_offset - %%pad_size + 8]
%endif
%endmacro
%macro WIN64_RESTORE_XMM 0
WIN64_RESTORE_XMM_INTERNAL
%assign stack_offset (stack_offset-stack_size_padded)
%assign stack_size_padded 0
%assign xmm_regs_used 0
%endmacro
%define has_epilogue regs_used > 7 || stack_size > 0 || vzeroupper_required || xmm_regs_used > 6+high_mm_regs
%macro RET 0
WIN64_RESTORE_XMM_INTERNAL
POP_IF_USED 14, 13, 12, 11, 10, 9, 8, 7
%if vzeroupper_required
vzeroupper
%endif
AUTO_REP_RET
%endmacro
%elif ARCH_X86_64 ; *nix x64 ;=============================================
DECLARE_REG 0, rdi
DECLARE_REG 1, rsi
DECLARE_REG 2, rdx
DECLARE_REG 3, rcx
DECLARE_REG 4, R8
DECLARE_REG 5, R9
DECLARE_REG 6, rax, 8
DECLARE_REG 7, R10, 16
DECLARE_REG 8, R11, 24
DECLARE_REG 9, rbx, 32
DECLARE_REG 10, rbp, 40
DECLARE_REG 11, R14, 48
DECLARE_REG 12, R15, 56
DECLARE_REG 13, R12, 64
DECLARE_REG 14, R13, 72
%macro PROLOGUE 2-5+ 0, 0 ; #args, #regs, #xmm_regs, [stack_size,] arg_names...
%assign num_args %1
%assign regs_used %2
%assign xmm_regs_used %3
ASSERT regs_used >= num_args
SETUP_STACK_POINTER %4
ASSERT regs_used <= 15
PUSH_IF_USED 9, 10, 11, 12, 13, 14
ALLOC_STACK %4
LOAD_IF_USED 6, 7, 8, 9, 10, 11, 12, 13, 14
%if %0 > 4
%ifnum %4
DEFINE_ARGS %5
%else
DEFINE_ARGS %4, %5
%endif
%elifnnum %4
DEFINE_ARGS %4
%endif
%endmacro
%define has_epilogue regs_used > 9 || stack_size > 0 || vzeroupper_required
%macro RET 0
%if stack_size_padded > 0
%if required_stack_alignment > STACK_ALIGNMENT
mov rsp, rstkm
%else
add rsp, stack_size_padded
%endif
%endif
POP_IF_USED 14, 13, 12, 11, 10, 9
%if vzeroupper_required
vzeroupper
%endif
AUTO_REP_RET
%endmacro
%else ; X86_32 ;==============================================================
DECLARE_REG 0, eax, 4
DECLARE_REG 1, ecx, 8
DECLARE_REG 2, edx, 12
DECLARE_REG 3, ebx, 16
DECLARE_REG 4, esi, 20
DECLARE_REG 5, edi, 24
DECLARE_REG 6, ebp, 28
%define rsp esp
%macro DECLARE_ARG 1-*
%rep %0
%define r%1m [rstk + stack_offset + 4*%1 + 4]
%define r%1mp dword r%1m
%rotate 1
%endrep
%endmacro
DECLARE_ARG 7, 8, 9, 10, 11, 12, 13, 14
%macro PROLOGUE 2-5+ 0, 0 ; #args, #regs, #xmm_regs, [stack_size,] arg_names...
%assign num_args %1
%assign regs_used %2
ASSERT regs_used >= num_args
%if num_args > 7
%assign num_args 7
%endif
%if regs_used > 7
%assign regs_used 7
%endif
SETUP_STACK_POINTER %4
ASSERT regs_used <= 7
PUSH_IF_USED 3, 4, 5, 6
ALLOC_STACK %4
LOAD_IF_USED 0, 1, 2, 3, 4, 5, 6
%if %0 > 4
%ifnum %4
DEFINE_ARGS %5
%else
DEFINE_ARGS %4, %5
%endif
%elifnnum %4
DEFINE_ARGS %4
%endif
%endmacro
%define has_epilogue regs_used > 3 || stack_size > 0 || vzeroupper_required
%macro RET 0
%if stack_size_padded > 0
%if required_stack_alignment > STACK_ALIGNMENT
mov rsp, rstkm
%else
add rsp, stack_size_padded
%endif
%endif
POP_IF_USED 6, 5, 4, 3
%if vzeroupper_required
vzeroupper
%endif
AUTO_REP_RET
%endmacro
%endif ;======================================================================
%if WIN64 == 0
%macro WIN64_SPILL_XMM 1
%assign xmm_regs_used %1
%endmacro
%macro WIN64_RESTORE_XMM 0
%assign xmm_regs_used 0
%endmacro
%macro WIN64_PUSH_XMM 0
%endmacro
%endif
; On AMD cpus <=K10, an ordinary ret is slow if it immediately follows either
; a branch or a branch target. So switch to a 2-byte form of ret in that case.
; We can automatically detect "follows a branch", but not a branch target.
; (SSSE3 is a sufficient condition to know that your cpu doesn't have this problem.)
%macro REP_RET 0
%if has_epilogue || cpuflag(ssse3)
RET
%else
rep ret
%endif
annotate_function_size
%endmacro
%define last_branch_adr $$
%macro AUTO_REP_RET 0
%if notcpuflag(ssse3)
times ((last_branch_adr-$)>>31)+1 rep ; times 1 iff $ == last_branch_adr.
%endif
ret
annotate_function_size
%endmacro
%macro BRANCH_INSTR 0-*
%rep %0
%macro %1 1-2 %1
%2 %1
%if notcpuflag(ssse3)
%%branch_instr equ $
%xdefine last_branch_adr %%branch_instr
%endif
%endmacro
%rotate 1
%endrep
%endmacro
BRANCH_INSTR jz, je, jnz, jne, jl, jle, jnl, jnle, jg, jge, jng, jnge, ja, jae, jna, jnae, jb, jbe, jnb, jnbe, jc, jnc, js, jns, jo, jno, jp, jnp
%macro TAIL_CALL 1-2 1 ; callee, is_nonadjacent
%if has_epilogue
call %1
RET
%elif %2
jmp %1
%endif
annotate_function_size
%endmacro
;=============================================================================
; arch-independent part
;=============================================================================
%assign function_align 16
; Begin a function.
; Applies any symbol mangling needed for C linkage, and sets up a define such that
; subsequent uses of the function name automatically refer to the mangled version.
; Appends cpuflags to the function name if cpuflags has been specified.
; The "" empty default parameter is a workaround for nasm, which fails if SUFFIX
; is empty and we call cglobal_internal with just %1 %+ SUFFIX (without %2).
%macro cglobal 1-2+ "" ; name, [PROLOGUE args]
cglobal_internal 1, %1 %+ SUFFIX, %2
%endmacro
%macro cvisible 1-2+ "" ; name, [PROLOGUE args]
cglobal_internal 0, %1 %+ SUFFIX, %2
%endmacro
%macro cglobal_internal 2-3+
annotate_function_size
%ifndef cglobaled_%2
%if %1
%xdefine %2 mangle(private_prefix %+ _ %+ %2)
%else
%xdefine %2 mangle(public_prefix %+ _ %+ %2)
%endif
%xdefine %2.skip_prologue %2 %+ .skip_prologue
CAT_XDEFINE cglobaled_, %2, 1
%endif
%xdefine current_function %2
%xdefine current_function_section __SECT__
%if FORMAT_ELF
%if %1
global %2:function hidden
%else
global %2:function
%endif
%elif FORMAT_MACHO && HAVE_PRIVATE_EXTERN && %1
global %2:private_extern
%else
global %2
%endif
align function_align
%2:
RESET_MM_PERMUTATION ; needed for x86-64, also makes disassembly somewhat nicer
%xdefine rstk rsp ; copy of the original stack pointer, used when greater alignment than the known stack alignment is required
%assign stack_offset 0 ; stack pointer offset relative to the return address
%assign stack_size 0 ; amount of stack space that can be freely used inside a function
%assign stack_size_padded 0 ; total amount of allocated stack space, including space for callee-saved xmm registers on WIN64 and alignment padding
%assign xmm_regs_used 0 ; number of XMM registers requested, used for dealing with callee-saved registers on WIN64 and vzeroupper
%ifnidn %3, ""
PROLOGUE %3
%endif
%endmacro
; Create a global symbol from a local label with the correct name mangling and type
%macro cglobal_label 1
%if FORMAT_ELF
global current_function %+ %1:function hidden
%elif FORMAT_MACHO && HAVE_PRIVATE_EXTERN
global current_function %+ %1:private_extern
%else
global current_function %+ %1
%endif
%1:
%endmacro
%macro cextern 1
%xdefine %1 mangle(private_prefix %+ _ %+ %1)
CAT_XDEFINE cglobaled_, %1, 1
extern %1
%endmacro
; like cextern, but without the prefix
%macro cextern_naked 1
%ifdef PREFIX
%xdefine %1 mangle(%1)
%endif
CAT_XDEFINE cglobaled_, %1, 1
extern %1
%endmacro
%macro const 1-2+
%xdefine %1 mangle(private_prefix %+ _ %+ %1)
%if FORMAT_ELF
global %1:data hidden
%elif FORMAT_MACHO && HAVE_PRIVATE_EXTERN
global %1:private_extern
%else
global %1
%endif
%1: %2
%endmacro
; This is needed for ELF, otherwise the GNU linker assumes the stack is executable by default.
%if FORMAT_ELF
[SECTION .note.GNU-stack noalloc noexec nowrite progbits]
%endif
; Tell debuggers how large the function was.
; This may be invoked multiple times per function; we rely on later instances overriding earlier ones.
; This is invoked by RET and similar macros, and also cglobal does it for the previous function,
; but if the last function in a source file doesn't use any of the standard macros for its epilogue,
; then its size might be unspecified.
%macro annotate_function_size 0
%ifdef __YASM_VER__
%ifdef current_function
%if FORMAT_ELF
current_function_section
%%ecf equ $
size current_function %%ecf - current_function
__SECT__
%endif
%endif
%endif
%endmacro
; cpuflags
%assign cpuflags_mmx (1<<0)
%assign cpuflags_mmx2 (1<<1) | cpuflags_mmx
%assign cpuflags_3dnow (1<<2) | cpuflags_mmx
%assign cpuflags_3dnowext (1<<3) | cpuflags_3dnow
%assign cpuflags_sse (1<<4) | cpuflags_mmx2
%assign cpuflags_sse2 (1<<5) | cpuflags_sse
%assign cpuflags_sse2slow (1<<6) | cpuflags_sse2
%assign cpuflags_lzcnt (1<<7) | cpuflags_sse2
%assign cpuflags_sse3 (1<<8) | cpuflags_sse2
%assign cpuflags_ssse3 (1<<9) | cpuflags_sse3
%assign cpuflags_sse4 (1<<10) | cpuflags_ssse3
%assign cpuflags_sse42 (1<<11) | cpuflags_sse4
%assign cpuflags_aesni (1<<12) | cpuflags_sse42
%assign cpuflags_gfni (1<<13) | cpuflags_sse42
%assign cpuflags_avx (1<<14) | cpuflags_sse42
%assign cpuflags_xop (1<<15) | cpuflags_avx
%assign cpuflags_fma4 (1<<16) | cpuflags_avx
%assign cpuflags_fma3 (1<<17) | cpuflags_avx
%assign cpuflags_bmi1 (1<<18) | cpuflags_avx|cpuflags_lzcnt
%assign cpuflags_bmi2 (1<<19) | cpuflags_bmi1
%assign cpuflags_avx2 (1<<20) | cpuflags_fma3|cpuflags_bmi2
%assign cpuflags_avx512 (1<<21) | cpuflags_avx2 ; F, CD, BW, DQ, VL
%assign cpuflags_avx512icl (1<<22) | cpuflags_avx512|cpuflags_gfni ; VNNI, IFMA, VBMI, VBMI2, VPOPCNTDQ, BITALG, VAES, VPCLMULQDQ
%assign cpuflags_cache32 (1<<23)
%assign cpuflags_cache64 (1<<24)
%assign cpuflags_aligned (1<<25) ; not a cpu feature, but a function variant
%assign cpuflags_atom (1<<26)
; Returns a boolean value expressing whether or not the specified cpuflag is enabled.
%define cpuflag(x) (((((cpuflags & (cpuflags_ %+ x)) ^ (cpuflags_ %+ x)) - 1) >> 31) & 1)
%define notcpuflag(x) (cpuflag(x) ^ 1)
; Takes an arbitrary number of cpuflags from the above list.
; All subsequent functions (up to the next INIT_CPUFLAGS) is built for the specified cpu.
; You shouldn't need to invoke this macro directly, it's a subroutine for INIT_MMX &co.
%macro INIT_CPUFLAGS 0-*
%xdefine SUFFIX
%undef cpuname
%assign cpuflags 0
%if %0 >= 1
%rep %0
%ifdef cpuname
%xdefine cpuname cpuname %+ _%1
%else
%xdefine cpuname %1
%endif
%assign cpuflags cpuflags | cpuflags_%1
%rotate 1
%endrep
%xdefine SUFFIX _ %+ cpuname
%if cpuflag(avx)
%assign avx_enabled 1
%endif
%if (mmsize == 16 && notcpuflag(sse2)) || (mmsize == 32 && notcpuflag(avx2))
%define mova movaps
%define movu movups
%define movnta movntps
%endif
%if cpuflag(aligned)
%define movu mova
%elif cpuflag(sse3) && notcpuflag(ssse3)
%define movu lddqu
%endif
%endif
%if ARCH_X86_64 || cpuflag(sse2)
%ifdef __NASM_VER__
ALIGNMODE p6
%else
CPU amdnop
%endif
%else
%ifdef __NASM_VER__
ALIGNMODE nop
%else
CPU basicnop
%endif
%endif
%endmacro
; Merge mmx, sse*, and avx*
; m# is a simd register of the currently selected size
; xm# is the corresponding xmm register if mmsize >= 16, otherwise the same as m#
; ym# is the corresponding ymm register if mmsize >= 32, otherwise the same as m#
; zm# is the corresponding zmm register if mmsize >= 64, otherwise the same as m#
; (All 4 remain in sync through SWAP.)
%macro CAT_XDEFINE 3
%xdefine %1%2 %3
%endmacro
%macro CAT_UNDEF 2
%undef %1%2
%endmacro
%macro DEFINE_MMREGS 1 ; mmtype
%assign %%prev_mmregs 0
%ifdef num_mmregs
%assign %%prev_mmregs num_mmregs
%endif
%assign num_mmregs 8
%if ARCH_X86_64 && mmsize >= 16
%assign num_mmregs 16
%if cpuflag(avx512) || mmsize == 64
%assign num_mmregs 32
%endif
%endif
%assign %%i 0
%rep num_mmregs
CAT_XDEFINE m, %%i, %1 %+ %%i
CAT_XDEFINE nn%1, %%i, %%i
%assign %%i %%i+1
%endrep
%if %%prev_mmregs > num_mmregs
%rep %%prev_mmregs - num_mmregs
CAT_UNDEF m, %%i
CAT_UNDEF nn %+ mmtype, %%i
%assign %%i %%i+1
%endrep
%endif
%xdefine mmtype %1
%endmacro
; Prefer registers 16-31 over 0-15 to avoid having to use vzeroupper
%macro AVX512_MM_PERMUTATION 0-1 0 ; start_reg
%if ARCH_X86_64 && cpuflag(avx512)
%assign %%i %1
%rep 16-%1
%assign %%i_high %%i+16
SWAP %%i, %%i_high
%assign %%i %%i+1
%endrep
%endif
%endmacro
%macro INIT_MMX 0-1+
%assign avx_enabled 0
%define RESET_MM_PERMUTATION INIT_MMX %1
%define mmsize 8
%define mova movq
%define movu movq
%define movh movd
%define movnta movntq
INIT_CPUFLAGS %1
DEFINE_MMREGS mm
%endmacro
%macro INIT_XMM 0-1+
%assign avx_enabled 0
%define RESET_MM_PERMUTATION INIT_XMM %1
%define mmsize 16
%define mova movdqa
%define movu movdqu
%define movh movq
%define movnta movntdq
INIT_CPUFLAGS %1
DEFINE_MMREGS xmm
%if WIN64
AVX512_MM_PERMUTATION 6 ; Swap callee-saved registers with volatile registers
%endif
%xdefine bcstd 1to4
%xdefine bcstq 1to2
%endmacro
%macro INIT_YMM 0-1+
%assign avx_enabled 1
%define RESET_MM_PERMUTATION INIT_YMM %1
%define mmsize 32
%define mova movdqa
%define movu movdqu
%undef movh
%define movnta movntdq
INIT_CPUFLAGS %1
DEFINE_MMREGS ymm
AVX512_MM_PERMUTATION
%xdefine bcstd 1to8
%xdefine bcstq 1to4
%endmacro
%macro INIT_ZMM 0-1+
%assign avx_enabled 1
%define RESET_MM_PERMUTATION INIT_ZMM %1
%define mmsize 64
%define mova movdqa
%define movu movdqu
%undef movh
%define movnta movntdq
INIT_CPUFLAGS %1
DEFINE_MMREGS zmm
AVX512_MM_PERMUTATION
%xdefine bcstd 1to16
%xdefine bcstq 1to8
%endmacro
INIT_XMM
%macro DECLARE_MMCAST 1
%define mmmm%1 mm%1
%define mmxmm%1 mm%1
%define mmymm%1 mm%1
%define mmzmm%1 mm%1
%define xmmmm%1 mm%1
%define xmmxmm%1 xmm%1
%define xmmymm%1 xmm%1
%define xmmzmm%1 xmm%1
%define ymmmm%1 mm%1
%define ymmxmm%1 xmm%1
%define ymmymm%1 ymm%1
%define ymmzmm%1 ymm%1
%define zmmmm%1 mm%1
%define zmmxmm%1 xmm%1
%define zmmymm%1 ymm%1
%define zmmzmm%1 zmm%1
%define xm%1 xmm %+ m%1
%define ym%1 ymm %+ m%1
%define zm%1 zmm %+ m%1
%endmacro
%assign i 0
%rep 32
DECLARE_MMCAST i
%assign i i+1
%endrep
; I often want to use macros that permute their arguments. e.g. there's no
; efficient way to implement butterfly or transpose or dct without swapping some
; arguments.
;
; I would like to not have to manually keep track of the permutations:
; If I insert a permutation in the middle of a function, it should automatically
; change everything that follows. For more complex macros I may also have multiple
; implementations, e.g. the SSE2 and SSSE3 versions may have different permutations.
;
; Hence these macros. Insert a PERMUTE or some SWAPs at the end of a macro that
; permutes its arguments. It's equivalent to exchanging the contents of the
; registers, except that this way you exchange the register names instead, so it
; doesn't cost any cycles.
%macro PERMUTE 2-* ; takes a list of pairs to swap
%rep %0/2
%xdefine %%tmp%2 m%2
%rotate 2
%endrep
%rep %0/2
%xdefine m%1 %%tmp%2
CAT_XDEFINE nn, m%1, %1
%rotate 2
%endrep
%endmacro
%macro SWAP 2+ ; swaps a single chain (sometimes more concise than pairs)
%ifnum %1 ; SWAP 0, 1, ...
SWAP_INTERNAL_NUM %1, %2
%else ; SWAP m0, m1, ...
SWAP_INTERNAL_NAME %1, %2
%endif
%endmacro
%macro SWAP_INTERNAL_NUM 2-*
%rep %0-1
%xdefine %%tmp m%1
%xdefine m%1 m%2
%xdefine m%2 %%tmp
CAT_XDEFINE nn, m%1, %1
CAT_XDEFINE nn, m%2, %2
%rotate 1
%endrep
%endmacro
%macro SWAP_INTERNAL_NAME 2-*
%xdefine %%args nn %+ %1
%rep %0-1
%xdefine %%args %%args, nn %+ %2
%rotate 1
%endrep
SWAP_INTERNAL_NUM %%args
%endmacro
; If SAVE_MM_PERMUTATION is placed at the end of a function, then any later
; calls to that function will automatically load the permutation, so values can
; be returned in mmregs.
%macro SAVE_MM_PERMUTATION 0-1
%if %0
%xdefine %%f %1_m
%else
%xdefine %%f current_function %+ _m
%endif
%assign %%i 0
%rep num_mmregs
%xdefine %%tmp m %+ %%i
CAT_XDEFINE %%f, %%i, regnumof %+ %%tmp
%assign %%i %%i+1
%endrep
%endmacro
%macro LOAD_MM_PERMUTATION 0-1 ; name to load from
%if %0
%xdefine %%f %1_m
%else
%xdefine %%f current_function %+ _m
%endif
%xdefine %%tmp %%f %+ 0
%ifnum %%tmp
RESET_MM_PERMUTATION
AVX512_MM_PERMUTATION
%assign %%i 0
%rep num_mmregs
%xdefine %%tmp %%f %+ %%i
CAT_XDEFINE %%m, %%i, m %+ %%tmp
%assign %%i %%i+1
%endrep
%rep num_mmregs
%assign %%i %%i-1
CAT_XDEFINE m, %%i, %%m %+ %%i
CAT_XDEFINE nn, m %+ %%i, %%i
%endrep
%endif
%endmacro
; Append cpuflags to the callee's name iff the appended name is known and the plain name isn't
%macro call 1
%ifid %1
call_internal %1 %+ SUFFIX, %1
%else
call %1
%endif
%endmacro
%macro call_internal 2
%xdefine %%i %2
%ifndef cglobaled_%2
%ifdef cglobaled_%1
%xdefine %%i %1
%endif
%endif
call %%i
LOAD_MM_PERMUTATION %%i
%endmacro
; Substitutions that reduce instruction size but are functionally equivalent
%macro add 2
%ifnum %2
%if %2==128
sub %1, -128
%else
add %1, %2
%endif
%else
add %1, %2
%endif
%endmacro
%macro sub 2
%ifnum %2
%if %2==128
add %1, -128
%else
sub %1, %2
%endif
%else
sub %1, %2
%endif
%endmacro
;=============================================================================
; AVX abstraction layer
;=============================================================================
%assign i 0
%rep 32
%if i < 8
CAT_XDEFINE sizeofmm, i, 8
CAT_XDEFINE regnumofmm, i, i
%endif
CAT_XDEFINE sizeofxmm, i, 16
CAT_XDEFINE sizeofymm, i, 32
CAT_XDEFINE sizeofzmm, i, 64
CAT_XDEFINE regnumofxmm, i, i
CAT_XDEFINE regnumofymm, i, i
CAT_XDEFINE regnumofzmm, i, i
%assign i i+1
%endrep
%undef i
%macro CHECK_AVX_INSTR_EMU 3-*
%xdefine %%opcode %1
%xdefine %%dst %2
%rep %0-2
%ifidn %%dst, %3
%error non-avx emulation of ``%%opcode'' is not supported
%endif
%rotate 1
%endrep
%endmacro
;%1 == instruction
;%2 == minimal instruction set
;%3 == 1 if float, 0 if int
;%4 == 1 if 4-operand emulation, 0 if 3-operand emulation, 255 otherwise (no emulation)
;%5 == 1 if commutative (i.e. doesn't matter which src arg is which), 0 if not
;%6+: operands
%macro RUN_AVX_INSTR 6-9+
%ifnum sizeof%7
%assign __sizeofreg sizeof%7
%elifnum sizeof%6
%assign __sizeofreg sizeof%6
%else
%assign __sizeofreg mmsize
%endif
%assign __emulate_avx 0
%if avx_enabled && __sizeofreg >= 16
%xdefine __instr v%1
%else
%xdefine __instr %1
%if %0 >= 8+%4
%assign __emulate_avx 1
%endif
%endif
%ifnidn %2, fnord
%ifdef cpuname
%if notcpuflag(%2)
%error use of ``%1'' %2 instruction in cpuname function: current_function
%elif %3 == 0 && __sizeofreg == 16 && notcpuflag(sse2)
%error use of ``%1'' sse2 instruction in cpuname function: current_function
%elif %3 == 0 && __sizeofreg == 32 && notcpuflag(avx2)
%error use of ``%1'' avx2 instruction in cpuname function: current_function
%elif __sizeofreg == 16 && notcpuflag(sse)
%error use of ``%1'' sse instruction in cpuname function: current_function
%elif __sizeofreg == 32 && notcpuflag(avx)
%error use of ``%1'' avx instruction in cpuname function: current_function
%elif __sizeofreg == 64 && notcpuflag(avx512)
%error use of ``%1'' avx512 instruction in cpuname function: current_function
%elifidn %1, pextrw ; special case because the base instruction is mmx2,
%ifnid %6 ; but sse4 is required for memory operands
%if notcpuflag(sse4)
%error use of ``%1'' sse4 instruction in cpuname function: current_function
%endif
%endif
%endif
%endif
%endif
%if __emulate_avx
%xdefine __src1 %7
%xdefine __src2 %8
%if %5 && %4 == 0
%ifnidn %6, %7
%ifidn %6, %8
%xdefine __src1 %8
%xdefine __src2 %7
%elifnnum sizeof%8
; 3-operand AVX instructions with a memory arg can only have it in src2,
; whereas SSE emulation prefers to have it in src1 (i.e. the mov).
; So, if the instruction is commutative with a memory arg, swap them.
%xdefine __src1 %8
%xdefine __src2 %7
%endif
%endif
%endif
%ifnidn %6, __src1
%if %0 >= 9
CHECK_AVX_INSTR_EMU {%1 %6, %7, %8, %9}, %6, __src2, %9
%else
CHECK_AVX_INSTR_EMU {%1 %6, %7, %8}, %6, __src2
%endif
%if __sizeofreg == 8
MOVQ %6, __src1
%elif %3
MOVAPS %6, __src1
%else
MOVDQA %6, __src1
%endif
%endif
%if %0 >= 9
%1 %6, __src2, %9
%else
%1 %6, __src2
%endif
%elif %0 >= 9
__instr %6, %7, %8, %9
%elif %0 == 8
%if avx_enabled && %5
%xdefine __src1 %7
%xdefine __src2 %8
%ifnum regnumof%7
%ifnum regnumof%8
%if regnumof%7 < 8 && regnumof%8 >= 8 && regnumof%8 < 16 && sizeof%8 <= 32
; Most VEX-encoded instructions require an additional byte to encode when
; src2 is a high register (e.g. m8..15). If the instruction is commutative
; we can swap src1 and src2 when doing so reduces the instruction length.
%xdefine __src1 %8
%xdefine __src2 %7
%endif
%endif
%endif
__instr %6, __src1, __src2
%else
__instr %6, %7, %8
%endif
%elif %0 == 7
%if avx_enabled && %5
%xdefine __src1 %6
%xdefine __src2 %7
%ifnum regnumof%6
%ifnum regnumof%7
%if regnumof%6 < 8 && regnumof%7 >= 8 && regnumof%7 < 16 && sizeof%7 <= 32
%xdefine __src1 %7
%xdefine __src2 %6
%endif
%endif
%endif
__instr %6, __src1, __src2
%else
__instr %6, %7
%endif
%else
__instr %6
%endif
%endmacro
;%1 == instruction
;%2 == minimal instruction set
;%3 == 1 if float, 0 if int
;%4 == 1 if 4-operand emulation, 0 if 3-operand emulation, 255 otherwise (no emulation)
;%5 == 1 if commutative (i.e. doesn't matter which src arg is which), 0 if not
%macro AVX_INSTR 1-5 fnord, 0, 255, 0
%macro %1 1-10 fnord, fnord, fnord, fnord, %1, %2, %3, %4, %5
%ifidn %2, fnord
RUN_AVX_INSTR %6, %7, %8, %9, %10, %1
%elifidn %3, fnord
RUN_AVX_INSTR %6, %7, %8, %9, %10, %1, %2
%elifidn %4, fnord
RUN_AVX_INSTR %6, %7, %8, %9, %10, %1, %2, %3
%elifidn %5, fnord
RUN_AVX_INSTR %6, %7, %8, %9, %10, %1, %2, %3, %4
%else
RUN_AVX_INSTR %6, %7, %8, %9, %10, %1, %2, %3, %4, %5
%endif
%endmacro
%endmacro
; Instructions with both VEX/EVEX and legacy encodings
; Non-destructive instructions are written without parameters
AVX_INSTR addpd, sse2, 1, 0, 1
AVX_INSTR addps, sse, 1, 0, 1
AVX_INSTR addsd, sse2, 1, 0, 0
AVX_INSTR addss, sse, 1, 0, 0
AVX_INSTR addsubpd, sse3, 1, 0, 0
AVX_INSTR addsubps, sse3, 1, 0, 0
AVX_INSTR aesdec, aesni, 0, 0, 0
AVX_INSTR aesdeclast, aesni, 0, 0, 0
AVX_INSTR aesenc, aesni, 0, 0, 0
AVX_INSTR aesenclast, aesni, 0, 0, 0
AVX_INSTR aesimc, aesni
AVX_INSTR aeskeygenassist, aesni
AVX_INSTR andnpd, sse2, 1, 0, 0
AVX_INSTR andnps, sse, 1, 0, 0
AVX_INSTR andpd, sse2, 1, 0, 1
AVX_INSTR andps, sse, 1, 0, 1
AVX_INSTR blendpd, sse4, 1, 1, 0
AVX_INSTR blendps, sse4, 1, 1, 0
AVX_INSTR blendvpd, sse4 ; can't be emulated
AVX_INSTR blendvps, sse4 ; can't be emulated
AVX_INSTR cmpeqpd, sse2, 1, 0, 1
AVX_INSTR cmpeqps, sse, 1, 0, 1
AVX_INSTR cmpeqsd, sse2, 1, 0, 0
AVX_INSTR cmpeqss, sse, 1, 0, 0
AVX_INSTR cmplepd, sse2, 1, 0, 0
AVX_INSTR cmpleps, sse, 1, 0, 0
AVX_INSTR cmplesd, sse2, 1, 0, 0
AVX_INSTR cmpless, sse, 1, 0, 0
AVX_INSTR cmpltpd, sse2, 1, 0, 0
AVX_INSTR cmpltps, sse, 1, 0, 0
AVX_INSTR cmpltsd, sse2, 1, 0, 0
AVX_INSTR cmpltss, sse, 1, 0, 0
AVX_INSTR cmpneqpd, sse2, 1, 0, 1
AVX_INSTR cmpneqps, sse, 1, 0, 1
AVX_INSTR cmpneqsd, sse2, 1, 0, 0
AVX_INSTR cmpneqss, sse, 1, 0, 0
AVX_INSTR cmpnlepd, sse2, 1, 0, 0
AVX_INSTR cmpnleps, sse, 1, 0, 0
AVX_INSTR cmpnlesd, sse2, 1, 0, 0
AVX_INSTR cmpnless, sse, 1, 0, 0
AVX_INSTR cmpnltpd, sse2, 1, 0, 0
AVX_INSTR cmpnltps, sse, 1, 0, 0
AVX_INSTR cmpnltsd, sse2, 1, 0, 0
AVX_INSTR cmpnltss, sse, 1, 0, 0
AVX_INSTR cmpordpd, sse2 1, 0, 1
AVX_INSTR cmpordps, sse 1, 0, 1
AVX_INSTR cmpordsd, sse2 1, 0, 0
AVX_INSTR cmpordss, sse 1, 0, 0
AVX_INSTR cmppd, sse2, 1, 1, 0
AVX_INSTR cmpps, sse, 1, 1, 0
AVX_INSTR cmpsd, sse2, 1, 1, 0
AVX_INSTR cmpss, sse, 1, 1, 0
AVX_INSTR cmpunordpd, sse2, 1, 0, 1
AVX_INSTR cmpunordps, sse, 1, 0, 1
AVX_INSTR cmpunordsd, sse2, 1, 0, 0
AVX_INSTR cmpunordss, sse, 1, 0, 0
AVX_INSTR comisd, sse2, 1
AVX_INSTR comiss, sse, 1
AVX_INSTR cvtdq2pd, sse2, 1
AVX_INSTR cvtdq2ps, sse2, 1
AVX_INSTR cvtpd2dq, sse2, 1
AVX_INSTR cvtpd2ps, sse2, 1
AVX_INSTR cvtps2dq, sse2, 1
AVX_INSTR cvtps2pd, sse2, 1
AVX_INSTR cvtsd2si, sse2, 1
AVX_INSTR cvtsd2ss, sse2, 1, 0, 0
AVX_INSTR cvtsi2sd, sse2, 1, 0, 0
AVX_INSTR cvtsi2ss, sse, 1, 0, 0
AVX_INSTR cvtss2sd, sse2, 1, 0, 0
AVX_INSTR cvtss2si, sse, 1
AVX_INSTR cvttpd2dq, sse2, 1
AVX_INSTR cvttps2dq, sse2, 1
AVX_INSTR cvttsd2si, sse2, 1
AVX_INSTR cvttss2si, sse, 1
AVX_INSTR divpd, sse2, 1, 0, 0
AVX_INSTR divps, sse, 1, 0, 0
AVX_INSTR divsd, sse2, 1, 0, 0
AVX_INSTR divss, sse, 1, 0, 0
AVX_INSTR dppd, sse4, 1, 1, 0
AVX_INSTR dpps, sse4, 1, 1, 0
AVX_INSTR extractps, sse4, 1
AVX_INSTR gf2p8affineinvqb, gfni, 0, 1, 0
AVX_INSTR gf2p8affineqb, gfni, 0, 1, 0
AVX_INSTR gf2p8mulb, gfni, 0, 0, 0
AVX_INSTR haddpd, sse3, 1, 0, 0
AVX_INSTR haddps, sse3, 1, 0, 0
AVX_INSTR hsubpd, sse3, 1, 0, 0
AVX_INSTR hsubps, sse3, 1, 0, 0
AVX_INSTR insertps, sse4, 1, 1, 0
AVX_INSTR lddqu, sse3
AVX_INSTR ldmxcsr, sse, 1
AVX_INSTR maskmovdqu, sse2
AVX_INSTR maxpd, sse2, 1, 0, 1
AVX_INSTR maxps, sse, 1, 0, 1
AVX_INSTR maxsd, sse2, 1, 0, 0
AVX_INSTR maxss, sse, 1, 0, 0
AVX_INSTR minpd, sse2, 1, 0, 1
AVX_INSTR minps, sse, 1, 0, 1
AVX_INSTR minsd, sse2, 1, 0, 0
AVX_INSTR minss, sse, 1, 0, 0
AVX_INSTR movapd, sse2, 1
AVX_INSTR movaps, sse, 1
AVX_INSTR movd, mmx
AVX_INSTR movddup, sse3, 1
AVX_INSTR movdqa, sse2
AVX_INSTR movdqu, sse2
AVX_INSTR movhlps, sse, 1, 0, 0
AVX_INSTR movhpd, sse2, 1, 0, 0
AVX_INSTR movhps, sse, 1, 0, 0
AVX_INSTR movlhps, sse, 1, 0, 0
AVX_INSTR movlpd, sse2, 1, 0, 0
AVX_INSTR movlps, sse, 1, 0, 0
AVX_INSTR movmskpd, sse2, 1
AVX_INSTR movmskps, sse, 1
AVX_INSTR movntdq, sse2
AVX_INSTR movntdqa, sse4
AVX_INSTR movntpd, sse2, 1
AVX_INSTR movntps, sse, 1
AVX_INSTR movq, mmx
AVX_INSTR movsd, sse2, 1, 0, 0
AVX_INSTR movshdup, sse3, 1
AVX_INSTR movsldup, sse3, 1
AVX_INSTR movss, sse, 1, 0, 0
AVX_INSTR movupd, sse2, 1
AVX_INSTR movups, sse, 1
AVX_INSTR mpsadbw, sse4, 0, 1, 0
AVX_INSTR mulpd, sse2, 1, 0, 1
AVX_INSTR mulps, sse, 1, 0, 1
AVX_INSTR mulsd, sse2, 1, 0, 0
AVX_INSTR mulss, sse, 1, 0, 0
AVX_INSTR orpd, sse2, 1, 0, 1
AVX_INSTR orps, sse, 1, 0, 1
AVX_INSTR pabsb, ssse3
AVX_INSTR pabsd, ssse3
AVX_INSTR pabsw, ssse3
AVX_INSTR packsswb, mmx, 0, 0, 0
AVX_INSTR packssdw, mmx, 0, 0, 0
AVX_INSTR packuswb, mmx, 0, 0, 0
AVX_INSTR packusdw, sse4, 0, 0, 0
AVX_INSTR paddb, mmx, 0, 0, 1
AVX_INSTR paddw, mmx, 0, 0, 1
AVX_INSTR paddd, mmx, 0, 0, 1
AVX_INSTR paddq, sse2, 0, 0, 1
AVX_INSTR paddsb, mmx, 0, 0, 1
AVX_INSTR paddsw, mmx, 0, 0, 1
AVX_INSTR paddusb, mmx, 0, 0, 1
AVX_INSTR paddusw, mmx, 0, 0, 1
AVX_INSTR palignr, ssse3, 0, 1, 0
AVX_INSTR pand, mmx, 0, 0, 1
AVX_INSTR pandn, mmx, 0, 0, 0
AVX_INSTR pavgb, mmx2, 0, 0, 1
AVX_INSTR pavgw, mmx2, 0, 0, 1
AVX_INSTR pblendvb, sse4 ; can't be emulated
AVX_INSTR pblendw, sse4, 0, 1, 0
AVX_INSTR pclmulqdq, fnord, 0, 1, 0
AVX_INSTR pclmulhqhqdq, fnord, 0, 0, 0
AVX_INSTR pclmulhqlqdq, fnord, 0, 0, 0
AVX_INSTR pclmullqhqdq, fnord, 0, 0, 0
AVX_INSTR pclmullqlqdq, fnord, 0, 0, 0
AVX_INSTR pcmpestri, sse42
AVX_INSTR pcmpestrm, sse42
AVX_INSTR pcmpistri, sse42
AVX_INSTR pcmpistrm, sse42
AVX_INSTR pcmpeqb, mmx, 0, 0, 1
AVX_INSTR pcmpeqw, mmx, 0, 0, 1
AVX_INSTR pcmpeqd, mmx, 0, 0, 1
AVX_INSTR pcmpeqq, sse4, 0, 0, 1
AVX_INSTR pcmpgtb, mmx, 0, 0, 0
AVX_INSTR pcmpgtw, mmx, 0, 0, 0
AVX_INSTR pcmpgtd, mmx, 0, 0, 0
AVX_INSTR pcmpgtq, sse42, 0, 0, 0
AVX_INSTR pextrb, sse4
AVX_INSTR pextrd, sse4
AVX_INSTR pextrq, sse4
AVX_INSTR pextrw, mmx2
AVX_INSTR phaddw, ssse3, 0, 0, 0
AVX_INSTR phaddd, ssse3, 0, 0, 0
AVX_INSTR phaddsw, ssse3, 0, 0, 0
AVX_INSTR phminposuw, sse4
AVX_INSTR phsubw, ssse3, 0, 0, 0
AVX_INSTR phsubd, ssse3, 0, 0, 0
AVX_INSTR phsubsw, ssse3, 0, 0, 0
AVX_INSTR pinsrb, sse4, 0, 1, 0
AVX_INSTR pinsrd, sse4, 0, 1, 0
AVX_INSTR pinsrq, sse4, 0, 1, 0
AVX_INSTR pinsrw, mmx2, 0, 1, 0
AVX_INSTR pmaddwd, mmx, 0, 0, 1
AVX_INSTR pmaddubsw, ssse3, 0, 0, 0
AVX_INSTR pmaxsb, sse4, 0, 0, 1
AVX_INSTR pmaxsw, mmx2, 0, 0, 1
AVX_INSTR pmaxsd, sse4, 0, 0, 1
AVX_INSTR pmaxub, mmx2, 0, 0, 1
AVX_INSTR pmaxuw, sse4, 0, 0, 1
AVX_INSTR pmaxud, sse4, 0, 0, 1
AVX_INSTR pminsb, sse4, 0, 0, 1
AVX_INSTR pminsw, mmx2, 0, 0, 1
AVX_INSTR pminsd, sse4, 0, 0, 1
AVX_INSTR pminub, mmx2, 0, 0, 1
AVX_INSTR pminuw, sse4, 0, 0, 1
AVX_INSTR pminud, sse4, 0, 0, 1
AVX_INSTR pmovmskb, mmx2
AVX_INSTR pmovsxbw, sse4
AVX_INSTR pmovsxbd, sse4
AVX_INSTR pmovsxbq, sse4
AVX_INSTR pmovsxwd, sse4
AVX_INSTR pmovsxwq, sse4
AVX_INSTR pmovsxdq, sse4
AVX_INSTR pmovzxbw, sse4
AVX_INSTR pmovzxbd, sse4
AVX_INSTR pmovzxbq, sse4
AVX_INSTR pmovzxwd, sse4
AVX_INSTR pmovzxwq, sse4
AVX_INSTR pmovzxdq, sse4
AVX_INSTR pmuldq, sse4, 0, 0, 1
AVX_INSTR pmulhrsw, ssse3, 0, 0, 1
AVX_INSTR pmulhuw, mmx2, 0, 0, 1
AVX_INSTR pmulhw, mmx, 0, 0, 1
AVX_INSTR pmullw, mmx, 0, 0, 1
AVX_INSTR pmulld, sse4, 0, 0, 1
AVX_INSTR pmuludq, sse2, 0, 0, 1
AVX_INSTR por, mmx, 0, 0, 1
AVX_INSTR psadbw, mmx2, 0, 0, 1
AVX_INSTR pshufb, ssse3, 0, 0, 0
AVX_INSTR pshufd, sse2
AVX_INSTR pshufhw, sse2
AVX_INSTR pshuflw, sse2
AVX_INSTR psignb, ssse3, 0, 0, 0
AVX_INSTR psignw, ssse3, 0, 0, 0
AVX_INSTR psignd, ssse3, 0, 0, 0
AVX_INSTR psllw, mmx, 0, 0, 0
AVX_INSTR pslld, mmx, 0, 0, 0
AVX_INSTR psllq, mmx, 0, 0, 0
AVX_INSTR pslldq, sse2, 0, 0, 0
AVX_INSTR psraw, mmx, 0, 0, 0
AVX_INSTR psrad, mmx, 0, 0, 0
AVX_INSTR psrlw, mmx, 0, 0, 0
AVX_INSTR psrld, mmx, 0, 0, 0
AVX_INSTR psrlq, mmx, 0, 0, 0
AVX_INSTR psrldq, sse2, 0, 0, 0
AVX_INSTR psubb, mmx, 0, 0, 0
AVX_INSTR psubw, mmx, 0, 0, 0
AVX_INSTR psubd, mmx, 0, 0, 0
AVX_INSTR psubq, sse2, 0, 0, 0
AVX_INSTR psubsb, mmx, 0, 0, 0
AVX_INSTR psubsw, mmx, 0, 0, 0
AVX_INSTR psubusb, mmx, 0, 0, 0
AVX_INSTR psubusw, mmx, 0, 0, 0
AVX_INSTR ptest, sse4
AVX_INSTR punpckhbw, mmx, 0, 0, 0
AVX_INSTR punpckhwd, mmx, 0, 0, 0
AVX_INSTR punpckhdq, mmx, 0, 0, 0
AVX_INSTR punpckhqdq, sse2, 0, 0, 0
AVX_INSTR punpcklbw, mmx, 0, 0, 0
AVX_INSTR punpcklwd, mmx, 0, 0, 0
AVX_INSTR punpckldq, mmx, 0, 0, 0
AVX_INSTR punpcklqdq, sse2, 0, 0, 0
AVX_INSTR pxor, mmx, 0, 0, 1
AVX_INSTR rcpps, sse, 1
AVX_INSTR rcpss, sse, 1, 0, 0
AVX_INSTR roundpd, sse4, 1
AVX_INSTR roundps, sse4, 1
AVX_INSTR roundsd, sse4, 1, 1, 0
AVX_INSTR roundss, sse4, 1, 1, 0
AVX_INSTR rsqrtps, sse, 1
AVX_INSTR rsqrtss, sse, 1, 0, 0
AVX_INSTR shufpd, sse2, 1, 1, 0
AVX_INSTR shufps, sse, 1, 1, 0
AVX_INSTR sqrtpd, sse2, 1
AVX_INSTR sqrtps, sse, 1
AVX_INSTR sqrtsd, sse2, 1, 0, 0
AVX_INSTR sqrtss, sse, 1, 0, 0
AVX_INSTR stmxcsr, sse, 1
AVX_INSTR subpd, sse2, 1, 0, 0
AVX_INSTR subps, sse, 1, 0, 0
AVX_INSTR subsd, sse2, 1, 0, 0
AVX_INSTR subss, sse, 1, 0, 0
AVX_INSTR ucomisd, sse2, 1
AVX_INSTR ucomiss, sse, 1
AVX_INSTR unpckhpd, sse2, 1, 0, 0
AVX_INSTR unpckhps, sse, 1, 0, 0
AVX_INSTR unpcklpd, sse2, 1, 0, 0
AVX_INSTR unpcklps, sse, 1, 0, 0
AVX_INSTR xorpd, sse2, 1, 0, 1
AVX_INSTR xorps, sse, 1, 0, 1
; 3DNow instructions, for sharing code between AVX, SSE and 3DN
AVX_INSTR pfadd, 3dnow, 1, 0, 1
AVX_INSTR pfsub, 3dnow, 1, 0, 0
AVX_INSTR pfmul, 3dnow, 1, 0, 1
;%1 == instruction
;%2 == minimal instruction set
%macro GPR_INSTR 2
%macro %1 2-5 fnord, %1, %2
%ifdef cpuname
%if notcpuflag(%5)
%error use of ``%4'' %5 instruction in cpuname function: current_function
%endif
%endif
%ifidn %3, fnord
%4 %1, %2
%else
%4 %1, %2, %3
%endif
%endmacro
%endmacro
GPR_INSTR andn, bmi1
GPR_INSTR bextr, bmi1
GPR_INSTR blsi, bmi1
GPR_INSTR blsmsk, bmi1
GPR_INSTR blsr, bmi1
GPR_INSTR bzhi, bmi2
GPR_INSTR mulx, bmi2
GPR_INSTR pdep, bmi2
GPR_INSTR pext, bmi2
GPR_INSTR popcnt, sse42
GPR_INSTR rorx, bmi2
GPR_INSTR sarx, bmi2
GPR_INSTR shlx, bmi2
GPR_INSTR shrx, bmi2
; base-4 constants for shuffles
%assign i 0
%rep 256
%assign j ((i>>6)&3)*1000 + ((i>>4)&3)*100 + ((i>>2)&3)*10 + (i&3)
%if j < 10
CAT_XDEFINE q000, j, i
%elif j < 100
CAT_XDEFINE q00, j, i
%elif j < 1000
CAT_XDEFINE q0, j, i
%else
CAT_XDEFINE q, j, i
%endif
%assign i i+1
%endrep
%undef i
%undef j
%macro FMA_INSTR 3
%macro %1 4-7 %1, %2, %3
%if cpuflag(xop)
v%5 %1, %2, %3, %4
%elifnidn %1, %4
%6 %1, %2, %3
%7 %1, %4
%else
%error non-xop emulation of ``%5 %1, %2, %3, %4'' is not supported
%endif
%endmacro
%endmacro
FMA_INSTR pmacsww, pmullw, paddw
FMA_INSTR pmacsdd, pmulld, paddd ; sse4 emulation
FMA_INSTR pmacsdql, pmuldq, paddq ; sse4 emulation
FMA_INSTR pmadcswd, pmaddwd, paddd
; Macros for consolidating FMA3 and FMA4 using 4-operand (dst, src1, src2, src3) syntax.
; FMA3 is only possible if dst is the same as one of the src registers.
; Either src2 or src3 can be a memory operand.
%macro FMA4_INSTR 2-*
%push fma4_instr
%xdefine %$prefix %1
%rep %0 - 1
%macro %$prefix%2 4-6 %$prefix, %2
%if notcpuflag(fma3) && notcpuflag(fma4)
%error use of ``%5%6'' fma instruction in cpuname function: current_function
%elif cpuflag(fma4)
v%5%6 %1, %2, %3, %4
%elifidn %1, %2
; If %3 or %4 is a memory operand it needs to be encoded as the last operand.
%ifnum sizeof%3
v%{5}213%6 %2, %3, %4
%else
v%{5}132%6 %2, %4, %3
%endif
%elifidn %1, %3
v%{5}213%6 %3, %2, %4
%elifidn %1, %4
v%{5}231%6 %4, %2, %3
%else
%error fma3 emulation of ``%5%6 %1, %2, %3, %4'' is not supported
%endif
%endmacro
%rotate 1
%endrep
%pop
%endmacro
FMA4_INSTR fmadd, pd, ps, sd, ss
FMA4_INSTR fmaddsub, pd, ps
FMA4_INSTR fmsub, pd, ps, sd, ss
FMA4_INSTR fmsubadd, pd, ps
FMA4_INSTR fnmadd, pd, ps, sd, ss
FMA4_INSTR fnmsub, pd, ps, sd, ss
; Macros for converting VEX instructions to equivalent EVEX ones.
%macro EVEX_INSTR 2-3 0 ; vex, evex, prefer_evex
%macro %1 2-7 fnord, fnord, %1, %2, %3
%ifidn %3, fnord
%define %%args %1, %2
%elifidn %4, fnord
%define %%args %1, %2, %3
%else
%define %%args %1, %2, %3, %4
%endif
%assign %%evex_required cpuflag(avx512) & %7
%ifnum regnumof%1
%if regnumof%1 >= 16 || sizeof%1 > 32
%assign %%evex_required 1
%endif
%endif
%ifnum regnumof%2
%if regnumof%2 >= 16 || sizeof%2 > 32
%assign %%evex_required 1
%endif
%endif
%ifnum regnumof%3
%if regnumof%3 >= 16 || sizeof%3 > 32
%assign %%evex_required 1
%endif
%endif
%if %%evex_required
%6 %%args
%else
%5 %%args ; Prefer VEX over EVEX due to shorter instruction length
%endif
%endmacro
%endmacro
EVEX_INSTR vbroadcastf128, vbroadcastf32x4
EVEX_INSTR vbroadcasti128, vbroadcasti32x4
EVEX_INSTR vextractf128, vextractf32x4
EVEX_INSTR vextracti128, vextracti32x4
EVEX_INSTR vinsertf128, vinsertf32x4
EVEX_INSTR vinserti128, vinserti32x4
EVEX_INSTR vmovdqa, vmovdqa32
EVEX_INSTR vmovdqu, vmovdqu32
EVEX_INSTR vpand, vpandd
EVEX_INSTR vpandn, vpandnd
EVEX_INSTR vpor, vpord
EVEX_INSTR vpxor, vpxord
EVEX_INSTR vrcpps, vrcp14ps, 1 ; EVEX versions have higher precision
EVEX_INSTR vrcpss, vrcp14ss, 1
EVEX_INSTR vrsqrtps, vrsqrt14ps, 1
EVEX_INSTR vrsqrtss, vrsqrt14ss, 1
| 29.80675 | 150 | 0.614702 | [
"BSD-2-Clause"
] | brianjjones/dav1d | src/ext/x86/x86inc.asm | 54,755 | Assembly |
; A017274: a(n) = (10*n)^6.
; 0,1000000,64000000,729000000,4096000000,15625000000,46656000000,117649000000,262144000000,531441000000,1000000000000,1771561000000,2985984000000,4826809000000,7529536000000,11390625000000,16777216000000,24137569000000,34012224000000,47045881000000,64000000000000,85766121000000,113379904000000,148035889000000,191102976000000,244140625000000,308915776000000,387420489000000,481890304000000,594823321000000,729000000000000,887503681000000,1073741824000000,1291467969000000,1544804416000000
pow $0,6
mul $0,1000000
| 90.666667 | 490 | 0.887868 | [
"Apache-2.0"
] | ckrause/loda-programs | oeis/017/A017274.asm | 544 | Assembly |
; A116092: Expansion of 1/sqrt(1+8*x+64*x^2).
; Submitted by Christian Krause
; 1,-4,-8,224,-1184,-2944,84736,-467968,-1235456,35956736,-202108928,-548651008,16063381504,-91151859712,-251452325888,7389369073664,-42180470767616,-117581870006272,3464100777558016,-19854347412176896,-55753417460547584,1645577388148391936,-9459396258843066368,-26707897213964517376,789388165385096790016,-4547870011793178886144,-12894445469628706586624,381528819969819831959552,-2201954950780069930336256,-6263928158898661888098304,185503847804929799876509696,-1072135380623143236926439424
mov $2,$0
seq $0,116091 ; Expansion of 1/sqrt(1+4*x+16*x^2).
lpb $2
mul $0,2
sub $2,1
lpe
| 60.454545 | 491 | 0.82406 | [
"Apache-2.0"
] | ckrause/loda-programs | oeis/116/A116092.asm | 665 | Assembly |
; Let the user input a signed decimal integer
; from the console. Use a finite-state diagram, and
; Display an error message if invalid input is entered.
.model small
.stack 100h
DOS_CHAR_INPUT = 1
ENTER_KEY = 0Dh
.data
InvalidInputMessage db "Invalid input",0dh,0ah,0
.code
extrn Writestring:proc, Crlf:proc, Clrscr:proc
main proc
mov ax,@data
mov ds,ax
call Clrscr
StateA:
call Getnext ; read next char into AL
cmp al,'+' ; leading + sign?
je StateB ; go to State B
cmp al,'-' ; leading - sign?
je StateB ; go to State C
call Isdigit ; ZF = 1 if AL contains a digit
jz StateC
call DisplayError ; invalid input found
jmp Exit
StateB:
call Getnext ; read next char into AL
call Isdigit ; ZF = 1 if AL contains a digit
jz StateC
call DisplayError ; invalid input found
jmp Exit
StateC:
call Getnext ; read next char into AL
jz Exit ; quit if Enter pressed
call Isdigit ; ZF = 1 if AL contains a digit
jz StateC
call DisplayError ; invalid input found
jmp Exit
Exit:
call Crlf
mov ax,4c00h
int 21h
main endp
; Read char from standard input into AL,
; set ZF = 1 if Enter key was read.
Getnext proc
mov ah,DOS_CHAR_INPUT ; read standard input
int 21h ; AL = character
cmp al,ENTER_KEY
ret
Getnext endp
; Set ZF = 1 if the character in AL is a digit.
Isdigit proc
cmp al,'0'
jb A1
cmp al,'9'
ja A1
test ax,0 ; set ZF = 1
A1: ret
Isdigit endp
; Display error message.
DisplayError proc
push dx
mov dx,offset InvalidInputMessage
call WriteString
call Crlf
pop dx
ret
DisplayError endp
end main
| 24.305556 | 55 | 0.640571 | [
"MIT"
] | Dumebi35/DumebiCSC102 | week_7/dataset/Assembly/056596.asm | 1,750 | Assembly |
; A300254: a(n) = 25*(n + 1)*(4*n + 3)*(5*n + 4)/3.
; 100,1050,3850,9500,19000,33350,53550,80600,115500,159250,212850,277300,353600,442750,545750,663600,797300,947850,1116250,1303500,1510600,1738550,1988350,2261000,2557500,2878850,3226050,3600100,4002000,4432750,4893350,5384800,5908100,6464250,7054250,7679100,8339800,9037350,9772750,10547000,11361100,12216050,13112850,14052500,15036000,16064350,17138550,18259600,19428500,20646250,21913850,23232300,24602600,26025750,27502750,29034600,30622300,32266850,33969250,35730500,37551600,39433550,41377350,43384000,45454500,47589850,49791050,52059100,54395000,56799750,59274350,61819800,64437100,67127250,69891250,72730100,75644800,78636350,81705750,84854000,88082100,91391050,94781850,98255500,101813000,105455350,109183550,112998600,116901500,120893250,124974850,129147300,133411600,137768750,142219750,146765600,151407300,156145850,160982250,165917500,170952600,176088550,181326350,186667000,192111500,197660850,203316050,209078100,214948000,220926750,227015350,233214800,239526100,245950250,252488250,259141100,265909800,272795350,279798750,286921000,294163100,301526050,309010850,316618500,324350000,332206350,340188550,348297600,356534500,364900250,373395850,382022300,390780600,399671750,408696750,417856600,427152300,436584850,446155250,455864500,465713600,475703550,485835350,496110000,506528500,517091850,527801050,538657100,549661000,560813750,572116350,583569800,595175100,606933250,618845250,630912100,643134800,655514350,668051750,680748000,693604100,706621050,719799850,733141500,746647000,760317350,774153550,788156600,802327500,816667250,831176850,845857300,860709600,875734750,890933750,906307600,921857300,937583850,953488250,969571500,985834600,1002278550,1018904350,1035713000,1052705500,1069882850,1087246050,1104796100,1122534000,1140460750,1158577350,1176884800,1195384100,1214076250,1232962250,1252043100,1271319800,1290793350,1310464750,1330335000,1350405100,1370676050,1391148850,1411824500,1432704000,1453788350,1475078550,1496575600,1518280500,1540194250,1562317850,1584652300,1607198600,1629957750,1652930750,1676118600,1699522300,1723142850,1746981250,1771038500,1795315600,1819813550,1844533350,1869476000,1894642500,1920033850,1945651050,1971495100,1997567000,2023867750,2050398350,2077159800,2104153100,2131379250,2158839250,2186534100,2214464800,2242632350,2271037750,2299682000,2328566100,2357691050,2387057850,2416667500,2446521000,2476619350,2506963550,2537554600,2568393500,2599481250
mov $1,$0
add $1,1
mul $1,4
mov $2,$0
add $2,$1
bin $1,2
mul $1,$2
mul $1,3
sub $1,72
div $1,36
mul $1,50
add $1,100
| 161.6875 | 2,416 | 0.869733 | [
"Apache-2.0"
] | jmorken/loda | programs/oeis/300/A300254.asm | 2,587 | Assembly |
.file "(extract)es.c"
.text
.globl pari_flush
.type pari_flush, @function
pari_flush:
pushl %ebx
subl $8, %esp
call .L00000009
.L00000009:
popl %ebx
addl $_GLOBAL_OFFSET_TABLE_+1, %ebx
movl pariOut@GOT(%ebx), %ecx
movl (%ecx), %edx
call *8(%edx)
.L0000001B:
addl $8, %esp
popl %ebx
ret
.size pari_flush, .-pari_flush
# ----------------------
.ident "GCC: (GNU) 3.2.3 20030502 (Red Hat Linux 3.2.3-59)"
.section .note.GNU-stack,"",@progbits
| 22.347826 | 60 | 0.570039 | [
"Apache-2.0"
] | LRGH/plasmasm | non_regression/other_x86_linux_27.o.asm | 514 | Assembly |
;Problem Statement:Write X86 ALP to find, a) Number of Blank spaces b) Number of lines c) Occurrence of a particular character. Accept the data from the text file. The text file has to be accessed during Program_1 execution and write FAR PROCEDURES in Program_2 for the rest of the processing. Use of PUBLIC and EXTERN directives is mandatory.
;************************************************************
extern far_proc ; [ FAR PROCRDURE
; USING EXTERN DIRECTIVE ]
global filehandle, char, buf, abuf_len
%include "macro.asm"
;************************************************************
section .data
nline db 10
nline_len equ $-nline
ano db 10,10,10,10,"ML assignment 05 :- String Operation using Far Procedure"
db 10,"---------------------------------------------------",10
ano_len equ $-ano
filemsg db 10,"Enter filename for string operation : "
filemsg_len equ $-filemsg
charmsg db 10,"Enter character to search : "
charmsg_len equ $-charmsg
errmsg db 10,"ERROR in opening File...",10
errmsg_len equ $-errmsg
exitmsg db 10,10,"Exit from program...",10,10
exitmsg_len equ $-exitmsg
;************************************************************
section .bss
buf resb 4096
buf_len equ $-buf ; buffer initial length
filename resb 50
char resb 2
filehandle resq 1
abuf_len resq 1 ; actual buffer length
;************************************************************
section .text
global _start
_start:
display ano,ano_len ;assignment no.
display filemsg,filemsg_len
accept filename,50
dec rax
mov byte[filename + rax],0 ; blank char/null char
display charmsg,charmsg_len
accept char,2
fopen filename ; on succes returns handle
cmp rax,-1H ; on failure returns -1
jle Error
mov [filehandle],rax
fread [filehandle],buf, buf_len
mov [abuf_len],rax
call far_proc
jmp Exit
Error: display errmsg, errmsg_len
Exit: display exitmsg,exitmsg_len
display nline,nline_len
mov rax,60
mov rdi,0
syscall
| 31.275 | 344 | 0.496403 | [
"MIT"
] | bhushanasati25/College | 2 Year/2015 Pattern/MPL/Assignment 5/Assignment 5-1.asm | 2,502 | Assembly |
; A311536: Coordination sequence Gal.6.120.2 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings.
; 1,4,8,12,17,22,27,32,37,42,46,50,54,58,62,66,71,76,81,86,91,96,100,104,108,112,116,120,125,130,135,140,145,150,154,158,162,166,170,174,179,184,189,194,199,204,208,212,216,220
mov $2,$0
add $2,1
mov $4,$0
lpb $2
mov $0,$4
sub $2,1
sub $0,$2
mov $3,$0
lpb $0
sub $0,1
add $3,2
div $3,2
mod $3,6
add $3,1
lpe
add $3,1
add $1,$3
lpe
| 24.818182 | 177 | 0.639194 | [
"Apache-2.0"
] | jmorken/loda | programs/oeis/311/A311536.asm | 546 | Assembly |
; Compile with: NASM -fbin cpuid_1.asm
BITS 64 ; Avoids nasm putting the OPCODE prefix (66h)
mov eax, 1
cpuid | 18.5 | 53 | 0.738739 | [
"MIT"
] | dd86k/ddcput | examples/cpuid_1.asm | 111 | Assembly |
; A245235: Repeat 2^(n*(n+1)/2) n+1 times.
; Submitted by Jamie Morken(s1)
; 1,2,2,8,8,8,64,64,64,64,1024,1024,1024,1024,1024,32768,32768,32768,32768,32768,32768,2097152,2097152,2097152,2097152,2097152,2097152,2097152,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456
seq $0,57944 ; Largest triangular number less than or equal to n; write m-th triangular number m+1 times.
mov $1,2
pow $1,$0
mov $0,$1
| 48.222222 | 222 | 0.760369 | [
"Apache-2.0"
] | ckrause/loda-programs | oeis/245/A245235.asm | 434 | Assembly |
charmap "ガ", $05
charmap "ギ", $06
charmap "グ", $07
charmap "ゲ", $08
charmap "ゴ", $09
charmap "ザ", $0A
charmap "ジ", $0B
charmap "ズ", $0C
charmap "ゼ", $0D
charmap "ゾ", $0E
charmap "ダ", $0F
charmap "ヂ", $10
charmap "ヅ", $11
charmap "デ", $12
charmap "ド", $13
charmap "バ", $19
charmap "ビ", $1A
charmap "ブ", $1B
charmap "ボ", $1C
charmap "が", $26
charmap "ぎ", $27
charmap "ぐ", $28
charmap "げ", $29
charmap "ご", $2A
charmap "ざ", $2B
charmap "じ", $2C
charmap "ず", $2D
charmap "ぜ", $2E
charmap "ぞ", $2F
charmap "だ", $30
charmap "ぢ", $31
charmap "づ", $32
charmap "で", $33
charmap "ど", $34
charmap "ば", $3A
charmap "び", $3B
charmap "ぶ", $3C
charmap "べ", $3D
charmap "ぼ", $3E
charmap "パ", $40
charmap "ピ", $41
charmap "プ", $42
charmap "ポ", $43
charmap "ぱ", $44
charmap "ぴ", $45
charmap "ぷ", $46
charmap "ぺ", $47
charmap "ぽ", $48
charmap "ア", $80
charmap "イ", $81
charmap "ウ", $82
charmap "エ", $83
charmap "ォ", $84
charmap "カ", $85
charmap "キ", $86
charmap "ク", $87
charmap "ケ", $88
charmap "コ", $89
charmap "サ", $8A
charmap "シ", $8B
charmap "ス", $8C
charmap "セ", $8D
charmap "ソ", $8E
charmap "タ", $8F
charmap "チ", $90
charmap "ツ", $91
charmap "テ", $92
charmap "ト", $93
charmap "ナ", $94
charmap "ニ", $95
charmap "ヌ", $96
charmap "ネ", $97
charmap "ノ", $98
charmap "ハ", $99
charmap "ヒ", $9A
charmap "フ", $9B
charmap "ホ", $9C
charmap "マ", $9D
charmap "ミ", $9E
charmap "ム", $9F
charmap "メ", $A0
charmap "モ", $A1
charmap "ヤ", $A2
charmap "ユ", $A3
charmap "ヨ", $A4
charmap "ラ", $A5
charmap "ル", $A6
charmap "レ", $A7
charmap "ロ", $A8
charmap "ワ", $A9
charmap "ヲ", $AA
charmap "ン", $AB
charmap "ッ", $AC
charmap "ャ", $AD
charmap "ュ", $AE
charmap "ョ", $AF
charmap "ィ", $B0
charmap "あ", $B1
charmap "い", $B2
charmap "う", $B3
charmap "え", $B4
charmap "お", $B5
charmap "か", $B6
charmap "き", $B7
charmap "く", $B8
charmap "け", $B9
charmap "こ", $BA
charmap "さ", $BB
charmap "し", $BC
charmap "す", $BD
charmap "せ", $BE
charmap "そ", $BF
charmap "た", $C0
charmap "ち", $C1
charmap "つ", $C2
charmap "て", $C3
charmap "と", $C4
charmap "な", $C5
charmap "に", $C6
charmap "ぬ", $C7
charmap "ね", $C8
charmap "の", $C9
charmap "は", $CA
charmap "ひ", $CB
charmap "ふ", $CC
charmap "へ", $CD
charmap "ほ", $CE
charmap "ま", $CF
charmap "み", $D0
charmap "む", $D1
charmap "め", $D2
charmap "も", $D3
charmap "や", $D4
charmap "ゆ", $D5
charmap "よ", $D6
charmap "ら", $D7
charmap "り", $D8
charmap "る", $D9
charmap "れ", $DA
charmap "ろ", $DB
charmap "わ", $DC
charmap "を", $DD
charmap "ん", $DE
charmap "っ", $DF
charmap "ゃ", $E0
charmap "ゅ", $E1
charmap "ょ", $E2
charmap "ー", $E3
charmap "<pkmn>", $4A ; PkMn
charmap "@", $50
charmap "<PLAYER>", $52
charmap "<RIVAL>", $53
charmap "#", $54
;charmap "POKé", $54
charmap "<TARGET>", $59
charmap "<USER>", $5A
charmap "′", $71
charmap "″", $73
charmap "№", $74
charmap "…", $75
charmap "┌", $79
charmap "─", $7A
charmap "┐", $7B
charmap "│", $7C
charmap "└", $7D
charmap "┘", $7E
charmap " ", $7F
charmap "A", $80
charmap "B", $81
charmap "C", $82
charmap "D", $83
charmap "E", $84
charmap "F", $85
charmap "G", $86
charmap "H", $87
charmap "I", $88
charmap "J", $89
charmap "K", $8A
charmap "L", $8B
charmap "M", $8C
charmap "N", $8D
charmap "O", $8E
charmap "P", $8F
charmap "Q", $90
charmap "R", $91
charmap "S", $92
charmap "T", $93
charmap "U", $94
charmap "V", $95
charmap "W", $96
charmap "X", $97
charmap "Y", $98
charmap "Z", $99
charmap "a", $A0
charmap "b", $A1
charmap "c", $A2
charmap "d", $A3
charmap "e", $A4
charmap "f", $A5
charmap "g", $A6
charmap "h", $A7
charmap "i", $A8
charmap "j", $A9
charmap "k", $AA
charmap "l", $AB
charmap "m", $AC
charmap "n", $AD
charmap "o", $AE
charmap "p", $AF
charmap "q", $B0
charmap "r", $B1
charmap "s", $B2
charmap "t", $B3
charmap "u", $B4
charmap "v", $B5
charmap "w", $B6
charmap "x", $B7
charmap "y", $B8
charmap "z", $B9
charmap "é", $D0
charmap "'d", $D1
charmap "'l", $D2
charmap "'s", $D3
charmap "'t", $D4
charmap "'v", $D5
charmap "'r", $D6
charmap "'m", $D7
charmap "𝗟", $D8
charmap "(", $D9
charmap ")", $DA
charmap ":", $DB
charmap ";", $DC
charmap "[", $DD
charmap "]", $DE
charmap "*", $DF
charmap "'", $E0
charmap "-", $E3
charmap "+", $E4
charmap "&", $E5
charmap "?", $E6
charmap "!", $E7
charmap ".", $E8
charmap "%", $EA
charmap "𝗣", $EB
charmap "▷", $EC
charmap "▶", $ED
charmap "▲", $ED
charmap "▼", $EE
charmap "♂", $EF
charmap "¥", $F0
charmap "×", $F1
charmap "⠄", $F2
charmap "/", $F3
charmap ",", $F4
charmap "♀", $F5
charmap "0", $F6
charmap "1", $F7
charmap "2", $F8
charmap "3", $F9
charmap "4", $FA
charmap "5", $FB
charmap "6", $FC
charmap "7", $FD
charmap "8", $FE
charmap "9", $FF
| 16.589091 | 28 | 0.578255 | [
"MIT"
] | ETDV-TheVoid/pokemon-rgb-enhanced | charmap.asm | 4,902 | Assembly |
org 00h
;;creation of variabes and setting them to their respective ports
RS bit p3.0 ;set variable RS to p3.0
RW bit p3.1 ;set variable RW to p3.1
e bit p3.2 ;set variable e to p3.2
;;initialization procress
mov a,#38h ;use two lines and 5x7 matrix
call cmd_wrt
mov a,#80h ;force cursor to the beginning of the first line
call cmd_wrt
mov a,#0eh ;display ON, cursor ON
call cmd_wrt
mov a,#14h ;shift cursor postion to the right
call cmd_wrt
start:
call subject
call clearscreen
call lecturer
call clearscreen
call main
call clearscreen
call first_name
call clearscreen
call second_name
call clearscreen
call third_name
call clearscreen
call fourth_name
call clearscreen
call fifth_name
call clearscreen
call endline
call clearscreen
jmp start
main:
mov a,#'T' ;move letter T to accumulator-1
call data_wrt
mov a,#'H' ;move letter H to accumulator-2
call data_wrt
mov a,#'I' ;move letter I to accumulator-3
call data_wrt
mov a,#'S' ;move letter S to accumulator-4
call data_wrt
mov a,#' ' ;move space character to accumulator-5
call data_wrt
mov a,#'I' ;move letter I to accumulator-6
call data_wrt
mov a,#'S' ;move letter S to accumulator-7
call data_wrt
mov a,#' ' ;move space character to the accumulator-8
call data_wrt
mov a,#'G' ;move letter G to accumulator-9
call data_wrt
mov a,#'R' ;move letter R to accumulator-10
call data_wrt
mov a,#'O' ;move letter O to accumulator-11
call data_wrt
mov a,#'U' ;move letter U to accumulator-12
call data_wrt
mov a,#'P' ;move letter P to accumulator-13
call data_wrt
mov a,#' ' ;move space character to accumulator-14
call data_wrt
mov a,#'1' ;move letter 1 to accumulator-15
call data_wrt
mov a,#'3' ;move letter 3 to accumulator-16
call data_wrt
call slow_delay
mov a,#0c0h ;move cursor to second line position 1
call cmd_wrt
mov a,#'M' ;move letter M to accumulator-1
call data_wrt
mov a,#'e' ;move letter e to accumulator-2
call data_wrt
mov a,#'m' ;move letter m to accumulator-3
call data_wrt
mov a,#'b' ;move letter b to accumulator-4
call data_wrt
mov a,#'e' ;move letter e to accumulator-5
call data_wrt
mov a,#'r' ;move letter r to accumulator-6
call data_wrt
mov a,#'s' ;move letter s to accumulator-7
call data_wrt
mov a,#' ' ;move space character to the accumulator-8
call data_wrt
mov a,#'I' ;move letter I to accumulator-9
call data_wrt
mov a,#'n' ;move letter n to accumulator-10
call data_wrt
mov a,#'c' ;move letter c to accumulator-11
call data_wrt
mov a,#'l' ;move letter l to accumulator-12
call data_wrt
mov a,#'u' ;move letter u to accumulator-13
call data_wrt
mov a,#'d' ;move letter d to accumulator-14
call data_wrt
mov a,#'e' ;move letter e to accumulator-15
call data_wrt
mov a,#':' ;move the colon character to accumulator-16
call data_wrt
ret
second_name:
mov a,#80h ;force cursor to the beginning of the first line
call cmd_wrt
mov a,#'A' ;move letter A to accumulator-1
call data_wrt
mov a,#'k' ;move letter k to accumulator-2
call data_wrt
mov a,#'u' ;move letter u to accumulator-3
call data_wrt
mov a,#'b' ;move letter b to accumulator-4
call data_wrt
mov a,#'u' ;move letter u to accumulator-5
call data_wrt
mov a,#'e' ;move letter e to accumulator-6
call data_wrt
mov a,#'z' ;move letter z to accumulator-7
call data_wrt
mov a,#'e' ;move letter e to accumulator-8
call data_wrt
mov a,#' ' ;move space character to accumulator-9
call data_wrt
mov a,#'K' ;move letter K to accumulator-10
call data_wrt
mov a,#'.' ;move letter . to accumulator-11
call data_wrt
mov a,#' ' ;move space character to accumulator-12
call data_wrt
mov a,#'C' ;move letter C to accumulator-13
call data_wrt
mov a,#'.' ;move letter . to accumulator-14
call data_wrt
mov a,#0c0h ;move cursor to second line position 1
call cmd_wrt
mov a,#'2' ;move number 2 to accumulator-1
call data_wrt
mov a,#'0' ;move number 0 to accumulator-2
call data_wrt
mov a,#'1' ;move number 1 to accumulator-3
call data_wrt
mov a,#'1' ;move number 1 to accumulator-4
call data_wrt
mov a,#'3' ;move number 3 to accumulator-5
call data_wrt
mov a,#'6' ;move number 6 to accumulator-6
call data_wrt
mov a,#'4' ;move number 4 to accumulator-7
call data_wrt
mov a,#'0' ;move number 0 to accumulator-8
call data_wrt
mov a,#'6' ;move number 6 to accumulator-9
call data_wrt
mov a,#'2' ;move number 2 to accumulator-10
call data_wrt
ret
third_name:
mov a,#80h ;force cursor to the beginning of the first line
call cmd_wrt
mov a,#'O' ;move letter O to accumulator-1
call data_wrt
mov a,#'k' ;move letter k to accumulator-2
call data_wrt
mov a,#'o' ;move letter o to accumulator-3
call data_wrt
mov a,#'y' ;move letter y to accumulator-4
call data_wrt
mov a,#'e' ;move letter e to accumulator-5
call data_wrt
mov a,#' ' ;move space character to accumulator-6
call data_wrt
mov a,#'C' ;move letter C to accumulator-7
call data_wrt
mov a,#'h' ;move letter h to accumulator-8
call data_wrt
mov a,#'i' ;move letter i to accumulator-9
call data_wrt
mov a,#'d' ;move letter d to accumulator-10
call data_wrt
mov a,#'e' ;move letter e to accumulator-11
call data_wrt
mov a,#'r' ;move letter r to accumulator-12
call data_wrt
mov a,#'a' ;move letter a to accumulator-13
call data_wrt
mov a,#' ' ;move space character to accumulator-13
call data_wrt
mov a,#'D' ;move letter D to accumulator-14
call data_wrt
mov a,#'.' ;move character . to accumulator-15
call data_wrt
mov a,#0c0h ;move cursor to second line position 1
call cmd_wrt
mov a,#'2' ;move number 2 to accumulator-1
call data_wrt
mov a,#'0' ;move number 0 to accumulator-2
call data_wrt
mov a,#'1' ;move number 1 to accumulator-3
call data_wrt
mov a,#'1' ;move number 1 to accumulator-4
call data_wrt
mov a,#'3' ;move number 3 to accumulator-5
call data_wrt
mov a,#'6' ;move number 6 to accumulator-6
call data_wrt
mov a,#'4' ;move number 4 to accumulator-7
call data_wrt
mov a,#'0' ;move number 0 to accumulator-8
call data_wrt
mov a,#'6' ;move number 6 to accumulator-9
call data_wrt
mov a,#'3' ;move number 3 to accumulator-10
call data_wrt
ret
fourth_name:
mov a,#80h ;force cursor to the beginning of the first line
call cmd_wrt
mov a,#'E' ;move letter E to accumulator-1
call data_wrt
mov a,#'z' ;move letter z to accumulator-2
call data_wrt
mov a,#'e' ;move letter e to accumulator-3
call data_wrt
mov a,#'n' ;move letter n to accumulator-4
call data_wrt
mov a,#'w' ;move letter w to accumulator-5
call data_wrt
mov a,#'a' ;move letter a to accumulator-6
call data_wrt
mov a,#'n' ;move letter n to accumulator-7
call data_wrt
mov a,#'n' ;move letter n to accumulator-8
call data_wrt
mov a,#'e' ;move letter e to accumulator-9
call data_wrt
mov a,#' ' ;move space character to accumulator-10
call data_wrt
mov a,#'I' ;move letter I to accumulator-11
call data_wrt
mov a,#'.' ;move letter . to accumulator-12
call data_wrt
mov a,#' ' ;move space character to accumulator-13
call data_wrt
mov a,#'C' ;move letter C to accumulator-14
call data_wrt
mov a,#'.' ;move letter . to accumulator-15
call data_wrt
mov a,#0c0h ;move cursor to second line position 1
call cmd_wrt
mov a,#'2' ;move number 2 to accumulator-1
call data_wrt
mov a,#'0' ;move number 0 to accumulator-2
call data_wrt
mov a,#'1' ;move number 1 to accumulator-3
call data_wrt
mov a,#'1' ;move number 1 to accumulator-4
call data_wrt
mov a,#'3' ;move number 3 to accumulator-5
call data_wrt
mov a,#'6' ;move number 6 to accumulator-6
call data_wrt
mov a,#'4' ;move number 4 to accumulator-7
call data_wrt
mov a,#'0' ;move number 0 to accumulator-8
call data_wrt
mov a,#'6' ;move number 6 to accumulator-9
call data_wrt
mov a,#'5' ;move number 5 to accumulator-10
call data_wrt
ret
fifth_name:
mov a,#80h ;force cursor to the beginning of the first line
call cmd_wrt
mov a,#'N' ;move letter N to accumulator-1
call data_wrt
mov a,#'w' ;move letter w to accumulator-2
call data_wrt
mov a,#'o' ;move letter o to accumulator-3
call data_wrt
mov a,#'g' ;move letter g to accumulator-4
call data_wrt
mov a,#'b' ;move letter b to accumulator-5
call data_wrt
mov a,#'o' ;move letter o to accumulator-6
call data_wrt
mov a,#' ' ;move space character to accumulator-7
call data_wrt
mov a,#'C' ;move letter C to accumulator-8
call data_wrt
mov a,#'o' ;move letter o to accumulator-9
call data_wrt
mov a,#'l' ;move letter l to accumulator-10
call data_wrt
mov a,#'l' ;move letter l to accumulator-11
call data_wrt
mov a,#'i' ;move letter i to accumulator-12
call data_wrt
mov a,#'n' ;move letter n to accumulator-13
call data_wrt
mov a,#'s' ;move letter s to accumulator-14
call data_wrt
mov a,#' ' ;move space character to accumulator-15
call data_wrt
mov a,#'K' ;move letter K to accumulator-16
call data_wrt
mov a,#0c0h ;move cursor to second line position 1
call cmd_wrt
mov a,#'2' ;move number 2 to accumulator-1
call data_wrt
mov a,#'0' ;move number 0 to accumulator-2
call data_wrt
mov a,#'1' ;move number 1 to accumulator-3
call data_wrt
mov a,#'1' ;move number 1 to accumulator-4
call data_wrt
mov a,#'3' ;move number 3 to accumulator-5
call data_wrt
mov a,#'6' ;move number 6 to accumulator-6
call data_wrt
mov a,#'4' ;move number 4 to accumulator-7
call data_wrt
mov a,#'0' ;move number 0 to accumulator-8
call data_wrt
mov a,#'6' ;move number 6 to accumulator-9
call data_wrt
mov a,#'6' ;move number 6 to accumulator-10
call data_wrt
ret
subject:
mov a,#80h ;force cursor to the beginning of the first line
call cmd_wrt
mov a,#'E' ;move letter E to accumulator-1
call data_wrt
mov a,#'C' ;move letter C to accumulator-2
call data_wrt
mov a,#'E' ;move letter E to accumulator-3
call data_wrt
mov a,#' ' ;move space character to accumulator-4
call data_wrt
mov a,#'4' ;move number 4 to accumulator-5
call data_wrt
mov a,#'2' ;move number 2 to accumulator-6
call data_wrt
mov a,#'1' ;move number 1 to accumulator-7
call data_wrt
mov a,#' ' ;move space character to accumulator-8
call data_wrt
mov a,#'P' ;move letter P to accumulator-9
call data_wrt
mov a,#'R' ;move letter R to accumulator-10
call data_wrt
mov a,#'O' ;move letter O to accumulator-11
call data_wrt
mov a,#'J' ;move letter J to accumulator-12
call data_wrt
mov a,#'E' ;move letter E to accumulator-13
call data_wrt
mov a,#'C' ;move letter C to accumulator-14
call data_wrt
mov a,#'T' ;move letter T to accumulator-15
call data_wrt
ret
lecturer:
mov a,#80h ;force cursor to the beginning of the first line
call cmd_wrt
mov a,#'L' ;move letter L to accumulator-1
call data_wrt
mov a,#'e' ;move letter e to accumulator-2
call data_wrt
mov a,#'c' ;move letter c to accumulator-3
call data_wrt
mov a,#'t' ;move letter t to accumulator-4
call data_wrt
mov a,#'u' ;move letter u to accumulator-5
call data_wrt
mov a,#'r' ;move letter r to accumulator-6
call data_wrt
mov a,#'e' ;move letter e to accumulator-7
call data_wrt
mov a,#'r' ;move letter r to accumulator-8
call data_wrt
mov a,#0c0h ;move cursor to second line position 1
call cmd_wrt
mov a,#'I' ;move letter I to accumulator-2
call data_wrt
mov a,#'n' ;move letter n to accumulator-3
call data_wrt
mov a,#'c' ;move letter c to accumulator-4
call data_wrt
mov a,#'h' ;move letter l to accumulator-5
call data_wrt
mov a,#'a' ;move letter u to accumulator-6
call data_wrt
mov a,#'r' ;move letter d to accumulator-7
call data_wrt
mov a,#'g' ;move letter e to accumulator-8
call data_wrt
mov a,#'e' ;move letter e to accumulator-9
call data_wrt
mov a,#':' ;move the colon character to accumulator-10
call data_wrt
call clearscreen
mov a,#80h ;force cursor to the beginning of the first line
call cmd_wrt
mov a,#'E' ;move letter E to accumulator-1
call data_wrt
mov a,#'n' ;move letter n to accumulator-2
call data_wrt
mov a,#'g' ;move letter g to accumulator-3
call data_wrt
mov a,#'r' ;move letter r to accumulator-4
call data_wrt
mov a,#'.' ;move character . to accumulator-5
call data_wrt
mov a,#0c0h ;move cursor to second line position 1
call cmd_wrt
mov a,#'A' ;move letter A to accumulator-2
call data_wrt
mov a,#'z' ;move letter z to accumulator-3
call data_wrt
mov a,#'u' ;move letter u to accumulator-4
call data_wrt
mov a,#'b' ;move letter b to accumulator-5
call data_wrt
mov a,#'i' ;move letter i to accumulator-6
call data_wrt
mov a,#'k' ;move letter k to accumulator-7
call data_wrt
mov a,#'e' ;move letter e to accumulator-8
call data_wrt
mov a,#' ' ;move space character to accumulator-9
call data_wrt
mov a,#'A' ;move letter A to accumulator-10
call data_wrt
mov a,#'n' ;move letter n to accumulator-11
call data_wrt
mov a,#'i' ;move letter i to accumulator-12
call data_wrt
mov a,#'e' ;move letter e to accumulator-13
call data_wrt
mov a,#'d' ;move letter d to accumulator-14
call data_wrt
mov a,#'u' ;move letter u to accumulator-15
call data_wrt
ret
endline:
mov a,#80h ;force cursor to the beginning of the first line
call cmd_wrt
mov a,#'T' ;move letter T to accumulator-1
call data_wrt
mov a,#'H' ;move letter H to accumulator-2
call data_wrt
mov a,#'A' ;move letter A to accumulator-3
call data_wrt
mov a,#'N' ;move letter N to accumulator-4
call data_wrt
mov a,#'K' ;move letter K to accumulator-5
call data_wrt
mov a,#' ' ;move space character to accumulator-6
call data_wrt
mov a,#'Y' ;move letter Y to accumulator-7
call data_wrt
mov a,#'O' ;move letter O to accumulator-8
call data_wrt
mov a,#'U' ;move letter U to accumulator-9
call data_wrt
mov a,#'!' ;move character ! to accumulator-7
call data_wrt
mov a,#'!' ;move character ! to accumulator-8
call data_wrt
mov a,#'!' ;move character ! to accumulator-9
call data_wrt
ret
first_name:
mov a,#80h ;force cursor to the beginning of the first line
call cmd_wrt
mov a,#'M' ;move letter M to accumulator-1
call data_wrt
mov a,#'o' ;move letter o to accumulator-2
call data_wrt
mov a,#'m' ;move letter m to accumulator-3
call data_wrt
mov a,#'a' ;move letter a to accumulator-4
call data_wrt
mov a,#'h' ;move letter h to accumulator-5
call data_wrt
mov a,#' ' ;move space character to accumulator-6
call data_wrt
mov a,#'O' ;move letter O to accumulator-7
call data_wrt
mov a,#'b' ;move letter b to accumulator-8
call data_wrt
mov a,#'i' ;move letter i to accumulator-9
call data_wrt
mov a,#'n' ;move letter n to accumulator-10
call data_wrt
mov a,#'n' ;move letter n to accumulator-11
call data_wrt
mov a,#'a' ;move letter a to accumulator-12
call data_wrt
mov a,#' ' ;move space character to accumulator-13
call data_wrt
mov a,#'G' ;move letter S to accumulator-14
call data_wrt
mov a,#'.' ;move the full-stop character to accumulator-15
call data_wrt
mov a,#0c0h ;move cursor to second line position 1
call cmd_wrt
mov a,#'2' ;move number 2 to accumulator-1
call data_wrt
mov a,#'0' ;move number 0 to accumulator-2
call data_wrt
mov a,#'1' ;move number 1 to accumulator-3
call data_wrt
mov a,#'1' ;move number 1 to accumulator-4
call data_wrt
mov a,#'3' ;move number 3 to accumulator-5
call data_wrt
mov a,#'6' ;move number 6 to accumulator-6
call data_wrt
mov a,#'4' ;move number 4 to accumulator-7
call data_wrt
mov a,#'0' ;move number 0 to accumulator-8
call data_wrt
mov a,#'0' ;move number 0 to accumulator-9
call data_wrt
mov a,#'9' ;move number 9 to accumulator-10
call data_wrt
ret
clearscreen:
call slow_delay
mov a,#01h ;clear screen of the lcd
call cmd_wrt_2
ret
data_wrt:
mov p1,a ;move contents of the accumulator to port P1
setb RS ;set bit on RS to enable data mode on the LCD
clr RW ;clear bit on RW to enable write mode on the LCD
setb e ;setb bit on e to start the engaging transition
call delay_wrt
clr e ;clear bit on e to end the engaging transitioin
ret
cmd_wrt:
mov p1,a ;move contents of the accumulator to port P1
clr RS ;clear bit on RS to enable command mode on the LCD
clr RW ;clear bit on RW to enable write mode on the LCD
setb e ;setb bit on e to start the engaging transition
call delay_wrt
clr e ;clear bit on e to end the engaging transitioin
ret
cmd_wrt_2:
mov p1,a ;move contents of the accumulator to port P1
clr RS ;clear bit on RS to enable command mode on the LCD
clr RW ;clear bit on RW to enable write mode on the LCD
setb e ;setb bit on e to start the engaging transition
call delay_clr
clr e ;clear bit on e to end the engaging transitioin
ret
delay_wrt:
Mov R1,#139
Mov R2,#195
MEG:
Djnz R1,MEG
Djnz R2,MEG
ret
delay_clr:
Mov R1,#114
Mov R2,#20
MEG_1:
Djnz R1,MEG_1
Djnz R2,MEG_1
ret
slow_delay:
Mov R1,#124
Mov R2,#154
Mov R3,#8
MEG_2:
Djnz R1,MEG_2
Djnz R2,MEG_2
Djnz R3,MEG_2
ret
end | 27.132258 | 66 | 0.718404 | [
"MIT"
] | kosmaz/Assembly | project_V/ECE421_group_project.asm | 16,822 | Assembly |
; A094125: a(n) = 3*2^n + 2*3^n.
; 5,12,30,78,210,582,1650,4758,13890,40902,121170,360438,1075170,3213222,9615090,28796118,86290050,258673542,775627410,2326095798,6976714530,20926997862,62774702130,188311523478,564909404610,1694677882182,5083932983250,15251597623158
mov $1,5
mov $2,2
lpb $0
sub $0,1
mul $1,2
add $1,$2
mov $3,$2
mul $2,2
add $3,$2
mov $2,$3
lpe
mov $0,$1
| 24.25 | 233 | 0.71134 | [
"Apache-2.0"
] | ckrause/cm | programs/oeis/094/A094125.asm | 388 | Assembly |
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_D_ht+0x4822, %rdx
nop
nop
nop
nop
xor %rsi, %rsi
movl $0x61626364, (%rdx)
nop
nop
nop
nop
and $45594, %r12
lea addresses_D_ht+0x9a22, %rsi
nop
add %r12, %r12
mov (%rsi), %ebx
nop
nop
nop
nop
nop
cmp %rdx, %rdx
lea addresses_A_ht+0x12a82, %rsi
lea addresses_D_ht+0x17522, %rdi
inc %rdx
mov $40, %rcx
rep movsq
nop
cmp %rdi, %rdi
lea addresses_A_ht+0x1b122, %rcx
nop
nop
nop
nop
xor $54569, %r11
movups (%rcx), %xmm2
vpextrq $0, %xmm2, %rbx
nop
nop
nop
sub $6473, %rsi
lea addresses_WT_ht+0x18eb2, %rsi
nop
add %rdx, %rdx
mov (%rsi), %rbx
nop
nop
dec %rdx
lea addresses_UC_ht+0x1bc22, %rdi
nop
cmp $24002, %r11
mov (%rdi), %edx
nop
nop
nop
nop
nop
cmp %rbx, %rbx
lea addresses_D_ht+0x14af2, %rdi
nop
nop
nop
and %rdx, %rdx
mov (%rdi), %r11
nop
nop
nop
nop
nop
xor %r11, %r11
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r14
push %r9
push %rax
push %rbp
push %rcx
push %rsi
// Store
mov $0x5fc2680000000166, %rsi
nop
nop
inc %r12
movl $0x51525354, (%rsi)
nop
nop
cmp %rbp, %rbp
// Load
lea addresses_RW+0x1ee22, %r14
clflush (%r14)
cmp %r9, %r9
mov (%r14), %eax
nop
nop
nop
xor %rax, %rax
// Faulty Load
lea addresses_RW+0x1ee22, %rsi
clflush (%rsi)
nop
nop
nop
nop
nop
add %r9, %r9
movups (%rsi), %xmm4
vpextrq $0, %xmm4, %rcx
lea oracles, %rbp
and $0xff, %rcx
shlq $12, %rcx
mov (%rbp,%rcx,1), %rcx
pop %rsi
pop %rcx
pop %rbp
pop %rax
pop %r9
pop %r14
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_RW', 'congruent': 0}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_NC', 'congruent': 2}, 'OP': 'STOR'}
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_RW', 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_RW', 'congruent': 0}}
<gen_prepare_buffer>
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_D_ht', 'congruent': 8}, 'OP': 'STOR'}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_D_ht', 'congruent': 10}}
{'dst': {'same': False, 'congruent': 7, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'src': {'same': True, 'congruent': 3, 'type': 'addresses_A_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_A_ht', 'congruent': 8}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_WT_ht', 'congruent': 4}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_UC_ht', 'congruent': 9}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_D_ht', 'congruent': 4}}
{'32': 40}
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
*/
| 19.462963 | 145 | 0.64066 | [
"MIT"
] | danielmgmi/medusa | Transynther/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_40_174.asm | 3,153 | Assembly |
BITS 32
section .text
foo:
in al, 9
in ax, 9
in eax, 9
in al, dx
in ax, dx
in eax, dx
out 9, al
out 9, ax
out 9, eax
out dx, al
out dx, ax
out dx, eax
int 128
pop cx
pop ecx
pop dword [ecx]
pop word [ecx]
pop ds
pop es
pop ss
pop fs
pop gs
push cx
push edx
push dword 100
push word 100
push byte 100
push word [esi]
push dword [esi]
push cs
push ds
push es
push ss
push fs
push gs
imul ax, bx, word 100
imul ax, [ebx], word 100
imul ax, bx, byte 100
imul ax, [ebx], byte 100
imul eax, ebx, dword 100
imul eax, [ebx], dword 100
imul eax, ebx, byte 100
imul eax, [ebx], byte 100
imul eax, dword 100
imul eax, byte 100
imul ax, word 100
imul ax, byte 100
imul ax, bx
imul ax, [ebx]
imul eax, ebx
imul eax, [ebx]
imul al
imul byte [eax]
imul ax
imul word [eax]
imul eax
imul dword [eax]
test al, 9
test ax, 9
test eax, 9
test bl, cl
test [ebx], cl
test bx, cx
test [ebx], cx
test ebx, ecx
test [ebx], ecx
test bl, 9
test dword [ebx], 9
test bx, 9
test word [ebx], 9
test ebx, 9
test byte [ebx], 9
mov bl, cl
mov [edx], cl
mov bx, dx
mov [esi], dx
mov ebx, edi
mov [eax], edi
mov bl, cl
mov bl, [edx]
mov bx, dx
mov bx, [esi]
mov ebx, edi
mov ebx, [eax]
mov bl, 9
mov bx, 9
mov ebx, 9
mov [edx], byte 9
mov [esi], word 9
mov [eax], dword 9
mov al, [dword 9]
mov ax, [dword 9]
mov eax, [dword 9]
mov [dword 9], al
mov [dword 9], ax
mov [dword 9], eax
mov bx, ds
mov [esi], ss
mov ebx, fs
mov [eax], es
mov gs, dx
mov ds, [esi]
mov fs, edi
mov ss, [eax]
mov ecx, cr2
mov ecx, dr1
mov cr0, edx
mov dr0, edx
mov ecx, tr3
mov tr7, edx
| 13.377193 | 26 | 0.662295 | [
"MIT"
] | carld/sassy | tests/misc2.asm | 1,525 | Assembly |
; A004355: Binomial coefficient C(6n,n).
; 1,6,66,816,10626,142506,1947792,26978328,377348994,5317936260,75394027566,1074082795968,15363284301456,220495674290430,3173734438530120,45795673964460816,662252084388541314,9595194602380819740,139258480300974996780,2024174282713371059040,29462227291176635718126,429355892934236539294650,6264034568006128435579200,91481429602429444747540800,1337261858854117218288723600,19564640595300216439731236256,286464105239522657724633899466,4197452106274224038589840678816,61545394218773094313027410319176,902982026215477716384440058705756,13256166154299679213044725041407792,194713206296950216839666794393356704
mov $1,6
mul $1,$0
bin $1,$0
mov $0,$1
| 85.625 | 603 | 0.905109 | [
"Apache-2.0"
] | ckrause/cm | programs/oeis/004/A004355.asm | 685 | Assembly |
// Tests calling into a function pointer with local variables
// Commodore 64 PRG executable file
.file [name="function-pointer-noarg-call-7.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(__start)
.label SCREEN = $400
.label idx = 2
.segment Code
__start: {
// volatile byte idx = 0
lda #0
sta.z idx
jsr main
rts
}
hello: {
ldx #0
__b1:
// SCREEN[idx++] = msg[i++]
lda msg,x
ldy.z idx
sta SCREEN,y
// SCREEN[idx++] = msg[i++];
inc.z idx
inx
// while(msg[i])
lda msg,x
cmp #0
bne __b1
// }
rts
}
main: {
// do10(f)
jsr do10
// }
rts
}
// void do10(void (*fn)())
do10: {
.label i = 3
lda #0
sta.z i
__b1:
// (*fn)()
jsr hello
// for( byte i: 0..9)
inc.z i
lda #$a
cmp.z i
bne __b1
// }
rts
}
.segment Data
msg: .text "hello "
.byte 0
| 17.032258 | 80 | 0.557765 | [
"MIT"
] | jbrandwood/kickc | src/test/ref/function-pointer-noarg-call-7.asm | 1,056 | Assembly |
; A028495: Expansion of (1-x^2)/(1-x-2*x^2+x^3).
; 1,1,2,3,6,10,19,33,61,108,197,352,638,1145,2069,3721,6714,12087,21794,39254,70755,127469,229725,413908,745889,1343980,2421850,4363921,7863641,14169633,25532994,46008619,82904974,149389218,269190547,485064009,874055885,1574993356,2838041117,5113971944,9215060822,16604963593,29921113293,53915979657,97153242650,175064088671,315454594314,568429529006,1024274628963,1845679092661,3325798821581,5992882377940,10798800928441,19458766862740,35063486341682,63182219138721,113850424959345,205151376895105,369670007675074,666122336505939,1200310974960982,2162885640297786,3897385253713811,7022845559348401
mov $1,1
lpb $0
sub $0,1
mov $2,$3
add $4,$1
add $1,$3
mov $3,$4
mov $4,$2
lpe
| 56.923077 | 598 | 0.814865 | [
"Apache-2.0"
] | jmorken/loda | programs/oeis/028/A028495.asm | 740 | Assembly |
; A184653: floor(n*s+h-h*s), where s=(3+sqrt(3))/2, h=-1/2; complement of A184638.
; 3,5,7,10,12,14,17,19,21,24,26,29,31,33,36,38,40,43,45,48,50,52,55,57,59,62,64,66,69,71,74,76,78,81,83,85,88,90,92,95,97,100,102,104,107,109,111,114,116,118,121,123,126,128,130,133,135,137,140,142,145,147,149,152,154,156,159,161,163,166,168,171,173,175,178,180,182,185,187,189,192,194,197,199,201,204,206,208,211,213,215,218,220,223,225,227,230
mov $3,$0
add $3,1
mov $7,$0
lpb $3
mov $0,$7
sub $3,1
sub $0,$3
mov $10,2
mov $11,$0
lpb $10
sub $10,1
add $0,$10
sub $0,1
mov $2,$0
mov $6,1
lpb $2
sub $5,1
lpb $6
add $6,2
mov $5,$6
trn $6,$2
lpe
sub $2,1
add $5,31
lpe
mov $4,$5
div $4,82
mov $5,$4
mov $9,$10
lpb $9
mov $8,$5
sub $9,1
lpe
lpe
lpb $11
sub $8,$5
mov $11,0
lpe
mov $5,$8
add $5,2
add $1,$5
lpe
add $1,1
| 20.234043 | 345 | 0.532072 | [
"Apache-2.0"
] | jmorken/loda | programs/oeis/184/A184653.asm | 951 | Assembly |
Entity start
No options
Constants
0 S start
1 S MeuGrupo
2 S Alex
3 S Inserindo informacoes
4 I 1
5 S io.writeln
6 S Numero 1
7 S 1
8 S 2
9 I 2
10 S Informacoes inseridas:
End
Valid context (always)
No properties
Def start
No parameters
No local variables
No results
ldconst 1 --> [MeuGrupo]
ldconst 2 --> [Alex]
bindg
ldconst 3 --> [Inserindo informacoes]
ldconst 4 --> [1]
lcall 5 --> [io.writeln]
ldconst 1 --> [MeuGrupo]
ldconst 6 --> [Numero 1]
ldconst 7 --> [1]
ldconst 8 --> [2]
ldconst 4 --> [1]
ldconst 9 --> [2]
dataaf
ldconst 10 --> [Informacoes inseridas: ]
ldconst 1 --> [MeuGrupo]
ldconst 6 --> [Numero 1]
ldconst 4 --> [1]
datadqu
ldconst 9 --> [2]
lcall 5 --> [io.writeln]
stop
End
End
| 17.333333 | 42 | 0.608974 | [
"MIT"
] | alexgarzao/UOP | testsuite/ubivm/expected/group_2.asm | 780 | Assembly |
; A192251: 1-sequence of reduction of central binomial coefficient sequence by x^2 -> x+1.
; 0,2,8,48,258,1518,8910,53526,323796,1976876,12138456,74921904,464320368,2887660168,18011618368,112633305568,705899650498,4432668783838,27882818399038,175661366346838,1108193133814138,6999963827434378,44265660573879298
lpb $0
mov $2,$0
sub $0,1
seq $2,119692 ; Binomial(2*n,n)*fib(n).
add $1,$2
lpe
mov $0,$1
| 37.272727 | 219 | 0.770732 | [
"Apache-2.0"
] | ckrause/cm | programs/oeis/192/A192251.asm | 410 | Assembly |
f:
PUSH %14
MOV %15,%14
SUBS %15,$4,%15
SUBS %15,$4,%15
@f_body:
MOV $1,-4(%14)
MOV $3,-8(%14)
ADDS -4(%14),-8(%14),%0
MOV %0,%13
JMP @f_exit
@f_exit:
MOV %14,%15
POP %14
RET
main:
PUSH %14
MOV %15,%14
@main_body:
CALL f
ADDS %15,$0,%15
MOV %13,%0
MOV %0,%13
JMP @main_exit
@main_exit:
MOV %14,%15
POP %14
RET | 12.655172 | 25 | 0.509537 | [
"MIT"
] | acastrauss/compiler_project | test-ok-NAS-88.asm | 367 | Assembly |
; A291582: Maximum number of 6 sphinx tile shapes in a sphinx tiled hexagon of order n.
; 30,132,306,552,870,1260,1722,2256,2862,3540,4290,5112,6006,6972,8010,9120,10302,11556,12882,14280,15750,17292,18906,20592,22350,24180,26082,28056,30102,32220,34410,36672,39006,41412,43890,46440,49062,51756,54522,57360,60270,63252,66306,69432,72630,75900,79242,82656,86142,89700,93330,97032,100806,104652,108570,112560,116622,120756,124962,129240,133590,138012,142506,147072,151710,156420,161202,166056,170982,175980,181050,186192,191406,196692,202050,207480,212982,218556,224202,229920,235710,241572,247506,253512,259590,265740,271962,278256,284622,291060,297570,304152,310806,317532,324330,331200,338142,345156,352242,359400
add $0,1
mul $0,6
bin $0,2
mul $0,2
| 94.125 | 627 | 0.815405 | [
"Apache-2.0"
] | ckrause/cm | programs/oeis/291/A291582.asm | 753 | Assembly |
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r15
push %rax
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x2f58, %rsi
lea addresses_WT_ht+0x8198, %rdi
nop
nop
dec %rbx
mov $124, %rcx
rep movsw
nop
xor $17283, %rax
lea addresses_normal_ht+0x1cc08, %r15
nop
cmp %r10, %r10
movl $0x61626364, (%r15)
nop
nop
nop
nop
nop
add $34757, %r10
lea addresses_WT_ht+0x9218, %rsi
lea addresses_A_ht+0x1ebd8, %rdi
nop
nop
nop
sub %r10, %r10
mov $96, %rcx
rep movsl
nop
inc %rdi
lea addresses_A_ht+0x6d24, %rsi
lea addresses_A_ht+0x241e, %rdi
nop
and %r12, %r12
mov $66, %rcx
rep movsw
nop
nop
inc %r12
lea addresses_D_ht+0x11718, %rbx
nop
nop
nop
nop
nop
xor %rsi, %rsi
vmovups (%rbx), %ymm6
vextracti128 $0, %ymm6, %xmm6
vpextrq $0, %xmm6, %rdi
nop
nop
and %rdi, %rdi
lea addresses_D_ht+0xb98, %rsi
lea addresses_A_ht+0xd9e8, %rdi
nop
nop
nop
nop
and %r12, %r12
mov $68, %rcx
rep movsb
nop
nop
nop
nop
sub %rbx, %rbx
lea addresses_A_ht+0x5398, %rsi
lea addresses_normal_ht+0x9218, %rdi
nop
nop
cmp %rbx, %rbx
mov $66, %rcx
rep movsl
nop
nop
nop
xor %rdi, %rdi
lea addresses_WC_ht+0x1daf8, %rsi
lea addresses_UC_ht+0xf050, %rdi
nop
nop
nop
nop
add $6779, %r12
mov $10, %rcx
rep movsb
nop
nop
cmp %rsi, %rsi
lea addresses_normal_ht+0x15a18, %rsi
lea addresses_normal_ht+0x1b518, %rdi
nop
nop
nop
cmp $50249, %r12
mov $77, %rcx
rep movsl
nop
nop
nop
nop
nop
add %rdi, %rdi
lea addresses_UC_ht+0x1ece3, %rsi
lea addresses_WT_ht+0xcae8, %rdi
dec %r10
mov $121, %rcx
rep movsb
cmp $32160, %r10
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r15
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r13
push %r14
push %r8
push %rbx
push %rdx
// Load
lea addresses_A+0x3da0, %rbx
clflush (%rbx)
nop
nop
cmp $15783, %rdx
mov (%rbx), %r12w
nop
sub %rbx, %rbx
// Faulty Load
lea addresses_D+0x14b98, %r12
nop
nop
cmp %r10, %r10
mov (%r12), %ebx
lea oracles, %r10
and $0xff, %rbx
shlq $12, %rbx
mov (%r10,%rbx,1), %rbx
pop %rdx
pop %rbx
pop %r8
pop %r14
pop %r13
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_D', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 2}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_D', 'AVXalign': True, 'size': 4, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 6, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 3}}
{'src': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 5, 'same': False}}
{'src': {'type': 'addresses_A_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 1, 'same': False}}
{'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 6}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_D_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 4, 'same': False}}
{'src': {'type': 'addresses_A_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}}
{'src': {'type': 'addresses_WC_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 2, 'same': True}}
{'src': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': True}}
{'src': {'type': 'addresses_UC_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 2, 'same': False}}
{'36': 21829}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
| 36.730159 | 2,999 | 0.662057 | [
"MIT"
] | danielmgmi/medusa | Transynther/_processed/AVXALIGN/_st_/i9-9900K_12_0xa0_notsx.log_21829_1200.asm | 6,942 | Assembly |
; A170680: Number of reduced words of length n in Coxeter group on 47 generators S_i with relations (S_i)^2 = (S_i S_j)^49 = I.
; 1,47,2162,99452,4574792,210440432,9680259872,445291954112,20483429889152,942237774900992,43342937645445632,1993775131690499072,91713656057762957312,4218828178657096036352,194066096218226417672192
add $0,1
mov $3,1
lpb $0
sub $0,1
add $2,$3
div $3,$2
mul $2,46
lpe
mov $0,$2
div $0,46
| 30.214286 | 197 | 0.763593 | [
"Apache-2.0"
] | ckrause/loda-programs | oeis/170/A170680.asm | 423 | Assembly |
TITLE sha1-586.asm
IF @Version LT 800
ECHO MASM version 8.00 or later is strongly recommended.
ENDIF
.686
.XMM
IF @Version LT 800
XMMWORD STRUCT 16
DQ 2 dup (?)
XMMWORD ENDS
ENDIF
.MODEL FLAT
OPTION DOTNAME
IF @Version LT 800
.text$ SEGMENT PAGE 'CODE'
ELSE
.text$ SEGMENT ALIGN(64) 'CODE'
ENDIF
;EXTERN _OPENSSL_ia32cap_P:NEAR
ALIGN 16
_sha1_block_data_order PROC PUBLIC
$L_sha1_block_data_order_begin::
push ebp
push ebx
push esi
push edi
call $L000pic_point
$L000pic_point:
pop ebp
lea esi,DWORD PTR _OPENSSL_ia32cap_P
lea ebp,DWORD PTR ($LK_XX_XX-$L000pic_point)[ebp]
mov eax,DWORD PTR [esi]
mov edx,DWORD PTR 4[esi]
test edx,512
jz $L001x86
mov ecx,DWORD PTR 8[esi]
test eax,16777216
jz $L001x86
test ecx,536870912
jnz $Lshaext_shortcut
jmp $Lssse3_shortcut
ALIGN 16
$L001x86:
mov ebp,DWORD PTR 20[esp]
mov esi,DWORD PTR 24[esp]
mov eax,DWORD PTR 28[esp]
sub esp,76
shl eax,6
add eax,esi
mov DWORD PTR 104[esp],eax
mov edi,DWORD PTR 16[ebp]
jmp $L002loop
ALIGN 16
$L002loop:
mov eax,DWORD PTR [esi]
mov ebx,DWORD PTR 4[esi]
mov ecx,DWORD PTR 8[esi]
mov edx,DWORD PTR 12[esi]
bswap eax
bswap ebx
bswap ecx
bswap edx
mov DWORD PTR [esp],eax
mov DWORD PTR 4[esp],ebx
mov DWORD PTR 8[esp],ecx
mov DWORD PTR 12[esp],edx
mov eax,DWORD PTR 16[esi]
mov ebx,DWORD PTR 20[esi]
mov ecx,DWORD PTR 24[esi]
mov edx,DWORD PTR 28[esi]
bswap eax
bswap ebx
bswap ecx
bswap edx
mov DWORD PTR 16[esp],eax
mov DWORD PTR 20[esp],ebx
mov DWORD PTR 24[esp],ecx
mov DWORD PTR 28[esp],edx
mov eax,DWORD PTR 32[esi]
mov ebx,DWORD PTR 36[esi]
mov ecx,DWORD PTR 40[esi]
mov edx,DWORD PTR 44[esi]
bswap eax
bswap ebx
bswap ecx
bswap edx
mov DWORD PTR 32[esp],eax
mov DWORD PTR 36[esp],ebx
mov DWORD PTR 40[esp],ecx
mov DWORD PTR 44[esp],edx
mov eax,DWORD PTR 48[esi]
mov ebx,DWORD PTR 52[esi]
mov ecx,DWORD PTR 56[esi]
mov edx,DWORD PTR 60[esi]
bswap eax
bswap ebx
bswap ecx
bswap edx
mov DWORD PTR 48[esp],eax
mov DWORD PTR 52[esp],ebx
mov DWORD PTR 56[esp],ecx
mov DWORD PTR 60[esp],edx
mov DWORD PTR 100[esp],esi
mov eax,DWORD PTR [ebp]
mov ebx,DWORD PTR 4[ebp]
mov ecx,DWORD PTR 8[ebp]
mov edx,DWORD PTR 12[ebp]
; 00_15 0
mov esi,ecx
mov ebp,eax
rol ebp,5
xor esi,edx
add ebp,edi
mov edi,DWORD PTR [esp]
and esi,ebx
ror ebx,2
xor esi,edx
lea ebp,DWORD PTR 1518500249[edi*1+ebp]
add ebp,esi
; 00_15 1
mov edi,ebx
mov esi,ebp
rol ebp,5
xor edi,ecx
add ebp,edx
mov edx,DWORD PTR 4[esp]
and edi,eax
ror eax,2
xor edi,ecx
lea ebp,DWORD PTR 1518500249[edx*1+ebp]
add ebp,edi
; 00_15 2
mov edx,eax
mov edi,ebp
rol ebp,5
xor edx,ebx
add ebp,ecx
mov ecx,DWORD PTR 8[esp]
and edx,esi
ror esi,2
xor edx,ebx
lea ebp,DWORD PTR 1518500249[ecx*1+ebp]
add ebp,edx
; 00_15 3
mov ecx,esi
mov edx,ebp
rol ebp,5
xor ecx,eax
add ebp,ebx
mov ebx,DWORD PTR 12[esp]
and ecx,edi
ror edi,2
xor ecx,eax
lea ebp,DWORD PTR 1518500249[ebx*1+ebp]
add ebp,ecx
; 00_15 4
mov ebx,edi
mov ecx,ebp
rol ebp,5
xor ebx,esi
add ebp,eax
mov eax,DWORD PTR 16[esp]
and ebx,edx
ror edx,2
xor ebx,esi
lea ebp,DWORD PTR 1518500249[eax*1+ebp]
add ebp,ebx
; 00_15 5
mov eax,edx
mov ebx,ebp
rol ebp,5
xor eax,edi
add ebp,esi
mov esi,DWORD PTR 20[esp]
and eax,ecx
ror ecx,2
xor eax,edi
lea ebp,DWORD PTR 1518500249[esi*1+ebp]
add ebp,eax
; 00_15 6
mov esi,ecx
mov eax,ebp
rol ebp,5
xor esi,edx
add ebp,edi
mov edi,DWORD PTR 24[esp]
and esi,ebx
ror ebx,2
xor esi,edx
lea ebp,DWORD PTR 1518500249[edi*1+ebp]
add ebp,esi
; 00_15 7
mov edi,ebx
mov esi,ebp
rol ebp,5
xor edi,ecx
add ebp,edx
mov edx,DWORD PTR 28[esp]
and edi,eax
ror eax,2
xor edi,ecx
lea ebp,DWORD PTR 1518500249[edx*1+ebp]
add ebp,edi
; 00_15 8
mov edx,eax
mov edi,ebp
rol ebp,5
xor edx,ebx
add ebp,ecx
mov ecx,DWORD PTR 32[esp]
and edx,esi
ror esi,2
xor edx,ebx
lea ebp,DWORD PTR 1518500249[ecx*1+ebp]
add ebp,edx
; 00_15 9
mov ecx,esi
mov edx,ebp
rol ebp,5
xor ecx,eax
add ebp,ebx
mov ebx,DWORD PTR 36[esp]
and ecx,edi
ror edi,2
xor ecx,eax
lea ebp,DWORD PTR 1518500249[ebx*1+ebp]
add ebp,ecx
; 00_15 10
mov ebx,edi
mov ecx,ebp
rol ebp,5
xor ebx,esi
add ebp,eax
mov eax,DWORD PTR 40[esp]
and ebx,edx
ror edx,2
xor ebx,esi
lea ebp,DWORD PTR 1518500249[eax*1+ebp]
add ebp,ebx
; 00_15 11
mov eax,edx
mov ebx,ebp
rol ebp,5
xor eax,edi
add ebp,esi
mov esi,DWORD PTR 44[esp]
and eax,ecx
ror ecx,2
xor eax,edi
lea ebp,DWORD PTR 1518500249[esi*1+ebp]
add ebp,eax
; 00_15 12
mov esi,ecx
mov eax,ebp
rol ebp,5
xor esi,edx
add ebp,edi
mov edi,DWORD PTR 48[esp]
and esi,ebx
ror ebx,2
xor esi,edx
lea ebp,DWORD PTR 1518500249[edi*1+ebp]
add ebp,esi
; 00_15 13
mov edi,ebx
mov esi,ebp
rol ebp,5
xor edi,ecx
add ebp,edx
mov edx,DWORD PTR 52[esp]
and edi,eax
ror eax,2
xor edi,ecx
lea ebp,DWORD PTR 1518500249[edx*1+ebp]
add ebp,edi
; 00_15 14
mov edx,eax
mov edi,ebp
rol ebp,5
xor edx,ebx
add ebp,ecx
mov ecx,DWORD PTR 56[esp]
and edx,esi
ror esi,2
xor edx,ebx
lea ebp,DWORD PTR 1518500249[ecx*1+ebp]
add ebp,edx
; 00_15 15
mov ecx,esi
mov edx,ebp
rol ebp,5
xor ecx,eax
add ebp,ebx
mov ebx,DWORD PTR 60[esp]
and ecx,edi
ror edi,2
xor ecx,eax
lea ebp,DWORD PTR 1518500249[ebx*1+ebp]
mov ebx,DWORD PTR [esp]
add ecx,ebp
; 16_19 16
mov ebp,edi
xor ebx,DWORD PTR 8[esp]
xor ebp,esi
xor ebx,DWORD PTR 32[esp]
and ebp,edx
xor ebx,DWORD PTR 52[esp]
rol ebx,1
xor ebp,esi
add eax,ebp
mov ebp,ecx
ror edx,2
mov DWORD PTR [esp],ebx
rol ebp,5
lea ebx,DWORD PTR 1518500249[eax*1+ebx]
mov eax,DWORD PTR 4[esp]
add ebx,ebp
; 16_19 17
mov ebp,edx
xor eax,DWORD PTR 12[esp]
xor ebp,edi
xor eax,DWORD PTR 36[esp]
and ebp,ecx
xor eax,DWORD PTR 56[esp]
rol eax,1
xor ebp,edi
add esi,ebp
mov ebp,ebx
ror ecx,2
mov DWORD PTR 4[esp],eax
rol ebp,5
lea eax,DWORD PTR 1518500249[esi*1+eax]
mov esi,DWORD PTR 8[esp]
add eax,ebp
; 16_19 18
mov ebp,ecx
xor esi,DWORD PTR 16[esp]
xor ebp,edx
xor esi,DWORD PTR 40[esp]
and ebp,ebx
xor esi,DWORD PTR 60[esp]
rol esi,1
xor ebp,edx
add edi,ebp
mov ebp,eax
ror ebx,2
mov DWORD PTR 8[esp],esi
rol ebp,5
lea esi,DWORD PTR 1518500249[edi*1+esi]
mov edi,DWORD PTR 12[esp]
add esi,ebp
; 16_19 19
mov ebp,ebx
xor edi,DWORD PTR 20[esp]
xor ebp,ecx
xor edi,DWORD PTR 44[esp]
and ebp,eax
xor edi,DWORD PTR [esp]
rol edi,1
xor ebp,ecx
add edx,ebp
mov ebp,esi
ror eax,2
mov DWORD PTR 12[esp],edi
rol ebp,5
lea edi,DWORD PTR 1518500249[edx*1+edi]
mov edx,DWORD PTR 16[esp]
add edi,ebp
; 20_39 20
mov ebp,esi
xor edx,DWORD PTR 24[esp]
xor ebp,eax
xor edx,DWORD PTR 48[esp]
xor ebp,ebx
xor edx,DWORD PTR 4[esp]
rol edx,1
add ecx,ebp
ror esi,2
mov ebp,edi
rol ebp,5
mov DWORD PTR 16[esp],edx
lea edx,DWORD PTR 1859775393[ecx*1+edx]
mov ecx,DWORD PTR 20[esp]
add edx,ebp
; 20_39 21
mov ebp,edi
xor ecx,DWORD PTR 28[esp]
xor ebp,esi
xor ecx,DWORD PTR 52[esp]
xor ebp,eax
xor ecx,DWORD PTR 8[esp]
rol ecx,1
add ebx,ebp
ror edi,2
mov ebp,edx
rol ebp,5
mov DWORD PTR 20[esp],ecx
lea ecx,DWORD PTR 1859775393[ebx*1+ecx]
mov ebx,DWORD PTR 24[esp]
add ecx,ebp
; 20_39 22
mov ebp,edx
xor ebx,DWORD PTR 32[esp]
xor ebp,edi
xor ebx,DWORD PTR 56[esp]
xor ebp,esi
xor ebx,DWORD PTR 12[esp]
rol ebx,1
add eax,ebp
ror edx,2
mov ebp,ecx
rol ebp,5
mov DWORD PTR 24[esp],ebx
lea ebx,DWORD PTR 1859775393[eax*1+ebx]
mov eax,DWORD PTR 28[esp]
add ebx,ebp
; 20_39 23
mov ebp,ecx
xor eax,DWORD PTR 36[esp]
xor ebp,edx
xor eax,DWORD PTR 60[esp]
xor ebp,edi
xor eax,DWORD PTR 16[esp]
rol eax,1
add esi,ebp
ror ecx,2
mov ebp,ebx
rol ebp,5
mov DWORD PTR 28[esp],eax
lea eax,DWORD PTR 1859775393[esi*1+eax]
mov esi,DWORD PTR 32[esp]
add eax,ebp
; 20_39 24
mov ebp,ebx
xor esi,DWORD PTR 40[esp]
xor ebp,ecx
xor esi,DWORD PTR [esp]
xor ebp,edx
xor esi,DWORD PTR 20[esp]
rol esi,1
add edi,ebp
ror ebx,2
mov ebp,eax
rol ebp,5
mov DWORD PTR 32[esp],esi
lea esi,DWORD PTR 1859775393[edi*1+esi]
mov edi,DWORD PTR 36[esp]
add esi,ebp
; 20_39 25
mov ebp,eax
xor edi,DWORD PTR 44[esp]
xor ebp,ebx
xor edi,DWORD PTR 4[esp]
xor ebp,ecx
xor edi,DWORD PTR 24[esp]
rol edi,1
add edx,ebp
ror eax,2
mov ebp,esi
rol ebp,5
mov DWORD PTR 36[esp],edi
lea edi,DWORD PTR 1859775393[edx*1+edi]
mov edx,DWORD PTR 40[esp]
add edi,ebp
; 20_39 26
mov ebp,esi
xor edx,DWORD PTR 48[esp]
xor ebp,eax
xor edx,DWORD PTR 8[esp]
xor ebp,ebx
xor edx,DWORD PTR 28[esp]
rol edx,1
add ecx,ebp
ror esi,2
mov ebp,edi
rol ebp,5
mov DWORD PTR 40[esp],edx
lea edx,DWORD PTR 1859775393[ecx*1+edx]
mov ecx,DWORD PTR 44[esp]
add edx,ebp
; 20_39 27
mov ebp,edi
xor ecx,DWORD PTR 52[esp]
xor ebp,esi
xor ecx,DWORD PTR 12[esp]
xor ebp,eax
xor ecx,DWORD PTR 32[esp]
rol ecx,1
add ebx,ebp
ror edi,2
mov ebp,edx
rol ebp,5
mov DWORD PTR 44[esp],ecx
lea ecx,DWORD PTR 1859775393[ebx*1+ecx]
mov ebx,DWORD PTR 48[esp]
add ecx,ebp
; 20_39 28
mov ebp,edx
xor ebx,DWORD PTR 56[esp]
xor ebp,edi
xor ebx,DWORD PTR 16[esp]
xor ebp,esi
xor ebx,DWORD PTR 36[esp]
rol ebx,1
add eax,ebp
ror edx,2
mov ebp,ecx
rol ebp,5
mov DWORD PTR 48[esp],ebx
lea ebx,DWORD PTR 1859775393[eax*1+ebx]
mov eax,DWORD PTR 52[esp]
add ebx,ebp
; 20_39 29
mov ebp,ecx
xor eax,DWORD PTR 60[esp]
xor ebp,edx
xor eax,DWORD PTR 20[esp]
xor ebp,edi
xor eax,DWORD PTR 40[esp]
rol eax,1
add esi,ebp
ror ecx,2
mov ebp,ebx
rol ebp,5
mov DWORD PTR 52[esp],eax
lea eax,DWORD PTR 1859775393[esi*1+eax]
mov esi,DWORD PTR 56[esp]
add eax,ebp
; 20_39 30
mov ebp,ebx
xor esi,DWORD PTR [esp]
xor ebp,ecx
xor esi,DWORD PTR 24[esp]
xor ebp,edx
xor esi,DWORD PTR 44[esp]
rol esi,1
add edi,ebp
ror ebx,2
mov ebp,eax
rol ebp,5
mov DWORD PTR 56[esp],esi
lea esi,DWORD PTR 1859775393[edi*1+esi]
mov edi,DWORD PTR 60[esp]
add esi,ebp
; 20_39 31
mov ebp,eax
xor edi,DWORD PTR 4[esp]
xor ebp,ebx
xor edi,DWORD PTR 28[esp]
xor ebp,ecx
xor edi,DWORD PTR 48[esp]
rol edi,1
add edx,ebp
ror eax,2
mov ebp,esi
rol ebp,5
mov DWORD PTR 60[esp],edi
lea edi,DWORD PTR 1859775393[edx*1+edi]
mov edx,DWORD PTR [esp]
add edi,ebp
; 20_39 32
mov ebp,esi
xor edx,DWORD PTR 8[esp]
xor ebp,eax
xor edx,DWORD PTR 32[esp]
xor ebp,ebx
xor edx,DWORD PTR 52[esp]
rol edx,1
add ecx,ebp
ror esi,2
mov ebp,edi
rol ebp,5
mov DWORD PTR [esp],edx
lea edx,DWORD PTR 1859775393[ecx*1+edx]
mov ecx,DWORD PTR 4[esp]
add edx,ebp
; 20_39 33
mov ebp,edi
xor ecx,DWORD PTR 12[esp]
xor ebp,esi
xor ecx,DWORD PTR 36[esp]
xor ebp,eax
xor ecx,DWORD PTR 56[esp]
rol ecx,1
add ebx,ebp
ror edi,2
mov ebp,edx
rol ebp,5
mov DWORD PTR 4[esp],ecx
lea ecx,DWORD PTR 1859775393[ebx*1+ecx]
mov ebx,DWORD PTR 8[esp]
add ecx,ebp
; 20_39 34
mov ebp,edx
xor ebx,DWORD PTR 16[esp]
xor ebp,edi
xor ebx,DWORD PTR 40[esp]
xor ebp,esi
xor ebx,DWORD PTR 60[esp]
rol ebx,1
add eax,ebp
ror edx,2
mov ebp,ecx
rol ebp,5
mov DWORD PTR 8[esp],ebx
lea ebx,DWORD PTR 1859775393[eax*1+ebx]
mov eax,DWORD PTR 12[esp]
add ebx,ebp
; 20_39 35
mov ebp,ecx
xor eax,DWORD PTR 20[esp]
xor ebp,edx
xor eax,DWORD PTR 44[esp]
xor ebp,edi
xor eax,DWORD PTR [esp]
rol eax,1
add esi,ebp
ror ecx,2
mov ebp,ebx
rol ebp,5
mov DWORD PTR 12[esp],eax
lea eax,DWORD PTR 1859775393[esi*1+eax]
mov esi,DWORD PTR 16[esp]
add eax,ebp
; 20_39 36
mov ebp,ebx
xor esi,DWORD PTR 24[esp]
xor ebp,ecx
xor esi,DWORD PTR 48[esp]
xor ebp,edx
xor esi,DWORD PTR 4[esp]
rol esi,1
add edi,ebp
ror ebx,2
mov ebp,eax
rol ebp,5
mov DWORD PTR 16[esp],esi
lea esi,DWORD PTR 1859775393[edi*1+esi]
mov edi,DWORD PTR 20[esp]
add esi,ebp
; 20_39 37
mov ebp,eax
xor edi,DWORD PTR 28[esp]
xor ebp,ebx
xor edi,DWORD PTR 52[esp]
xor ebp,ecx
xor edi,DWORD PTR 8[esp]
rol edi,1
add edx,ebp
ror eax,2
mov ebp,esi
rol ebp,5
mov DWORD PTR 20[esp],edi
lea edi,DWORD PTR 1859775393[edx*1+edi]
mov edx,DWORD PTR 24[esp]
add edi,ebp
; 20_39 38
mov ebp,esi
xor edx,DWORD PTR 32[esp]
xor ebp,eax
xor edx,DWORD PTR 56[esp]
xor ebp,ebx
xor edx,DWORD PTR 12[esp]
rol edx,1
add ecx,ebp
ror esi,2
mov ebp,edi
rol ebp,5
mov DWORD PTR 24[esp],edx
lea edx,DWORD PTR 1859775393[ecx*1+edx]
mov ecx,DWORD PTR 28[esp]
add edx,ebp
; 20_39 39
mov ebp,edi
xor ecx,DWORD PTR 36[esp]
xor ebp,esi
xor ecx,DWORD PTR 60[esp]
xor ebp,eax
xor ecx,DWORD PTR 16[esp]
rol ecx,1
add ebx,ebp
ror edi,2
mov ebp,edx
rol ebp,5
mov DWORD PTR 28[esp],ecx
lea ecx,DWORD PTR 1859775393[ebx*1+ecx]
mov ebx,DWORD PTR 32[esp]
add ecx,ebp
; 40_59 40
mov ebp,edi
xor ebx,DWORD PTR 40[esp]
xor ebp,esi
xor ebx,DWORD PTR [esp]
and ebp,edx
xor ebx,DWORD PTR 20[esp]
rol ebx,1
add ebp,eax
ror edx,2
mov eax,ecx
rol eax,5
mov DWORD PTR 32[esp],ebx
lea ebx,DWORD PTR 2400959708[ebp*1+ebx]
mov ebp,edi
add ebx,eax
and ebp,esi
mov eax,DWORD PTR 36[esp]
add ebx,ebp
; 40_59 41
mov ebp,edx
xor eax,DWORD PTR 44[esp]
xor ebp,edi
xor eax,DWORD PTR 4[esp]
and ebp,ecx
xor eax,DWORD PTR 24[esp]
rol eax,1
add ebp,esi
ror ecx,2
mov esi,ebx
rol esi,5
mov DWORD PTR 36[esp],eax
lea eax,DWORD PTR 2400959708[ebp*1+eax]
mov ebp,edx
add eax,esi
and ebp,edi
mov esi,DWORD PTR 40[esp]
add eax,ebp
; 40_59 42
mov ebp,ecx
xor esi,DWORD PTR 48[esp]
xor ebp,edx
xor esi,DWORD PTR 8[esp]
and ebp,ebx
xor esi,DWORD PTR 28[esp]
rol esi,1
add ebp,edi
ror ebx,2
mov edi,eax
rol edi,5
mov DWORD PTR 40[esp],esi
lea esi,DWORD PTR 2400959708[ebp*1+esi]
mov ebp,ecx
add esi,edi
and ebp,edx
mov edi,DWORD PTR 44[esp]
add esi,ebp
; 40_59 43
mov ebp,ebx
xor edi,DWORD PTR 52[esp]
xor ebp,ecx
xor edi,DWORD PTR 12[esp]
and ebp,eax
xor edi,DWORD PTR 32[esp]
rol edi,1
add ebp,edx
ror eax,2
mov edx,esi
rol edx,5
mov DWORD PTR 44[esp],edi
lea edi,DWORD PTR 2400959708[ebp*1+edi]
mov ebp,ebx
add edi,edx
and ebp,ecx
mov edx,DWORD PTR 48[esp]
add edi,ebp
; 40_59 44
mov ebp,eax
xor edx,DWORD PTR 56[esp]
xor ebp,ebx
xor edx,DWORD PTR 16[esp]
and ebp,esi
xor edx,DWORD PTR 36[esp]
rol edx,1
add ebp,ecx
ror esi,2
mov ecx,edi
rol ecx,5
mov DWORD PTR 48[esp],edx
lea edx,DWORD PTR 2400959708[ebp*1+edx]
mov ebp,eax
add edx,ecx
and ebp,ebx
mov ecx,DWORD PTR 52[esp]
add edx,ebp
; 40_59 45
mov ebp,esi
xor ecx,DWORD PTR 60[esp]
xor ebp,eax
xor ecx,DWORD PTR 20[esp]
and ebp,edi
xor ecx,DWORD PTR 40[esp]
rol ecx,1
add ebp,ebx
ror edi,2
mov ebx,edx
rol ebx,5
mov DWORD PTR 52[esp],ecx
lea ecx,DWORD PTR 2400959708[ebp*1+ecx]
mov ebp,esi
add ecx,ebx
and ebp,eax
mov ebx,DWORD PTR 56[esp]
add ecx,ebp
; 40_59 46
mov ebp,edi
xor ebx,DWORD PTR [esp]
xor ebp,esi
xor ebx,DWORD PTR 24[esp]
and ebp,edx
xor ebx,DWORD PTR 44[esp]
rol ebx,1
add ebp,eax
ror edx,2
mov eax,ecx
rol eax,5
mov DWORD PTR 56[esp],ebx
lea ebx,DWORD PTR 2400959708[ebp*1+ebx]
mov ebp,edi
add ebx,eax
and ebp,esi
mov eax,DWORD PTR 60[esp]
add ebx,ebp
; 40_59 47
mov ebp,edx
xor eax,DWORD PTR 4[esp]
xor ebp,edi
xor eax,DWORD PTR 28[esp]
and ebp,ecx
xor eax,DWORD PTR 48[esp]
rol eax,1
add ebp,esi
ror ecx,2
mov esi,ebx
rol esi,5
mov DWORD PTR 60[esp],eax
lea eax,DWORD PTR 2400959708[ebp*1+eax]
mov ebp,edx
add eax,esi
and ebp,edi
mov esi,DWORD PTR [esp]
add eax,ebp
; 40_59 48
mov ebp,ecx
xor esi,DWORD PTR 8[esp]
xor ebp,edx
xor esi,DWORD PTR 32[esp]
and ebp,ebx
xor esi,DWORD PTR 52[esp]
rol esi,1
add ebp,edi
ror ebx,2
mov edi,eax
rol edi,5
mov DWORD PTR [esp],esi
lea esi,DWORD PTR 2400959708[ebp*1+esi]
mov ebp,ecx
add esi,edi
and ebp,edx
mov edi,DWORD PTR 4[esp]
add esi,ebp
; 40_59 49
mov ebp,ebx
xor edi,DWORD PTR 12[esp]
xor ebp,ecx
xor edi,DWORD PTR 36[esp]
and ebp,eax
xor edi,DWORD PTR 56[esp]
rol edi,1
add ebp,edx
ror eax,2
mov edx,esi
rol edx,5
mov DWORD PTR 4[esp],edi
lea edi,DWORD PTR 2400959708[ebp*1+edi]
mov ebp,ebx
add edi,edx
and ebp,ecx
mov edx,DWORD PTR 8[esp]
add edi,ebp
; 40_59 50
mov ebp,eax
xor edx,DWORD PTR 16[esp]
xor ebp,ebx
xor edx,DWORD PTR 40[esp]
and ebp,esi
xor edx,DWORD PTR 60[esp]
rol edx,1
add ebp,ecx
ror esi,2
mov ecx,edi
rol ecx,5
mov DWORD PTR 8[esp],edx
lea edx,DWORD PTR 2400959708[ebp*1+edx]
mov ebp,eax
add edx,ecx
and ebp,ebx
mov ecx,DWORD PTR 12[esp]
add edx,ebp
; 40_59 51
mov ebp,esi
xor ecx,DWORD PTR 20[esp]
xor ebp,eax
xor ecx,DWORD PTR 44[esp]
and ebp,edi
xor ecx,DWORD PTR [esp]
rol ecx,1
add ebp,ebx
ror edi,2
mov ebx,edx
rol ebx,5
mov DWORD PTR 12[esp],ecx
lea ecx,DWORD PTR 2400959708[ebp*1+ecx]
mov ebp,esi
add ecx,ebx
and ebp,eax
mov ebx,DWORD PTR 16[esp]
add ecx,ebp
; 40_59 52
mov ebp,edi
xor ebx,DWORD PTR 24[esp]
xor ebp,esi
xor ebx,DWORD PTR 48[esp]
and ebp,edx
xor ebx,DWORD PTR 4[esp]
rol ebx,1
add ebp,eax
ror edx,2
mov eax,ecx
rol eax,5
mov DWORD PTR 16[esp],ebx
lea ebx,DWORD PTR 2400959708[ebp*1+ebx]
mov ebp,edi
add ebx,eax
and ebp,esi
mov eax,DWORD PTR 20[esp]
add ebx,ebp
; 40_59 53
mov ebp,edx
xor eax,DWORD PTR 28[esp]
xor ebp,edi
xor eax,DWORD PTR 52[esp]
and ebp,ecx
xor eax,DWORD PTR 8[esp]
rol eax,1
add ebp,esi
ror ecx,2
mov esi,ebx
rol esi,5
mov DWORD PTR 20[esp],eax
lea eax,DWORD PTR 2400959708[ebp*1+eax]
mov ebp,edx
add eax,esi
and ebp,edi
mov esi,DWORD PTR 24[esp]
add eax,ebp
; 40_59 54
mov ebp,ecx
xor esi,DWORD PTR 32[esp]
xor ebp,edx
xor esi,DWORD PTR 56[esp]
and ebp,ebx
xor esi,DWORD PTR 12[esp]
rol esi,1
add ebp,edi
ror ebx,2
mov edi,eax
rol edi,5
mov DWORD PTR 24[esp],esi
lea esi,DWORD PTR 2400959708[ebp*1+esi]
mov ebp,ecx
add esi,edi
and ebp,edx
mov edi,DWORD PTR 28[esp]
add esi,ebp
; 40_59 55
mov ebp,ebx
xor edi,DWORD PTR 36[esp]
xor ebp,ecx
xor edi,DWORD PTR 60[esp]
and ebp,eax
xor edi,DWORD PTR 16[esp]
rol edi,1
add ebp,edx
ror eax,2
mov edx,esi
rol edx,5
mov DWORD PTR 28[esp],edi
lea edi,DWORD PTR 2400959708[ebp*1+edi]
mov ebp,ebx
add edi,edx
and ebp,ecx
mov edx,DWORD PTR 32[esp]
add edi,ebp
; 40_59 56
mov ebp,eax
xor edx,DWORD PTR 40[esp]
xor ebp,ebx
xor edx,DWORD PTR [esp]
and ebp,esi
xor edx,DWORD PTR 20[esp]
rol edx,1
add ebp,ecx
ror esi,2
mov ecx,edi
rol ecx,5
mov DWORD PTR 32[esp],edx
lea edx,DWORD PTR 2400959708[ebp*1+edx]
mov ebp,eax
add edx,ecx
and ebp,ebx
mov ecx,DWORD PTR 36[esp]
add edx,ebp
; 40_59 57
mov ebp,esi
xor ecx,DWORD PTR 44[esp]
xor ebp,eax
xor ecx,DWORD PTR 4[esp]
and ebp,edi
xor ecx,DWORD PTR 24[esp]
rol ecx,1
add ebp,ebx
ror edi,2
mov ebx,edx
rol ebx,5
mov DWORD PTR 36[esp],ecx
lea ecx,DWORD PTR 2400959708[ebp*1+ecx]
mov ebp,esi
add ecx,ebx
and ebp,eax
mov ebx,DWORD PTR 40[esp]
add ecx,ebp
; 40_59 58
mov ebp,edi
xor ebx,DWORD PTR 48[esp]
xor ebp,esi
xor ebx,DWORD PTR 8[esp]
and ebp,edx
xor ebx,DWORD PTR 28[esp]
rol ebx,1
add ebp,eax
ror edx,2
mov eax,ecx
rol eax,5
mov DWORD PTR 40[esp],ebx
lea ebx,DWORD PTR 2400959708[ebp*1+ebx]
mov ebp,edi
add ebx,eax
and ebp,esi
mov eax,DWORD PTR 44[esp]
add ebx,ebp
; 40_59 59
mov ebp,edx
xor eax,DWORD PTR 52[esp]
xor ebp,edi
xor eax,DWORD PTR 12[esp]
and ebp,ecx
xor eax,DWORD PTR 32[esp]
rol eax,1
add ebp,esi
ror ecx,2
mov esi,ebx
rol esi,5
mov DWORD PTR 44[esp],eax
lea eax,DWORD PTR 2400959708[ebp*1+eax]
mov ebp,edx
add eax,esi
and ebp,edi
mov esi,DWORD PTR 48[esp]
add eax,ebp
; 20_39 60
mov ebp,ebx
xor esi,DWORD PTR 56[esp]
xor ebp,ecx
xor esi,DWORD PTR 16[esp]
xor ebp,edx
xor esi,DWORD PTR 36[esp]
rol esi,1
add edi,ebp
ror ebx,2
mov ebp,eax
rol ebp,5
mov DWORD PTR 48[esp],esi
lea esi,DWORD PTR 3395469782[edi*1+esi]
mov edi,DWORD PTR 52[esp]
add esi,ebp
; 20_39 61
mov ebp,eax
xor edi,DWORD PTR 60[esp]
xor ebp,ebx
xor edi,DWORD PTR 20[esp]
xor ebp,ecx
xor edi,DWORD PTR 40[esp]
rol edi,1
add edx,ebp
ror eax,2
mov ebp,esi
rol ebp,5
mov DWORD PTR 52[esp],edi
lea edi,DWORD PTR 3395469782[edx*1+edi]
mov edx,DWORD PTR 56[esp]
add edi,ebp
; 20_39 62
mov ebp,esi
xor edx,DWORD PTR [esp]
xor ebp,eax
xor edx,DWORD PTR 24[esp]
xor ebp,ebx
xor edx,DWORD PTR 44[esp]
rol edx,1
add ecx,ebp
ror esi,2
mov ebp,edi
rol ebp,5
mov DWORD PTR 56[esp],edx
lea edx,DWORD PTR 3395469782[ecx*1+edx]
mov ecx,DWORD PTR 60[esp]
add edx,ebp
; 20_39 63
mov ebp,edi
xor ecx,DWORD PTR 4[esp]
xor ebp,esi
xor ecx,DWORD PTR 28[esp]
xor ebp,eax
xor ecx,DWORD PTR 48[esp]
rol ecx,1
add ebx,ebp
ror edi,2
mov ebp,edx
rol ebp,5
mov DWORD PTR 60[esp],ecx
lea ecx,DWORD PTR 3395469782[ebx*1+ecx]
mov ebx,DWORD PTR [esp]
add ecx,ebp
; 20_39 64
mov ebp,edx
xor ebx,DWORD PTR 8[esp]
xor ebp,edi
xor ebx,DWORD PTR 32[esp]
xor ebp,esi
xor ebx,DWORD PTR 52[esp]
rol ebx,1
add eax,ebp
ror edx,2
mov ebp,ecx
rol ebp,5
mov DWORD PTR [esp],ebx
lea ebx,DWORD PTR 3395469782[eax*1+ebx]
mov eax,DWORD PTR 4[esp]
add ebx,ebp
; 20_39 65
mov ebp,ecx
xor eax,DWORD PTR 12[esp]
xor ebp,edx
xor eax,DWORD PTR 36[esp]
xor ebp,edi
xor eax,DWORD PTR 56[esp]
rol eax,1
add esi,ebp
ror ecx,2
mov ebp,ebx
rol ebp,5
mov DWORD PTR 4[esp],eax
lea eax,DWORD PTR 3395469782[esi*1+eax]
mov esi,DWORD PTR 8[esp]
add eax,ebp
; 20_39 66
mov ebp,ebx
xor esi,DWORD PTR 16[esp]
xor ebp,ecx
xor esi,DWORD PTR 40[esp]
xor ebp,edx
xor esi,DWORD PTR 60[esp]
rol esi,1
add edi,ebp
ror ebx,2
mov ebp,eax
rol ebp,5
mov DWORD PTR 8[esp],esi
lea esi,DWORD PTR 3395469782[edi*1+esi]
mov edi,DWORD PTR 12[esp]
add esi,ebp
; 20_39 67
mov ebp,eax
xor edi,DWORD PTR 20[esp]
xor ebp,ebx
xor edi,DWORD PTR 44[esp]
xor ebp,ecx
xor edi,DWORD PTR [esp]
rol edi,1
add edx,ebp
ror eax,2
mov ebp,esi
rol ebp,5
mov DWORD PTR 12[esp],edi
lea edi,DWORD PTR 3395469782[edx*1+edi]
mov edx,DWORD PTR 16[esp]
add edi,ebp
; 20_39 68
mov ebp,esi
xor edx,DWORD PTR 24[esp]
xor ebp,eax
xor edx,DWORD PTR 48[esp]
xor ebp,ebx
xor edx,DWORD PTR 4[esp]
rol edx,1
add ecx,ebp
ror esi,2
mov ebp,edi
rol ebp,5
mov DWORD PTR 16[esp],edx
lea edx,DWORD PTR 3395469782[ecx*1+edx]
mov ecx,DWORD PTR 20[esp]
add edx,ebp
; 20_39 69
mov ebp,edi
xor ecx,DWORD PTR 28[esp]
xor ebp,esi
xor ecx,DWORD PTR 52[esp]
xor ebp,eax
xor ecx,DWORD PTR 8[esp]
rol ecx,1
add ebx,ebp
ror edi,2
mov ebp,edx
rol ebp,5
mov DWORD PTR 20[esp],ecx
lea ecx,DWORD PTR 3395469782[ebx*1+ecx]
mov ebx,DWORD PTR 24[esp]
add ecx,ebp
; 20_39 70
mov ebp,edx
xor ebx,DWORD PTR 32[esp]
xor ebp,edi
xor ebx,DWORD PTR 56[esp]
xor ebp,esi
xor ebx,DWORD PTR 12[esp]
rol ebx,1
add eax,ebp
ror edx,2
mov ebp,ecx
rol ebp,5
mov DWORD PTR 24[esp],ebx
lea ebx,DWORD PTR 3395469782[eax*1+ebx]
mov eax,DWORD PTR 28[esp]
add ebx,ebp
; 20_39 71
mov ebp,ecx
xor eax,DWORD PTR 36[esp]
xor ebp,edx
xor eax,DWORD PTR 60[esp]
xor ebp,edi
xor eax,DWORD PTR 16[esp]
rol eax,1
add esi,ebp
ror ecx,2
mov ebp,ebx
rol ebp,5
mov DWORD PTR 28[esp],eax
lea eax,DWORD PTR 3395469782[esi*1+eax]
mov esi,DWORD PTR 32[esp]
add eax,ebp
; 20_39 72
mov ebp,ebx
xor esi,DWORD PTR 40[esp]
xor ebp,ecx
xor esi,DWORD PTR [esp]
xor ebp,edx
xor esi,DWORD PTR 20[esp]
rol esi,1
add edi,ebp
ror ebx,2
mov ebp,eax
rol ebp,5
mov DWORD PTR 32[esp],esi
lea esi,DWORD PTR 3395469782[edi*1+esi]
mov edi,DWORD PTR 36[esp]
add esi,ebp
; 20_39 73
mov ebp,eax
xor edi,DWORD PTR 44[esp]
xor ebp,ebx
xor edi,DWORD PTR 4[esp]
xor ebp,ecx
xor edi,DWORD PTR 24[esp]
rol edi,1
add edx,ebp
ror eax,2
mov ebp,esi
rol ebp,5
mov DWORD PTR 36[esp],edi
lea edi,DWORD PTR 3395469782[edx*1+edi]
mov edx,DWORD PTR 40[esp]
add edi,ebp
; 20_39 74
mov ebp,esi
xor edx,DWORD PTR 48[esp]
xor ebp,eax
xor edx,DWORD PTR 8[esp]
xor ebp,ebx
xor edx,DWORD PTR 28[esp]
rol edx,1
add ecx,ebp
ror esi,2
mov ebp,edi
rol ebp,5
mov DWORD PTR 40[esp],edx
lea edx,DWORD PTR 3395469782[ecx*1+edx]
mov ecx,DWORD PTR 44[esp]
add edx,ebp
; 20_39 75
mov ebp,edi
xor ecx,DWORD PTR 52[esp]
xor ebp,esi
xor ecx,DWORD PTR 12[esp]
xor ebp,eax
xor ecx,DWORD PTR 32[esp]
rol ecx,1
add ebx,ebp
ror edi,2
mov ebp,edx
rol ebp,5
mov DWORD PTR 44[esp],ecx
lea ecx,DWORD PTR 3395469782[ebx*1+ecx]
mov ebx,DWORD PTR 48[esp]
add ecx,ebp
; 20_39 76
mov ebp,edx
xor ebx,DWORD PTR 56[esp]
xor ebp,edi
xor ebx,DWORD PTR 16[esp]
xor ebp,esi
xor ebx,DWORD PTR 36[esp]
rol ebx,1
add eax,ebp
ror edx,2
mov ebp,ecx
rol ebp,5
mov DWORD PTR 48[esp],ebx
lea ebx,DWORD PTR 3395469782[eax*1+ebx]
mov eax,DWORD PTR 52[esp]
add ebx,ebp
; 20_39 77
mov ebp,ecx
xor eax,DWORD PTR 60[esp]
xor ebp,edx
xor eax,DWORD PTR 20[esp]
xor ebp,edi
xor eax,DWORD PTR 40[esp]
rol eax,1
add esi,ebp
ror ecx,2
mov ebp,ebx
rol ebp,5
lea eax,DWORD PTR 3395469782[esi*1+eax]
mov esi,DWORD PTR 56[esp]
add eax,ebp
; 20_39 78
mov ebp,ebx
xor esi,DWORD PTR [esp]
xor ebp,ecx
xor esi,DWORD PTR 24[esp]
xor ebp,edx
xor esi,DWORD PTR 44[esp]
rol esi,1
add edi,ebp
ror ebx,2
mov ebp,eax
rol ebp,5
lea esi,DWORD PTR 3395469782[edi*1+esi]
mov edi,DWORD PTR 60[esp]
add esi,ebp
; 20_39 79
mov ebp,eax
xor edi,DWORD PTR 4[esp]
xor ebp,ebx
xor edi,DWORD PTR 28[esp]
xor ebp,ecx
xor edi,DWORD PTR 48[esp]
rol edi,1
add edx,ebp
ror eax,2
mov ebp,esi
rol ebp,5
lea edi,DWORD PTR 3395469782[edx*1+edi]
add edi,ebp
mov ebp,DWORD PTR 96[esp]
mov edx,DWORD PTR 100[esp]
add edi,DWORD PTR [ebp]
add esi,DWORD PTR 4[ebp]
add eax,DWORD PTR 8[ebp]
add ebx,DWORD PTR 12[ebp]
add ecx,DWORD PTR 16[ebp]
mov DWORD PTR [ebp],edi
add edx,64
mov DWORD PTR 4[ebp],esi
cmp edx,DWORD PTR 104[esp]
mov DWORD PTR 8[ebp],eax
mov edi,ecx
mov DWORD PTR 12[ebp],ebx
mov esi,edx
mov DWORD PTR 16[ebp],ecx
jb $L002loop
add esp,76
pop edi
pop esi
pop ebx
pop ebp
ret
_sha1_block_data_order ENDP
ALIGN 16
__sha1_block_data_order_shaext PROC PRIVATE
push ebp
push ebx
push esi
push edi
call $L003pic_point
$L003pic_point:
pop ebp
lea ebp,DWORD PTR ($LK_XX_XX-$L003pic_point)[ebp]
$Lshaext_shortcut::
mov edi,DWORD PTR 20[esp]
mov ebx,esp
mov esi,DWORD PTR 24[esp]
mov ecx,DWORD PTR 28[esp]
sub esp,32
movdqu xmm0,XMMWORD PTR [edi]
movd xmm1,DWORD PTR 16[edi]
and esp,-32
movdqa xmm3,XMMWORD PTR 80[ebp]
movdqu xmm4,XMMWORD PTR [esi]
pshufd xmm0,xmm0,27
movdqu xmm5,XMMWORD PTR 16[esi]
pshufd xmm1,xmm1,27
movdqu xmm6,XMMWORD PTR 32[esi]
DB 102,15,56,0,227
movdqu xmm7,XMMWORD PTR 48[esi]
DB 102,15,56,0,235
DB 102,15,56,0,243
DB 102,15,56,0,251
jmp $L004loop_shaext
ALIGN 16
$L004loop_shaext:
dec ecx
lea eax,DWORD PTR 64[esi]
movdqa XMMWORD PTR [esp],xmm1
paddd xmm1,xmm4
cmovne esi,eax
movdqa XMMWORD PTR 16[esp],xmm0
DB 15,56,201,229
movdqa xmm2,xmm0
DB 15,58,204,193,0
DB 15,56,200,213
pxor xmm4,xmm6
DB 15,56,201,238
DB 15,56,202,231
movdqa xmm1,xmm0
DB 15,58,204,194,0
DB 15,56,200,206
pxor xmm5,xmm7
DB 15,56,202,236
DB 15,56,201,247
movdqa xmm2,xmm0
DB 15,58,204,193,0
DB 15,56,200,215
pxor xmm6,xmm4
DB 15,56,201,252
DB 15,56,202,245
movdqa xmm1,xmm0
DB 15,58,204,194,0
DB 15,56,200,204
pxor xmm7,xmm5
DB 15,56,202,254
DB 15,56,201,229
movdqa xmm2,xmm0
DB 15,58,204,193,0
DB 15,56,200,213
pxor xmm4,xmm6
DB 15,56,201,238
DB 15,56,202,231
movdqa xmm1,xmm0
DB 15,58,204,194,1
DB 15,56,200,206
pxor xmm5,xmm7
DB 15,56,202,236
DB 15,56,201,247
movdqa xmm2,xmm0
DB 15,58,204,193,1
DB 15,56,200,215
pxor xmm6,xmm4
DB 15,56,201,252
DB 15,56,202,245
movdqa xmm1,xmm0
DB 15,58,204,194,1
DB 15,56,200,204
pxor xmm7,xmm5
DB 15,56,202,254
DB 15,56,201,229
movdqa xmm2,xmm0
DB 15,58,204,193,1
DB 15,56,200,213
pxor xmm4,xmm6
DB 15,56,201,238
DB 15,56,202,231
movdqa xmm1,xmm0
DB 15,58,204,194,1
DB 15,56,200,206
pxor xmm5,xmm7
DB 15,56,202,236
DB 15,56,201,247
movdqa xmm2,xmm0
DB 15,58,204,193,2
DB 15,56,200,215
pxor xmm6,xmm4
DB 15,56,201,252
DB 15,56,202,245
movdqa xmm1,xmm0
DB 15,58,204,194,2
DB 15,56,200,204
pxor xmm7,xmm5
DB 15,56,202,254
DB 15,56,201,229
movdqa xmm2,xmm0
DB 15,58,204,193,2
DB 15,56,200,213
pxor xmm4,xmm6
DB 15,56,201,238
DB 15,56,202,231
movdqa xmm1,xmm0
DB 15,58,204,194,2
DB 15,56,200,206
pxor xmm5,xmm7
DB 15,56,202,236
DB 15,56,201,247
movdqa xmm2,xmm0
DB 15,58,204,193,2
DB 15,56,200,215
pxor xmm6,xmm4
DB 15,56,201,252
DB 15,56,202,245
movdqa xmm1,xmm0
DB 15,58,204,194,3
DB 15,56,200,204
pxor xmm7,xmm5
DB 15,56,202,254
movdqu xmm4,XMMWORD PTR [esi]
movdqa xmm2,xmm0
DB 15,58,204,193,3
DB 15,56,200,213
movdqu xmm5,XMMWORD PTR 16[esi]
DB 102,15,56,0,227
movdqa xmm1,xmm0
DB 15,58,204,194,3
DB 15,56,200,206
movdqu xmm6,XMMWORD PTR 32[esi]
DB 102,15,56,0,235
movdqa xmm2,xmm0
DB 15,58,204,193,3
DB 15,56,200,215
movdqu xmm7,XMMWORD PTR 48[esi]
DB 102,15,56,0,243
movdqa xmm1,xmm0
DB 15,58,204,194,3
movdqa xmm2,XMMWORD PTR [esp]
DB 102,15,56,0,251
DB 15,56,200,202
paddd xmm0,XMMWORD PTR 16[esp]
jnz $L004loop_shaext
pshufd xmm0,xmm0,27
pshufd xmm1,xmm1,27
movdqu XMMWORD PTR [edi],xmm0
movd DWORD PTR 16[edi],xmm1
mov esp,ebx
pop edi
pop esi
pop ebx
pop ebp
ret
__sha1_block_data_order_shaext ENDP
ALIGN 16
__sha1_block_data_order_ssse3 PROC PRIVATE
push ebp
push ebx
push esi
push edi
call $L005pic_point
$L005pic_point:
pop ebp
lea ebp,DWORD PTR ($LK_XX_XX-$L005pic_point)[ebp]
$Lssse3_shortcut::
movdqa xmm7,XMMWORD PTR [ebp]
movdqa xmm0,XMMWORD PTR 16[ebp]
movdqa xmm1,XMMWORD PTR 32[ebp]
movdqa xmm2,XMMWORD PTR 48[ebp]
movdqa xmm6,XMMWORD PTR 64[ebp]
mov edi,DWORD PTR 20[esp]
mov ebp,DWORD PTR 24[esp]
mov edx,DWORD PTR 28[esp]
mov esi,esp
sub esp,208
and esp,-64
movdqa XMMWORD PTR 112[esp],xmm0
movdqa XMMWORD PTR 128[esp],xmm1
movdqa XMMWORD PTR 144[esp],xmm2
shl edx,6
movdqa XMMWORD PTR 160[esp],xmm7
add edx,ebp
movdqa XMMWORD PTR 176[esp],xmm6
add ebp,64
mov DWORD PTR 192[esp],edi
mov DWORD PTR 196[esp],ebp
mov DWORD PTR 200[esp],edx
mov DWORD PTR 204[esp],esi
mov eax,DWORD PTR [edi]
mov ebx,DWORD PTR 4[edi]
mov ecx,DWORD PTR 8[edi]
mov edx,DWORD PTR 12[edi]
mov edi,DWORD PTR 16[edi]
mov esi,ebx
movdqu xmm0,XMMWORD PTR [ebp-64]
movdqu xmm1,XMMWORD PTR [ebp-48]
movdqu xmm2,XMMWORD PTR [ebp-32]
movdqu xmm3,XMMWORD PTR [ebp-16]
DB 102,15,56,0,198
DB 102,15,56,0,206
DB 102,15,56,0,214
movdqa XMMWORD PTR 96[esp],xmm7
DB 102,15,56,0,222
paddd xmm0,xmm7
paddd xmm1,xmm7
paddd xmm2,xmm7
movdqa XMMWORD PTR [esp],xmm0
psubd xmm0,xmm7
movdqa XMMWORD PTR 16[esp],xmm1
psubd xmm1,xmm7
movdqa XMMWORD PTR 32[esp],xmm2
mov ebp,ecx
psubd xmm2,xmm7
xor ebp,edx
pshufd xmm4,xmm0,238
and esi,ebp
jmp $L006loop
ALIGN 16
$L006loop:
ror ebx,2
xor esi,edx
mov ebp,eax
punpcklqdq xmm4,xmm1
movdqa xmm6,xmm3
add edi,DWORD PTR [esp]
xor ebx,ecx
paddd xmm7,xmm3
movdqa XMMWORD PTR 64[esp],xmm0
rol eax,5
add edi,esi
psrldq xmm6,4
and ebp,ebx
xor ebx,ecx
pxor xmm4,xmm0
add edi,eax
ror eax,7
pxor xmm6,xmm2
xor ebp,ecx
mov esi,edi
add edx,DWORD PTR 4[esp]
pxor xmm4,xmm6
xor eax,ebx
rol edi,5
movdqa XMMWORD PTR 48[esp],xmm7
add edx,ebp
and esi,eax
movdqa xmm0,xmm4
xor eax,ebx
add edx,edi
ror edi,7
movdqa xmm6,xmm4
xor esi,ebx
pslldq xmm0,12
paddd xmm4,xmm4
mov ebp,edx
add ecx,DWORD PTR 8[esp]
psrld xmm6,31
xor edi,eax
rol edx,5
movdqa xmm7,xmm0
add ecx,esi
and ebp,edi
xor edi,eax
psrld xmm0,30
add ecx,edx
ror edx,7
por xmm4,xmm6
xor ebp,eax
mov esi,ecx
add ebx,DWORD PTR 12[esp]
pslld xmm7,2
xor edx,edi
rol ecx,5
pxor xmm4,xmm0
movdqa xmm0,XMMWORD PTR 96[esp]
add ebx,ebp
and esi,edx
pxor xmm4,xmm7
pshufd xmm5,xmm1,238
xor edx,edi
add ebx,ecx
ror ecx,7
xor esi,edi
mov ebp,ebx
punpcklqdq xmm5,xmm2
movdqa xmm7,xmm4
add eax,DWORD PTR 16[esp]
xor ecx,edx
paddd xmm0,xmm4
movdqa XMMWORD PTR 80[esp],xmm1
rol ebx,5
add eax,esi
psrldq xmm7,4
and ebp,ecx
xor ecx,edx
pxor xmm5,xmm1
add eax,ebx
ror ebx,7
pxor xmm7,xmm3
xor ebp,edx
mov esi,eax
add edi,DWORD PTR 20[esp]
pxor xmm5,xmm7
xor ebx,ecx
rol eax,5
movdqa XMMWORD PTR [esp],xmm0
add edi,ebp
and esi,ebx
movdqa xmm1,xmm5
xor ebx,ecx
add edi,eax
ror eax,7
movdqa xmm7,xmm5
xor esi,ecx
pslldq xmm1,12
paddd xmm5,xmm5
mov ebp,edi
add edx,DWORD PTR 24[esp]
psrld xmm7,31
xor eax,ebx
rol edi,5
movdqa xmm0,xmm1
add edx,esi
and ebp,eax
xor eax,ebx
psrld xmm1,30
add edx,edi
ror edi,7
por xmm5,xmm7
xor ebp,ebx
mov esi,edx
add ecx,DWORD PTR 28[esp]
pslld xmm0,2
xor edi,eax
rol edx,5
pxor xmm5,xmm1
movdqa xmm1,XMMWORD PTR 112[esp]
add ecx,ebp
and esi,edi
pxor xmm5,xmm0
pshufd xmm6,xmm2,238
xor edi,eax
add ecx,edx
ror edx,7
xor esi,eax
mov ebp,ecx
punpcklqdq xmm6,xmm3
movdqa xmm0,xmm5
add ebx,DWORD PTR 32[esp]
xor edx,edi
paddd xmm1,xmm5
movdqa XMMWORD PTR 96[esp],xmm2
rol ecx,5
add ebx,esi
psrldq xmm0,4
and ebp,edx
xor edx,edi
pxor xmm6,xmm2
add ebx,ecx
ror ecx,7
pxor xmm0,xmm4
xor ebp,edi
mov esi,ebx
add eax,DWORD PTR 36[esp]
pxor xmm6,xmm0
xor ecx,edx
rol ebx,5
movdqa XMMWORD PTR 16[esp],xmm1
add eax,ebp
and esi,ecx
movdqa xmm2,xmm6
xor ecx,edx
add eax,ebx
ror ebx,7
movdqa xmm0,xmm6
xor esi,edx
pslldq xmm2,12
paddd xmm6,xmm6
mov ebp,eax
add edi,DWORD PTR 40[esp]
psrld xmm0,31
xor ebx,ecx
rol eax,5
movdqa xmm1,xmm2
add edi,esi
and ebp,ebx
xor ebx,ecx
psrld xmm2,30
add edi,eax
ror eax,7
por xmm6,xmm0
xor ebp,ecx
movdqa xmm0,XMMWORD PTR 64[esp]
mov esi,edi
add edx,DWORD PTR 44[esp]
pslld xmm1,2
xor eax,ebx
rol edi,5
pxor xmm6,xmm2
movdqa xmm2,XMMWORD PTR 112[esp]
add edx,ebp
and esi,eax
pxor xmm6,xmm1
pshufd xmm7,xmm3,238
xor eax,ebx
add edx,edi
ror edi,7
xor esi,ebx
mov ebp,edx
punpcklqdq xmm7,xmm4
movdqa xmm1,xmm6
add ecx,DWORD PTR 48[esp]
xor edi,eax
paddd xmm2,xmm6
movdqa XMMWORD PTR 64[esp],xmm3
rol edx,5
add ecx,esi
psrldq xmm1,4
and ebp,edi
xor edi,eax
pxor xmm7,xmm3
add ecx,edx
ror edx,7
pxor xmm1,xmm5
xor ebp,eax
mov esi,ecx
add ebx,DWORD PTR 52[esp]
pxor xmm7,xmm1
xor edx,edi
rol ecx,5
movdqa XMMWORD PTR 32[esp],xmm2
add ebx,ebp
and esi,edx
movdqa xmm3,xmm7
xor edx,edi
add ebx,ecx
ror ecx,7
movdqa xmm1,xmm7
xor esi,edi
pslldq xmm3,12
paddd xmm7,xmm7
mov ebp,ebx
add eax,DWORD PTR 56[esp]
psrld xmm1,31
xor ecx,edx
rol ebx,5
movdqa xmm2,xmm3
add eax,esi
and ebp,ecx
xor ecx,edx
psrld xmm3,30
add eax,ebx
ror ebx,7
por xmm7,xmm1
xor ebp,edx
movdqa xmm1,XMMWORD PTR 80[esp]
mov esi,eax
add edi,DWORD PTR 60[esp]
pslld xmm2,2
xor ebx,ecx
rol eax,5
pxor xmm7,xmm3
movdqa xmm3,XMMWORD PTR 112[esp]
add edi,ebp
and esi,ebx
pxor xmm7,xmm2
pshufd xmm2,xmm6,238
xor ebx,ecx
add edi,eax
ror eax,7
pxor xmm0,xmm4
punpcklqdq xmm2,xmm7
xor esi,ecx
mov ebp,edi
add edx,DWORD PTR [esp]
pxor xmm0,xmm1
movdqa XMMWORD PTR 80[esp],xmm4
xor eax,ebx
rol edi,5
movdqa xmm4,xmm3
add edx,esi
paddd xmm3,xmm7
and ebp,eax
pxor xmm0,xmm2
xor eax,ebx
add edx,edi
ror edi,7
xor ebp,ebx
movdqa xmm2,xmm0
movdqa XMMWORD PTR 48[esp],xmm3
mov esi,edx
add ecx,DWORD PTR 4[esp]
xor edi,eax
rol edx,5
pslld xmm0,2
add ecx,ebp
and esi,edi
psrld xmm2,30
xor edi,eax
add ecx,edx
ror edx,7
xor esi,eax
mov ebp,ecx
add ebx,DWORD PTR 8[esp]
xor edx,edi
rol ecx,5
por xmm0,xmm2
add ebx,esi
and ebp,edx
movdqa xmm2,XMMWORD PTR 96[esp]
xor edx,edi
add ebx,ecx
add eax,DWORD PTR 12[esp]
xor ebp,edi
mov esi,ebx
pshufd xmm3,xmm7,238
rol ebx,5
add eax,ebp
xor esi,edx
ror ecx,7
add eax,ebx
add edi,DWORD PTR 16[esp]
pxor xmm1,xmm5
punpcklqdq xmm3,xmm0
xor esi,ecx
mov ebp,eax
rol eax,5
pxor xmm1,xmm2
movdqa XMMWORD PTR 96[esp],xmm5
add edi,esi
xor ebp,ecx
movdqa xmm5,xmm4
ror ebx,7
paddd xmm4,xmm0
add edi,eax
pxor xmm1,xmm3
add edx,DWORD PTR 20[esp]
xor ebp,ebx
mov esi,edi
rol edi,5
movdqa xmm3,xmm1
movdqa XMMWORD PTR [esp],xmm4
add edx,ebp
xor esi,ebx
ror eax,7
add edx,edi
pslld xmm1,2
add ecx,DWORD PTR 24[esp]
xor esi,eax
psrld xmm3,30
mov ebp,edx
rol edx,5
add ecx,esi
xor ebp,eax
ror edi,7
add ecx,edx
por xmm1,xmm3
add ebx,DWORD PTR 28[esp]
xor ebp,edi
movdqa xmm3,XMMWORD PTR 64[esp]
mov esi,ecx
rol ecx,5
add ebx,ebp
xor esi,edi
ror edx,7
pshufd xmm4,xmm0,238
add ebx,ecx
add eax,DWORD PTR 32[esp]
pxor xmm2,xmm6
punpcklqdq xmm4,xmm1
xor esi,edx
mov ebp,ebx
rol ebx,5
pxor xmm2,xmm3
movdqa XMMWORD PTR 64[esp],xmm6
add eax,esi
xor ebp,edx
movdqa xmm6,XMMWORD PTR 128[esp]
ror ecx,7
paddd xmm5,xmm1
add eax,ebx
pxor xmm2,xmm4
add edi,DWORD PTR 36[esp]
xor ebp,ecx
mov esi,eax
rol eax,5
movdqa xmm4,xmm2
movdqa XMMWORD PTR 16[esp],xmm5
add edi,ebp
xor esi,ecx
ror ebx,7
add edi,eax
pslld xmm2,2
add edx,DWORD PTR 40[esp]
xor esi,ebx
psrld xmm4,30
mov ebp,edi
rol edi,5
add edx,esi
xor ebp,ebx
ror eax,7
add edx,edi
por xmm2,xmm4
add ecx,DWORD PTR 44[esp]
xor ebp,eax
movdqa xmm4,XMMWORD PTR 80[esp]
mov esi,edx
rol edx,5
add ecx,ebp
xor esi,eax
ror edi,7
pshufd xmm5,xmm1,238
add ecx,edx
add ebx,DWORD PTR 48[esp]
pxor xmm3,xmm7
punpcklqdq xmm5,xmm2
xor esi,edi
mov ebp,ecx
rol ecx,5
pxor xmm3,xmm4
movdqa XMMWORD PTR 80[esp],xmm7
add ebx,esi
xor ebp,edi
movdqa xmm7,xmm6
ror edx,7
paddd xmm6,xmm2
add ebx,ecx
pxor xmm3,xmm5
add eax,DWORD PTR 52[esp]
xor ebp,edx
mov esi,ebx
rol ebx,5
movdqa xmm5,xmm3
movdqa XMMWORD PTR 32[esp],xmm6
add eax,ebp
xor esi,edx
ror ecx,7
add eax,ebx
pslld xmm3,2
add edi,DWORD PTR 56[esp]
xor esi,ecx
psrld xmm5,30
mov ebp,eax
rol eax,5
add edi,esi
xor ebp,ecx
ror ebx,7
add edi,eax
por xmm3,xmm5
add edx,DWORD PTR 60[esp]
xor ebp,ebx
movdqa xmm5,XMMWORD PTR 96[esp]
mov esi,edi
rol edi,5
add edx,ebp
xor esi,ebx
ror eax,7
pshufd xmm6,xmm2,238
add edx,edi
add ecx,DWORD PTR [esp]
pxor xmm4,xmm0
punpcklqdq xmm6,xmm3
xor esi,eax
mov ebp,edx
rol edx,5
pxor xmm4,xmm5
movdqa XMMWORD PTR 96[esp],xmm0
add ecx,esi
xor ebp,eax
movdqa xmm0,xmm7
ror edi,7
paddd xmm7,xmm3
add ecx,edx
pxor xmm4,xmm6
add ebx,DWORD PTR 4[esp]
xor ebp,edi
mov esi,ecx
rol ecx,5
movdqa xmm6,xmm4
movdqa XMMWORD PTR 48[esp],xmm7
add ebx,ebp
xor esi,edi
ror edx,7
add ebx,ecx
pslld xmm4,2
add eax,DWORD PTR 8[esp]
xor esi,edx
psrld xmm6,30
mov ebp,ebx
rol ebx,5
add eax,esi
xor ebp,edx
ror ecx,7
add eax,ebx
por xmm4,xmm6
add edi,DWORD PTR 12[esp]
xor ebp,ecx
movdqa xmm6,XMMWORD PTR 64[esp]
mov esi,eax
rol eax,5
add edi,ebp
xor esi,ecx
ror ebx,7
pshufd xmm7,xmm3,238
add edi,eax
add edx,DWORD PTR 16[esp]
pxor xmm5,xmm1
punpcklqdq xmm7,xmm4
xor esi,ebx
mov ebp,edi
rol edi,5
pxor xmm5,xmm6
movdqa XMMWORD PTR 64[esp],xmm1
add edx,esi
xor ebp,ebx
movdqa xmm1,xmm0
ror eax,7
paddd xmm0,xmm4
add edx,edi
pxor xmm5,xmm7
add ecx,DWORD PTR 20[esp]
xor ebp,eax
mov esi,edx
rol edx,5
movdqa xmm7,xmm5
movdqa XMMWORD PTR [esp],xmm0
add ecx,ebp
xor esi,eax
ror edi,7
add ecx,edx
pslld xmm5,2
add ebx,DWORD PTR 24[esp]
xor esi,edi
psrld xmm7,30
mov ebp,ecx
rol ecx,5
add ebx,esi
xor ebp,edi
ror edx,7
add ebx,ecx
por xmm5,xmm7
add eax,DWORD PTR 28[esp]
movdqa xmm7,XMMWORD PTR 80[esp]
ror ecx,7
mov esi,ebx
xor ebp,edx
rol ebx,5
pshufd xmm0,xmm4,238
add eax,ebp
xor esi,ecx
xor ecx,edx
add eax,ebx
add edi,DWORD PTR 32[esp]
pxor xmm6,xmm2
punpcklqdq xmm0,xmm5
and esi,ecx
xor ecx,edx
ror ebx,7
pxor xmm6,xmm7
movdqa XMMWORD PTR 80[esp],xmm2
mov ebp,eax
xor esi,ecx
rol eax,5
movdqa xmm2,xmm1
add edi,esi
paddd xmm1,xmm5
xor ebp,ebx
pxor xmm6,xmm0
xor ebx,ecx
add edi,eax
add edx,DWORD PTR 36[esp]
and ebp,ebx
movdqa xmm0,xmm6
movdqa XMMWORD PTR 16[esp],xmm1
xor ebx,ecx
ror eax,7
mov esi,edi
xor ebp,ebx
rol edi,5
pslld xmm6,2
add edx,ebp
xor esi,eax
psrld xmm0,30
xor eax,ebx
add edx,edi
add ecx,DWORD PTR 40[esp]
and esi,eax
xor eax,ebx
ror edi,7
por xmm6,xmm0
mov ebp,edx
xor esi,eax
movdqa xmm0,XMMWORD PTR 96[esp]
rol edx,5
add ecx,esi
xor ebp,edi
xor edi,eax
add ecx,edx
pshufd xmm1,xmm5,238
add ebx,DWORD PTR 44[esp]
and ebp,edi
xor edi,eax
ror edx,7
mov esi,ecx
xor ebp,edi
rol ecx,5
add ebx,ebp
xor esi,edx
xor edx,edi
add ebx,ecx
add eax,DWORD PTR 48[esp]
pxor xmm7,xmm3
punpcklqdq xmm1,xmm6
and esi,edx
xor edx,edi
ror ecx,7
pxor xmm7,xmm0
movdqa XMMWORD PTR 96[esp],xmm3
mov ebp,ebx
xor esi,edx
rol ebx,5
movdqa xmm3,XMMWORD PTR 144[esp]
add eax,esi
paddd xmm2,xmm6
xor ebp,ecx
pxor xmm7,xmm1
xor ecx,edx
add eax,ebx
add edi,DWORD PTR 52[esp]
and ebp,ecx
movdqa xmm1,xmm7
movdqa XMMWORD PTR 32[esp],xmm2
xor ecx,edx
ror ebx,7
mov esi,eax
xor ebp,ecx
rol eax,5
pslld xmm7,2
add edi,ebp
xor esi,ebx
psrld xmm1,30
xor ebx,ecx
add edi,eax
add edx,DWORD PTR 56[esp]
and esi,ebx
xor ebx,ecx
ror eax,7
por xmm7,xmm1
mov ebp,edi
xor esi,ebx
movdqa xmm1,XMMWORD PTR 64[esp]
rol edi,5
add edx,esi
xor ebp,eax
xor eax,ebx
add edx,edi
pshufd xmm2,xmm6,238
add ecx,DWORD PTR 60[esp]
and ebp,eax
xor eax,ebx
ror edi,7
mov esi,edx
xor ebp,eax
rol edx,5
add ecx,ebp
xor esi,edi
xor edi,eax
add ecx,edx
add ebx,DWORD PTR [esp]
pxor xmm0,xmm4
punpcklqdq xmm2,xmm7
and esi,edi
xor edi,eax
ror edx,7
pxor xmm0,xmm1
movdqa XMMWORD PTR 64[esp],xmm4
mov ebp,ecx
xor esi,edi
rol ecx,5
movdqa xmm4,xmm3
add ebx,esi
paddd xmm3,xmm7
xor ebp,edx
pxor xmm0,xmm2
xor edx,edi
add ebx,ecx
add eax,DWORD PTR 4[esp]
and ebp,edx
movdqa xmm2,xmm0
movdqa XMMWORD PTR 48[esp],xmm3
xor edx,edi
ror ecx,7
mov esi,ebx
xor ebp,edx
rol ebx,5
pslld xmm0,2
add eax,ebp
xor esi,ecx
psrld xmm2,30
xor ecx,edx
add eax,ebx
add edi,DWORD PTR 8[esp]
and esi,ecx
xor ecx,edx
ror ebx,7
por xmm0,xmm2
mov ebp,eax
xor esi,ecx
movdqa xmm2,XMMWORD PTR 80[esp]
rol eax,5
add edi,esi
xor ebp,ebx
xor ebx,ecx
add edi,eax
pshufd xmm3,xmm7,238
add edx,DWORD PTR 12[esp]
and ebp,ebx
xor ebx,ecx
ror eax,7
mov esi,edi
xor ebp,ebx
rol edi,5
add edx,ebp
xor esi,eax
xor eax,ebx
add edx,edi
add ecx,DWORD PTR 16[esp]
pxor xmm1,xmm5
punpcklqdq xmm3,xmm0
and esi,eax
xor eax,ebx
ror edi,7
pxor xmm1,xmm2
movdqa XMMWORD PTR 80[esp],xmm5
mov ebp,edx
xor esi,eax
rol edx,5
movdqa xmm5,xmm4
add ecx,esi
paddd xmm4,xmm0
xor ebp,edi
pxor xmm1,xmm3
xor edi,eax
add ecx,edx
add ebx,DWORD PTR 20[esp]
and ebp,edi
movdqa xmm3,xmm1
movdqa XMMWORD PTR [esp],xmm4
xor edi,eax
ror edx,7
mov esi,ecx
xor ebp,edi
rol ecx,5
pslld xmm1,2
add ebx,ebp
xor esi,edx
psrld xmm3,30
xor edx,edi
add ebx,ecx
add eax,DWORD PTR 24[esp]
and esi,edx
xor edx,edi
ror ecx,7
por xmm1,xmm3
mov ebp,ebx
xor esi,edx
movdqa xmm3,XMMWORD PTR 96[esp]
rol ebx,5
add eax,esi
xor ebp,ecx
xor ecx,edx
add eax,ebx
pshufd xmm4,xmm0,238
add edi,DWORD PTR 28[esp]
and ebp,ecx
xor ecx,edx
ror ebx,7
mov esi,eax
xor ebp,ecx
rol eax,5
add edi,ebp
xor esi,ebx
xor ebx,ecx
add edi,eax
add edx,DWORD PTR 32[esp]
pxor xmm2,xmm6
punpcklqdq xmm4,xmm1
and esi,ebx
xor ebx,ecx
ror eax,7
pxor xmm2,xmm3
movdqa XMMWORD PTR 96[esp],xmm6
mov ebp,edi
xor esi,ebx
rol edi,5
movdqa xmm6,xmm5
add edx,esi
paddd xmm5,xmm1
xor ebp,eax
pxor xmm2,xmm4
xor eax,ebx
add edx,edi
add ecx,DWORD PTR 36[esp]
and ebp,eax
movdqa xmm4,xmm2
movdqa XMMWORD PTR 16[esp],xmm5
xor eax,ebx
ror edi,7
mov esi,edx
xor ebp,eax
rol edx,5
pslld xmm2,2
add ecx,ebp
xor esi,edi
psrld xmm4,30
xor edi,eax
add ecx,edx
add ebx,DWORD PTR 40[esp]
and esi,edi
xor edi,eax
ror edx,7
por xmm2,xmm4
mov ebp,ecx
xor esi,edi
movdqa xmm4,XMMWORD PTR 64[esp]
rol ecx,5
add ebx,esi
xor ebp,edx
xor edx,edi
add ebx,ecx
pshufd xmm5,xmm1,238
add eax,DWORD PTR 44[esp]
and ebp,edx
xor edx,edi
ror ecx,7
mov esi,ebx
xor ebp,edx
rol ebx,5
add eax,ebp
xor esi,edx
add eax,ebx
add edi,DWORD PTR 48[esp]
pxor xmm3,xmm7
punpcklqdq xmm5,xmm2
xor esi,ecx
mov ebp,eax
rol eax,5
pxor xmm3,xmm4
movdqa XMMWORD PTR 64[esp],xmm7
add edi,esi
xor ebp,ecx
movdqa xmm7,xmm6
ror ebx,7
paddd xmm6,xmm2
add edi,eax
pxor xmm3,xmm5
add edx,DWORD PTR 52[esp]
xor ebp,ebx
mov esi,edi
rol edi,5
movdqa xmm5,xmm3
movdqa XMMWORD PTR 32[esp],xmm6
add edx,ebp
xor esi,ebx
ror eax,7
add edx,edi
pslld xmm3,2
add ecx,DWORD PTR 56[esp]
xor esi,eax
psrld xmm5,30
mov ebp,edx
rol edx,5
add ecx,esi
xor ebp,eax
ror edi,7
add ecx,edx
por xmm3,xmm5
add ebx,DWORD PTR 60[esp]
xor ebp,edi
mov esi,ecx
rol ecx,5
add ebx,ebp
xor esi,edi
ror edx,7
add ebx,ecx
add eax,DWORD PTR [esp]
xor esi,edx
mov ebp,ebx
rol ebx,5
add eax,esi
xor ebp,edx
ror ecx,7
paddd xmm7,xmm3
add eax,ebx
add edi,DWORD PTR 4[esp]
xor ebp,ecx
mov esi,eax
movdqa XMMWORD PTR 48[esp],xmm7
rol eax,5
add edi,ebp
xor esi,ecx
ror ebx,7
add edi,eax
add edx,DWORD PTR 8[esp]
xor esi,ebx
mov ebp,edi
rol edi,5
add edx,esi
xor ebp,ebx
ror eax,7
add edx,edi
add ecx,DWORD PTR 12[esp]
xor ebp,eax
mov esi,edx
rol edx,5
add ecx,ebp
xor esi,eax
ror edi,7
add ecx,edx
mov ebp,DWORD PTR 196[esp]
cmp ebp,DWORD PTR 200[esp]
je $L007done
movdqa xmm7,XMMWORD PTR 160[esp]
movdqa xmm6,XMMWORD PTR 176[esp]
movdqu xmm0,XMMWORD PTR [ebp]
movdqu xmm1,XMMWORD PTR 16[ebp]
movdqu xmm2,XMMWORD PTR 32[ebp]
movdqu xmm3,XMMWORD PTR 48[ebp]
add ebp,64
DB 102,15,56,0,198
mov DWORD PTR 196[esp],ebp
movdqa XMMWORD PTR 96[esp],xmm7
add ebx,DWORD PTR 16[esp]
xor esi,edi
mov ebp,ecx
rol ecx,5
add ebx,esi
xor ebp,edi
ror edx,7
DB 102,15,56,0,206
add ebx,ecx
add eax,DWORD PTR 20[esp]
xor ebp,edx
mov esi,ebx
paddd xmm0,xmm7
rol ebx,5
add eax,ebp
xor esi,edx
ror ecx,7
movdqa XMMWORD PTR [esp],xmm0
add eax,ebx
add edi,DWORD PTR 24[esp]
xor esi,ecx
mov ebp,eax
psubd xmm0,xmm7
rol eax,5
add edi,esi
xor ebp,ecx
ror ebx,7
add edi,eax
add edx,DWORD PTR 28[esp]
xor ebp,ebx
mov esi,edi
rol edi,5
add edx,ebp
xor esi,ebx
ror eax,7
add edx,edi
add ecx,DWORD PTR 32[esp]
xor esi,eax
mov ebp,edx
rol edx,5
add ecx,esi
xor ebp,eax
ror edi,7
DB 102,15,56,0,214
add ecx,edx
add ebx,DWORD PTR 36[esp]
xor ebp,edi
mov esi,ecx
paddd xmm1,xmm7
rol ecx,5
add ebx,ebp
xor esi,edi
ror edx,7
movdqa XMMWORD PTR 16[esp],xmm1
add ebx,ecx
add eax,DWORD PTR 40[esp]
xor esi,edx
mov ebp,ebx
psubd xmm1,xmm7
rol ebx,5
add eax,esi
xor ebp,edx
ror ecx,7
add eax,ebx
add edi,DWORD PTR 44[esp]
xor ebp,ecx
mov esi,eax
rol eax,5
add edi,ebp
xor esi,ecx
ror ebx,7
add edi,eax
add edx,DWORD PTR 48[esp]
xor esi,ebx
mov ebp,edi
rol edi,5
add edx,esi
xor ebp,ebx
ror eax,7
DB 102,15,56,0,222
add edx,edi
add ecx,DWORD PTR 52[esp]
xor ebp,eax
mov esi,edx
paddd xmm2,xmm7
rol edx,5
add ecx,ebp
xor esi,eax
ror edi,7
movdqa XMMWORD PTR 32[esp],xmm2
add ecx,edx
add ebx,DWORD PTR 56[esp]
xor esi,edi
mov ebp,ecx
psubd xmm2,xmm7
rol ecx,5
add ebx,esi
xor ebp,edi
ror edx,7
add ebx,ecx
add eax,DWORD PTR 60[esp]
xor ebp,edx
mov esi,ebx
rol ebx,5
add eax,ebp
ror ecx,7
add eax,ebx
mov ebp,DWORD PTR 192[esp]
add eax,DWORD PTR [ebp]
add esi,DWORD PTR 4[ebp]
add ecx,DWORD PTR 8[ebp]
mov DWORD PTR [ebp],eax
add edx,DWORD PTR 12[ebp]
mov DWORD PTR 4[ebp],esi
add edi,DWORD PTR 16[ebp]
mov DWORD PTR 8[ebp],ecx
mov ebx,ecx
mov DWORD PTR 12[ebp],edx
xor ebx,edx
mov DWORD PTR 16[ebp],edi
mov ebp,esi
pshufd xmm4,xmm0,238
and esi,ebx
mov ebx,ebp
jmp $L006loop
ALIGN 16
$L007done:
add ebx,DWORD PTR 16[esp]
xor esi,edi
mov ebp,ecx
rol ecx,5
add ebx,esi
xor ebp,edi
ror edx,7
add ebx,ecx
add eax,DWORD PTR 20[esp]
xor ebp,edx
mov esi,ebx
rol ebx,5
add eax,ebp
xor esi,edx
ror ecx,7
add eax,ebx
add edi,DWORD PTR 24[esp]
xor esi,ecx
mov ebp,eax
rol eax,5
add edi,esi
xor ebp,ecx
ror ebx,7
add edi,eax
add edx,DWORD PTR 28[esp]
xor ebp,ebx
mov esi,edi
rol edi,5
add edx,ebp
xor esi,ebx
ror eax,7
add edx,edi
add ecx,DWORD PTR 32[esp]
xor esi,eax
mov ebp,edx
rol edx,5
add ecx,esi
xor ebp,eax
ror edi,7
add ecx,edx
add ebx,DWORD PTR 36[esp]
xor ebp,edi
mov esi,ecx
rol ecx,5
add ebx,ebp
xor esi,edi
ror edx,7
add ebx,ecx
add eax,DWORD PTR 40[esp]
xor esi,edx
mov ebp,ebx
rol ebx,5
add eax,esi
xor ebp,edx
ror ecx,7
add eax,ebx
add edi,DWORD PTR 44[esp]
xor ebp,ecx
mov esi,eax
rol eax,5
add edi,ebp
xor esi,ecx
ror ebx,7
add edi,eax
add edx,DWORD PTR 48[esp]
xor esi,ebx
mov ebp,edi
rol edi,5
add edx,esi
xor ebp,ebx
ror eax,7
add edx,edi
add ecx,DWORD PTR 52[esp]
xor ebp,eax
mov esi,edx
rol edx,5
add ecx,ebp
xor esi,eax
ror edi,7
add ecx,edx
add ebx,DWORD PTR 56[esp]
xor esi,edi
mov ebp,ecx
rol ecx,5
add ebx,esi
xor ebp,edi
ror edx,7
add ebx,ecx
add eax,DWORD PTR 60[esp]
xor ebp,edx
mov esi,ebx
rol ebx,5
add eax,ebp
ror ecx,7
add eax,ebx
mov ebp,DWORD PTR 192[esp]
add eax,DWORD PTR [ebp]
mov esp,DWORD PTR 204[esp]
add esi,DWORD PTR 4[ebp]
add ecx,DWORD PTR 8[ebp]
mov DWORD PTR [ebp],eax
add edx,DWORD PTR 12[ebp]
mov DWORD PTR 4[ebp],esi
add edi,DWORD PTR 16[ebp]
mov DWORD PTR 8[ebp],ecx
mov DWORD PTR 12[ebp],edx
mov DWORD PTR 16[ebp],edi
pop edi
pop esi
pop ebx
pop ebp
ret
__sha1_block_data_order_ssse3 ENDP
ALIGN 64
$LK_XX_XX::
DD 1518500249,1518500249,1518500249,1518500249
DD 1859775393,1859775393,1859775393,1859775393
DD 2400959708,2400959708,2400959708,2400959708
DD 3395469782,3395469782,3395469782,3395469782
DD 66051,67438087,134810123,202182159
DB 15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0
DB 83,72,65,49,32,98,108,111,99,107,32,116,114,97,110,115
DB 102,111,114,109,32,102,111,114,32,120,56,54,44,32,67,82
DB 89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112
DB 114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
.text$ ENDS
.bss SEGMENT 'BSS'
COMM _OPENSSL_ia32cap_P:DWORD:4
.bss ENDS
END
| 17.482232 | 61 | 0.706047 | [
"Apache-2.0"
] | 25H/miniblink49 | node/openssl/asm_obsolete/x86-win32-masm/sha/sha1-586.asm | 49,195 | Assembly |
;----------------------------------------------------------------------
; remove.asm - user-callable entry point to _unlink() function.
;----------------------------------------------------------------------
;
; C/C++ Run Time Library - Version 10.0
;
; Copyright (c) 1991, 2000 by Inprise Corporation
; All Rights Reserved.
;
; $Revision: 9.0 $
include rules.asi
include entry.inc
Entry@ remove, _unlink, _RTLENTRYF, 4
Entry@ _wremove, _wunlink, _RTLENTRYF, 4
end
| 27.947368 | 71 | 0.438795 | [
"MIT"
] | TrevorDArcyEvans/Diving-Magpie-Software | Borland/CBuilder5/Source/RTL/source/io/remove.asm | 531 | Assembly |
; A040357: Continued fraction for sqrt(377).
; 19,2,2,2,38,2,2,2,38,2,2,2,38,2,2,2,38,2,2,2,38,2,2,2,38,2,2,2,38,2,2,2,38,2,2,2,38,2,2,2,38,2,2,2,38,2,2,2,38,2,2,2,38,2,2,2,38,2,2,2,38,2,2,2,38,2,2,2,38,2,2,2,38,2,2,2,38,2,2,2,38,2,2,2
mov $5,2
mov $9,$0
lpb $5
mov $0,$9
sub $5,1
add $0,$5
sub $0,1
mov $7,$0
mov $0,36
mov $2,$7
add $2,10
mov $6,$7
div $6,4
mul $8,$3
lpb $0
sub $0,1
add $2,$6
lpe
add $2,8
mov $4,$5
add $8,$2
lpb $4
mov $1,$8
sub $4,1
lpe
lpe
lpb $9
sub $1,$8
mov $9,0
lpe
add $1,1
| 15.942857 | 190 | 0.508961 | [
"Apache-2.0"
] | jmorken/loda | programs/oeis/040/A040357.asm | 558 | Assembly |
; DEPRECATED
findFileEntry:
findDirectoryEntry:
ret
; END DEPRECATED
; NOTE: Should we replace this with "deleteNode" and have it work on directories, too?
;; deleteFile [Filesystem]
;; Deletes a file or symbolic link.
;; Inputs:
;; DE: Path to file (string pointer)
;; Outputs:
;; Z: Set if file was deleted, reset if file did not exist
;; A: Preserved on success, error code on failure
deleteFile:
push hl
push af
call findNode
jr nz, .error
push bc
ld b, a
ld a, i
push af
di
ld a, b
setBankA
; Check node type
ld a, (hl)
cp fsFile
jr z, .file
cp fsSymlink
jr z, .symlink
; TODO: Directories?
ld a, errNotAFile
jr .error
.symlink:
ld a, fsDeletedSymLink
jr .delete
.file:
ld a, fsDeletedFile
.delete:
; Perform actual deletion
call unlockFlash
call writeFlashByte
call lockFlash
pop af
jp po, _
ei
_: pop bc
pop af
pop hl
cp a
ret
.error:
ld h, a
pop af
or 1
ld a, h
pop hl
ret
;; fileExists [Filesystem]
;; Determines if a file exists.
;; Inputs:
;; DE: Path to file (string pointer)
;; Outputs:
;; Z: Set if file exists, reset if not
fileExists:
push hl
push af
call findNode ; TODO: Check if this node is a file
jr nz, _
pop af
pop hl
cp a
ret
_: ld h, a
pop af
or 1
ld a, h
pop hl
ret
;; directoryExists [Filesystem]
;; Determines if a directory exists.
;; Inputs:
;; DE: Path to directory (string pointer)
;; Outputs:
;; Z: Set if file exists, reset if not
directoryExists:
; Copy path to kernel ram, without trailing slash
push de
push af
push bc
push hl
push de
ex de, hl
xor a
ld b, a
ld c, a
cpir
; bc = -bc
xor a \ sub c \ ld c, a \ sbc a, a \ sub b \ ld b, a
dec bc
dec hl
dec hl
ld a, '/'
cp (hl)
jr nz,_
dec bc
_: pop hl
ld de, kernelGarbage+0x100
ldir
xor a
ld (de), a
pop hl
pop bc
pop af
ld de, kernelGarbage+0x100
call fileExists ; TODO: Check if this node is a directory
pop de
ret
;; listDirectory [Filesystem]
;; Lists the contents of a directory on the filesystem.
;; Inputs:
;; DE: Path to directory
;; HL: Callback
;; Outputs:
;; Z: Set on success, reset on failure
;; A: Error code on failure, preserved on success
;; Notes:
;; This function will call your callback every time it encounters a
;; relevant entry on the filesystem. You are free to use IX, IY, and
;; the shadow registers in this callback, but must preserve all other
;; registers. Your function will be called with the following state:
;;
;; * HL: Address of entry
;; * BC: Length of entry
;; * A: Type of entry
;; * kernelGarbage: Name of entry
;; * Correct page swapped into bank A
;; * Interrupts disabled (do not enable them)
;;
;; You must leave these registers intact.
listDirectory:
push af
ld a, i
push af
di
push de
push bc
push hl
push hl
call findNode ; TODO: Check if this node is a directory
;jr nz, .error ; TODO
ld bc, 0
call cpHLBC
call z, .correctForRoot
jr z, .loop
dec hl
ld c, (hl)
dec hl
ld b, (hl)
dec hl
; Grab directory ID
dec hl \ dec hl
ld e, (hl)
dec hl
ld d, (hl)
ex de, hl
ld (kernelGarbage + 0x100), hl
ex de, hl
inc hl \ inc hl
getBankA
ld (kernelGarbage + 0x102), a
inc hl
jr .skip
.loop:
ld a, (hl)
dec hl
ld c, (hl)
dec hl
ld b, (hl)
dec hl
cp fsFile
jr z, .handleFile
cp fsSymLink
jr z, .handleLink
cp fsDirectory
jr z, .handleDirectory
cp fsEndOfTable
jp z, .endOfTable
.skip:
or a
sbc hl, bc
; TODO: Handle swapping out next page
jr .loop
.handleFile:
.handleDirectory:
.handleLink:
push hl
push bc
ld c, (hl)
dec hl
ld b, (hl)
ld hl, (kernelGarbage + 0x100)
call cpHLBC
jr z, .matchingItem
pop bc
pop hl
jr .skip
.matchingItem:
pop bc
pop hl \ push hl
cp fsFile
jr z, .file
cp fsSymLink
jr z, .link
.directory:
ld bc, 5
jr .add
.file:
ld bc, 8
jr .add
.link:
ld bc, 3
.add:
or a
sbc hl, bc ; Move HL to first character of name
ld bc, kernelGarbage
_: ld a, (hl)
ld (bc), a
inc bc
dec hl
or a
jr nz, -_
pop bc
inc bc \ inc bc \ inc bc
ld a, (bc)
ld hl, .returnPoint
ex (sp), hl
push hl
ld h, b \ ld l, c
ret
.returnPoint:
pop hl \ push hl
push hl
ld h, b
ld l, c
ld a, (kernelGarbage + 0x102)
setBankA
dec hl
ld c, (hl)
dec hl
ld b, (hl)
dec hl
jp .skip
.endOfTable:
pop hl
pop hl
pop bc
pop de
pop af
jp po, _
ei
_: pop af
cp a
ret
.correctForRoot:
ld (kernelGarbage + 0x100), hl
ld hl, 0x7FFF
ld a, fatStart
setBankA
ld (kernelGarbage + 0x102), a
ret
; createFileEntry [Internal]
; Creates a new file entry in the FAT.
; Inputs:
; HL: File name
; DE: Parent ID
; ABC: Length
; IY: Section ID
; Outputs:
; Z: Set on success, reset on failure
; A: New entry Flash page (on success); Error code (on failure)
; HL: New entry address relative to 0x4000 (on success)
createFileEntry:
; TODO: Check for file name too long
push af
ld a, i
push af
di
push ix
ld ix, 0
add ix, sp
push hl
push de
push bc
call findFATEnd
jp nz, .endOfFilesystem
.endOfTable:
; Write new entry here
ld de, 0x3FFF
scf
push hl
sbc hl, de
ld b, h \ ld c, l
pop hl
; BC is space left in this FAT page
ld d, h \ ld e, l ; Save HL in DE
ld h, (ix + -1)
ld l, (ix + -2) ; Grab file name from stack
push bc
call strlen
inc bc ; Zero delimited
pop hl
push bc
ld a, 10
add c
ld c, a
jr nc, _
inc b
_: call cpHLBC
pop bc
jp c, .endOfFilesystem
; We're good to go, let's do this
; DE is the address in FAT (here, we'll modify it to be the end of the entry):
ex de, hl
scf
sbc hl, bc
push bc
scf
ld bc, 8
sbc hl, bc
pop bc
ex de, hl
; BC is the length of the filename
; Everything else is on the stack
; Let's build a new entry in kernelGarbage and then write it all at once
ld hl, kernelGarbage + 10
add hl, bc
ld a, fsFile
ld (hl), a ; Entry ID
dec hl
; Increase BC to full length of entry for a moment
push bc
ld a, 8
add c
ld c, a
jr nc, _
inc c
_: ; And write that length down
ld (hl), c
dec hl
ld (hl), b
dec hl
pop bc
; Write parent ID
ld a, (ix + -4)
ld (hl), a
dec hl
ld a, (ix + -3)
ld (hl), a
dec hl
; Write flags (0xFF, someone else can modify it later if they want)
ld a, 0xFF
ld (hl), a
dec hl
; File size
ld a, (ix + -6)
ld (hl), a
dec hl
ld a, (ix + -5)
ld (hl), a
dec hl
ld a, (ix + 5)
ld (hl), a
dec hl
; Section ID
push iy \ pop bc
ld (hl), c
dec hl
ld (hl), b
dec hl
ld b, (ix + -1)
ld c, (ix + -2) ; Grab file name from stack
push de
ld de, 0
.nameLoop:
ld a, (bc)
ld (hl), a
dec hl
inc bc
inc de
or a ; cp 0
jr nz, .nameLoop
ld b, d \ ld c, e
pop de
; Grab full length of entry
ld a, 11
add c
ld c, a
jr nc, _
inc b
_: ; Write to flash
inc hl
call unlockFlash
call writeFlashBuffer
call lockFlash
ex de, hl ; Return HL with file entry address
add hl, bc
dec hl
getBankA
ld (ix + 5), a ; And return A with Flash page
pop bc
pop de
inc sp \ inc sp ; Skip HL
pop ix
pop af
jp po, _
ei
_: pop af
cp a
ret
.endOfFilesystem:
pop bc
pop de
pop hl
pop af
jp po, _
ei
_: pop af
pop ix
or 1
ld a, errFilesystemFull
ret
; Internal function - finds the end of the FAT, swaps that page in, and leaves HL for you to use
findFATEnd:
push af
push bc
push de
; Find end of FAT
ld d, fatStart
ld a, d
setBankA
ld hl, 0x7FFF
.search:
ld a, (hl)
cp fsEndOfTable
jr z, .endOfTable
dec hl
ld c, (hl)
dec hl
ld b, (hl)
scf
sbc hl, bc ; Skip to next entry
ld a, 0x40
cp h
jr c, .search
; Swap in next page of FAT
dec d
ld a, d
cp fatStart - 4
jp z, .exitError
setBankA
ld hl, 0x7FFF
jr .search
.endOfTable:
pop de
pop bc
pop af
cp a
ret
.exitError:
pop de
pop bc
pop af
or 1
ret
; createDirectoryEntry [Internal]
; Creates a new directory entry in the FAT.
; Inputs:
; HL: Directory name
; DE: Parent ID
; Outputs:
; Z: Set on success, reset on failure
; A: New entry Flash page (on success); Error code (on failure)
; HL: New entry address relative to 0x4000 (on success)
createDirectoryEntry:
push ix
push af
ld a, i
push af
di
push bc
push de
push hl
ld ix, 0
add ix, sp
; Traverse the FAT
ld hl, 0
ld (kernelGarbage + kernelGarbageSize - 2), hl ; Working directory ID
ld a, fatStart
setBankA
ld hl, 0x7FFF
.search:
ld a, (hl)
cp fsEndOfTable
jr z, .endOfTable
dec hl
ld c, (hl)
dec hl
ld b, (hl)
dec hl
cp fsDirectory
jr z, .directory
.skip:
or a
sbc hl, bc ; Skip to next entry
ld a, 0x40
cp h
jr c, .search
; Swap in next page of FAT
dec d
ld a, d
cp fatStart - 4
jp z, .exitError
setBankA
ld hl, 0x7FFF
jr .search
.directory:
dec hl \ dec hl
ld e, (hl) \ dec hl
ld d, (hl) \ dec hl
push hl
ld hl, (kernelGarbage + kernelGarbageSize - 2)
or a
sbc hl, de
pop hl
jr z, .update
jr c, .update
jr .search
.update:
ex de, hl
inc hl
ld (kernelGarbage + kernelGarbageSize - 2), hl
ex de, hl
inc hl \ inc hl \ inc hl \ inc hl
jr .skip
.endOfTable:
; HL: Address of next entry in FAT
; end of kernel garbage: New directory ID
push hl
ld l, (ix + 0)
ld h, (ix + 1)
call strlen
ld hl, 6
add hl, bc
ld b, h \ ld c, l
pop hl
; BC: Length of new entry
ld de, kernelGarbage
ex de, hl
add hl, bc
inc hl \ inc hl
ld a, fsDirectory
ld (hl), a ; Entry type
dec hl
ld (hl), c ; Length of entry
dec hl
ld (hl), b ; cotd.
dec hl
ld c, (ix + 2)
ld b, (ix + 3)
ld (hl), c ; Parent ID
dec hl
ld (hl), b ; cotd.
dec hl
push hl
ld hl, (kernelGarbage + kernelGarbageSize - 2)
ld b, h \ ld c, l
pop hl
ld (hl), c ; New ID
dec hl
ld (hl), b ; cotd.
dec hl
ld a, 0xFF ; Flags
ld (hl), a
dec hl
ld c, (ix + 0)
ld b, (ix + 1) ; Grab file name from stack
push de
ld de, 0
.nameLoop:
ld a, (bc)
ld (hl), a
dec hl
inc bc
inc de
or a ; cp 0
jr nz, .nameLoop
ld b, d \ ld c, e
pop de
; Set BC to full length of entry
ld a, 8
add c
ld c, a
jr nc, _
inc b
_: ; Move DE to end of file entry
ex de, hl
or a
sbc hl, bc
ex de, hl
inc de
; Write new entry
inc hl
call unlockFlash
call writeFlashBuffer
call lockFlash
ex de, hl ; HL has file entry address
add hl, bc
dec hl
getBankA
ld (ix + 7), a ; Flash page in A (on stack)
inc sp \ inc sp ; Skip HL
pop de
pop bc
pop af
jp po, _
ei
_: pop af
pop ix
cp a
ret
.exitError:
pop hl
pop de
pop bc
pop af
pop ix
or 1
ld a, errFilesystemFull
ret
;; createDirectory [Filesystem]
;; Creates a new directory in the filesystem and returns information about the new
;; filesystem entry.
;; Inputs:
;; DE: Path to new directory
;; Outputs:
;; Z: Set on success, reset on failure
;; A: Flash page (on success); Error code (on failure)
;; HL: Address relative to 0x4000 (on success)
createDirectory:
call findNode
jr nz, _
or 1
ld a, errAlreadyExists
ret
_: push af
ld a, i
push af
di
push de
push hl
; Move string to RAM
push bc
ld h, d \ ld l, e
ld bc, 0x8000
scf
sbc hl, bc
jr nc, _ ; It's already in RAM
ld h, d \ ld l, e
call strlen
ld de, kernelGarbage + 10 ; + 10 gets us past what findDirectoryEntry uses
ldir
ld de, kernelGarbage + 10
_: pop bc
ld hl, 0
ld a, (de)
cp '/' ; Skip leading / (todo: working directories, see issue 75)
jr nz, _
inc de
_: push de
call checkForRemainingSlashes
pop de
ex de, hl
jr z, .createRootEntry
; Find parent directory
push bc
xor a
ld d, h \ ld e, l
ld bc, 0
cpir
dec hl
ld a, '/'
ld bc, 0
cpdr
inc hl
xor a
ld (hl), a ; Remove final '/'
push hl
call findNode ; TODO: Make sure this node is a directory
jr nz, .error
ld bc, 4
scf
sbc hl, bc ; Skip some stuff we don't need
ld e, (hl)
dec hl
ld d, (hl)
pop hl
ld a, '/'
ld (hl), a ; Replace / in path
inc hl ; HL is name of new directory
pop bc
jr .createEntry
.createRootEntry:
ld de, 0
.createEntry:
call createDirectoryEntry
jr nz, .error2
inc sp \ inc sp ; pop hl
pop de
pop af
jp po, _
ei
_: pop af
cp a
ret
.error:
pop hl
pop bc
pop hl
pop de
pop af
jp po, _
ei
_: pop af
or 1
ld a, errFileNotFound
ret
.error2:
inc sp \ inc sp ; pop hl
pop de
pop af
jp po, _
ei
_: pop af
or 1
ld a, errFilesystemFull
ret
; findNode
; Finds a node in the FAT.
; Inputs:
; DE: Path to node (string pointer)
; Outputs:
; Z: Set on success, reset on failure
; A: Flash page (on success); error code (on failure)
; HL: Address relative to 0x4000 (on success)
; Notes:
; This works for any node - file, directory, symlink, etc. The rest of the
; logic is up to you.
;
; '/' is a special node and does not actually exist in the filesystem. If you call
; findNode with "/" you'll get HL=0.
findNode:
push de
push bc
push af
ld a, i
push af
di
.startOver:
; Skip initial / if present
; TODO: Allow for relative paths somehow
ld a, (de)
cp '/'
jr nz, .proceed
inc de
ld a, (de)
or a
jr nz, .proceed
; Special case for /
pop af
jp po, _
ei
_: pop af
ld a, b
pop bc
pop de
cp a
ld hl, 0
ret
.proceed:
setBankA(fatStart)
ld hl, 0
ld (kernelGarbage), hl ; Used as temporary storage of parent directory ID
ld hl, 0x7FFF
push af
push de \ call checkForRemainingSlashes \ pop de
jp z, findNode_fileLoop
_: ld a, (hl)
dec hl \ ld c, (hl) \ dec hl \ ld b, (hl) \ dec hl
cp fsDirectory
jr z, .handleDirectory
cp fsSymLink ; TODO: Symlinks to directories?
cp fsEndOfTable
jr z, findNode_handleEndOfTable
.continueSearch:
or a
sbc hl, bc
; TODO: Handle running off the page
jr -_
.handleDirectory:
push bc
push hl
ld c, (hl) \ dec hl \ ld b, (hl)
ld hl, (kernelGarbage)
call cpHLBC
jr z, .compareNames
; Not correct parent
pop hl
pop bc
jr .continueSearch
.compareNames:
pop hl \ push hl
ld bc, 5
or a
sbc hl, bc
push de
call compareFileStrings
jr z, .updateDirectory
pop de
pop hl
pop bc
jr .continueSearch
.updateDirectory:
inc sp \ inc sp
inc de
push de \ call checkForRemainingSlashes \ pop de
pop hl \ push hl
dec hl \ dec hl
ld c, (hl) \ dec hl \ ld b, (hl)
ld h, b \ ld l, c
ld (kernelGarbage), hl
pop hl
pop bc
jr nz, .continueSearch
or a
sbc hl, bc
jr findNode_fileLoop
findNode_handleEndOfTable:
pop af
pop af
jp po, _
ei
_: pop af
ld a, errFileNotFound
or a ; Resets z
pop bc
pop de
ret
findNode_fileLoop:
; Run once we've eliminated all slashes in the path
_: ld a, (hl)
dec hl \ ld c, (hl) \ dec hl \ ld b, (hl) \ dec hl
cp fsFile
jr z, .handleEntry
cp fsDirectory
jr z, .handleEntry
cp fsSymLink
jr z, .handleEntry
cp fsEndOfTable
jr z, findNode_handleEndOfTable
.continueSearch:
or a
sbc hl, bc
jr -_
.handleEntry:
push bc
push hl
; Check parent ID
ld c, (hl) \ dec hl \ ld b, (hl) \ dec hl
ld hl, (kernelGarbage)
call cpHLBC
jr z, .parentMatch
pop hl
pop bc
jr .continueSearch
; These just load BC with the number of bytes to skip to get the node name
.fileMetadata:
ld bc, 8
ret
.dirMetadata:
ld bc, 5
ret
.linkMetadata:
ld bc, 3
ret
; Back to normal now
.parentMatch:
pop hl \ push hl
cp fsFile
call z, .fileMetadata
cp fsDirectory
call z, .dirMetadata
cp fsSymLink
call z, .linkMetadata
scf \ ccf
sbc hl, bc
push de
call compareFileStrings
pop de
pop hl
pop bc
jr nz, .continueSearch
; Return this entry, all done
ld bc, 3
add hl, bc
pop bc ; pop af (with current FAT page)
pop af
jp po, _
ei
_: pop af
ld a, b
pop bc
pop de
cp a
ret
;; fixKFS [Filesystem]
;; Fixes issues found from [[checkFilesystem]]
fixKFS:
; TODO
ret
;; checkFilesystem [Filesystem]
;; Checks the integrity of the filesystem and sets certain bits of A with the results.
;; Outputs:
;; A=0: No problems
;; A/1: Unformatted pages found
;; A/2: Invalid FAT entries found
;; A/3: Invalid heap blocks found
;; A/4: Unclosed new file entries found
;; Notes:
;; Passing A into [[fixFilesystem]] is the appropriate course of action if A is nonzero.
checkKFS:
; TODO
ret
; Checks string at (DE) for '/'
; Z for no slashes, NZ for slashes
; If the slash is the last character of the string, it's not considered
checkForRemainingSlashes:
ld a, (de)
or a ; CP 0
ret z
cp '/'
jr z, .found
inc de
jr checkForRemainingSlashes
.found:
; Check for one last slash
inc de
ld a, (de)
or a
ret
; Compare File Strings (HL is reverse)
; Z for equal, NZ for not equal
; Inputs: HL and DE are strings to compare
compareFileStrings:
ld a, (de)
or a
jr z, .return
cp ' ' ; TODO: Why is this here? Spaces are not file name delimiters
jr z, .return
cp '/'
jr z, .return
cp (hl)
ret nz
dec hl
inc de
jr compareFileStrings
.return:
ld a, (hl)
or a
ret
;; renameFile [Filesystem]
;; Renames a file.
;; Inputs:
;; DE: Path to file (string pointer)
;; HL: New filename
;; Outputs:
;; Z: Set if the file was renamed, reset if file did not exist
;; A: Preserved on success, error code on failure
renameFile:
push hl \ push ix \ push bc \ push de \ push iy
push af
ld a, i
push af
push hl
; Set the filetype to indicate the file's modified
call findNode ; TODO: Confirm that this is a file node
jr nz, .notFound
setBankA
di
ld a, fsModifiedFile
call unlockFlash
call writeFlashByte
call lockFlash
push hl \ pop ix
pop hl
; Copy everything but the filename to a new entry
ld e, (ix + -3)
ld d, (ix + -4)
ld c, (ix + -6)
ld b, (ix + -7)
ld a, (ix + -9) \ ld iyl, a
ld a, (ix + -10) \ ld iyh, a
ld a, (ix + -8)
call createFileEntry
pop af
jp po, _
ei
_: pop af
cp a
jr .done
.notFound:
pop hl
ld h, a
pop af
jp po, _
ei
_: pop af
or 1
ld a, h
.done:
pop iy \ pop de \ pop bc \ pop ix \ pop hl
ret
;; createSymLink [Filesystem]
;; Creates a symbolic link.
;; Inputs:
;; DE: Path to new symlink
;; HL: Path to target
;; Outputs:
;; Z: Set on success, reset on failure
;; A: Flash page (on success); error code (on failure)
;; HL: Address relative to 0x4000 (on success)
createSymLink:
; Check if node already exists
ld a, 1
or a ; Reset Z
push hl
call findNode
jr nz, _
inc sp \ inc sp
or 1
ld a, errAlreadyExists
ret
; Disable interrupts
_: pop hl
push af
ld a, i
push af
di
push bc
push de
push hl
push ix
; push target
push hl
; Seperate file path into dir and filename
; Inputs:
; DE: Path string pointer
; Outputs:
; BC: Pointer to last /
push de
.loop:
ld a, (de)
or a
jr z, .done
cp '/'
jr nz, _
push de \ pop bc
_: inc de
jr .loop
.done:
pop de
; push pointer to last /
push bc
; get length of parent dir
ld a, c
sub e
ld c, a
ld a, b
sbc d
ld b, a
; copy parent dir to kernel garbage
; TODO: Make sure this spot is safe
push de \ pop hl
ld de, kernelGarbage + 0x100
ldir
xor a
ld (de), a
; findNode parent dir, error if not found
ld de, kernelGarbage + 0x100
call findNode
jp nz, .dirNotFound
; Begin creating new FS entry
; IX = buffer in kernel ram
ld ix, kernelGarbage + 0x100
; Write symlink identifier
ld (ix), fsSymLink
dec ix
; Skip entry size until later
dec ix
dec ix
; write parent ID
dec hl
dec hl
dec hl
dec hl
dec hl
ld a, (hl)
ld (ix), a
dec hl
dec ix
ld a, (hl)
ld (ix), a
dec ix
; pop pointer to last /
pop hl
push hl \ pop de
; count length of filename
ld bc, 0
_: inc c
inc de
ld a, (de)
or a
jr nz, -_
; TODO: Error if length of filename is 0
; write length of filename
ld (ix), c
; write filename
_: inc hl
dec ix
ld a, (hl)
ld (ix), a
dec c
ld a, c
or a
jr nz, -_
dec ix
; pop and write target
; TODO: Error if target length is 0
pop hl
_: ld a, (hl)
ld (ix), a
dec ix
inc hl
or a
jr nz, -_
; sub IX from start of buffer to get entry length
push ix \ pop hl
ld bc, kernelGarbage + 0x0FD
ld a, c
sub l
ld c, a
ld a, b
sbc h
ld b, a
; write entry length to buffer-1
ld hl, kernelGarbage + 0x0FF
ld (hl), c
dec hl
ld (hl), b
; get location of next entry in FS table
call findFATEnd
; error if no more room in table
jr nz, .fatFull
; subtract entry length from end of FAT
inc bc
inc bc
inc bc
ld a, l
sub c
ld l, a
ld a, h
sbc b
ld h, a
; Check for end of flash page
; TODO: Stradle flash pages
push bc
ld bc, 0x4000
call cpHLBC
pop bc
jp c, .fatFull
; write entry to flash
call unlockFlash
inc ix
push ix \ pop de
ex de, hl
inc de
call writeFlashBuffer
call lockFlash
; Return HL with file entry address
ex de, hl
add hl, bc
dec hl
; and return A with flash page
getBankA
ld (ix + 5), a
pop ix
inc sp \ inc sp ; Skip HL
pop de
pop bc
; Restore interrupts
pop af
jp po, _
ei
_: pop af
cp a
ret
.dirNotFound:
; pop pointer to last /
pop bc
; pop target
pop hl
pop ix
pop hl
pop de
pop bc
pop af
jp po, _
_: pop af
or 1
ld a, errFileNotFound
ret
.fatFull:
pop ix
pop hl
pop de
pop bc
pop af
jp po, _
_: pop af
or 1
ld a, errFilesystemFull
ret
| 22.753145 | 96 | 0.463306 | [
"MIT"
] | KnightOS/kernel | src/00/filesystem.asm | 28,942 | Assembly |
;By Arun Kumar Shreevastava
;exeve("/bin/cat", {"/bin/cat","/etc/passwd",NULL}, NULL)
BITS 32
global _start
section .text
_start:
;push /bin/cat
xor eax,eax
push eax
push 0x7461632f ;tac/
push 0x6e69622f ;nib/
mov ebx, esp
;push args
push eax
push 0x64777373 ;dwss
push 0x61702f63 ;ap/c
push 0x74652f2f ;te//
mov ecx, esp ;temp save the pointer
push eax ;NULL
push ecx ;pointer to 2nd args
push ebx ;pointer to 1st args
mov ecx, esp
push eax
mov edx,esp
mov al,11
int 0x80
| 14.457143 | 57 | 0.6917 | [
"MIT"
] | arunKumarNOP/shellcodes | etc_passwd/etcPasswd.asm | 506 | Assembly |
;#-------------------------------------------------ß
;| x64lab MPL 2.0 License |
;| Copyright (c) 2009-2012, Marc Rainer Kranz. |
;| All rights reserved. |
;ö-------------------------------------------------ä
;#-------------------------------------------------ß
;| uft-8 encoded üäöß
;| update:
;| filename:
;ö-------------------------------------------------ä
apiw:
;#---------------------------------------------------ö
;| COMMON PROLOG EPILOG |
;ö---------------------------------------------------ü
.prologI:
;--- call to interfaces
;--- RCX = always this
;--- RAX = proc
;--- RDX/R8/R9/R10/R11 paras (isnt it enough !?)
mov rax,[rax]
.prologP:
;--- max 2 pushes in R10,R11
push rbp
mov rbp,rsp
and rsp,-16
.prologQ:
push r11
push r10
jmp .epilog0
.prolog1:
pop rax
.prolog0:
push rbp
mov rbp,rsp
and rsp,-16
.epilog0:
sub rsp,20h
call rax
.epilog1:
mov rsp,rbp
pop rbp
ret 0
.epilog2:
;--- in RDX num pushed * 8
mov rcx,[rbp+8]
mov rsp,rbp
pop rbp
add rsp,rdx
jmp rcx
@using .mnu_del
.mnu_del:
mov rax,[DeleteMenu]
jmp .prolog0
@endusing
@using .mnu_create
.mnu_create:
mov rax,[CreateMenu]
jmp .prolog0
@endusing
@using .mnu_set
.mnu_set:
mov rax,[SetMenu]
jmp .prolog0
@endusing
@using .mnu_setinfo
.mnu_setinfo:
mov rax,[SetMenuInfo]
jmp .prolog0
@endusing
@using .mnu_getinfo
.mnu_getinfo:
mov rax,[GetMenuInfo]
jmp .prolog0
@endusing
@using .mnp_create
.mnp_create:
mov rax,[CreatePopupMenu]
jmp .prolog0
@endusing
@using .mnu_destroy
.mnu_destroy:
mov rax,[DestroyMenu]
jmp .prolog0
@endusing
;--------------------------------
@using .mni_set_byid
.mni_set_byid:
push 0
mov [r9+\
MENUITEMINFOW.wID],edx
jmp .mni_set
@endusing
@using .mni_set_bypos
.mni_set_bypos:
push 1
jmp .mni_set
@endusing
;;--------------------------------
@using .mni_get_byid
.mni_get_byid:
push 0
mov [r9+\
MENUITEMINFOW.wID],edx
jmp .mni_get
@endusing
@using .mni_get_bypos
.mni_get_bypos:
push 1
jmp .mni_get
@endusing
;--------------------------------
@using .mni_ins_bypos,\
.mni_ins_byid,\
.mni_set_byid,\
.mni_set_bypos,\
.mni_get_byid,\
.mni_get_bypos
.mni_ins_byid:
or r8,-1
mov [r9+\
MENUITEMINFOW.wID],edx
jmp .mni_do
.mni_set:
pop r8
mov rax,[SetMenuItemInfoW]
jmp .mni_doA
.mni_get:
pop r8
mov rax,[GetMenuItemInfoW]
jmp .mni_doA
.mni_ins_bypos:
xor r8,r8
.mni_do:
inc r8
mov rax,[InsertMenuItemW]
.mni_doA:
mov [r9+\
MENUITEMINFOW.cbSize],\
sizeof.MENUITEMINFOW
jmp .prolog0
@endusing
@using .mnu_loadi
.mnu_loadi:
mov rax,[LoadMenuIndirectW]
jmp .prolog0
@endusing
@using .mnu_load
.mnu_load:
mov rax,[LoadMenuW]
jmp .prolog0
@endusing
@using .get_submnu
.get_submnu:
mov rax,[GetSubMenu]
jmp .prolog0
@endusing
@using .mnu_draw
.mnu_draw:
mov rax,[DrawMenuBar]
jmp .prolog0
@endusing
@using .get_mnuicount
.get_mnuicount:
mov rax,[GetMenuItemCount]
jmp .prolog0
@endusing
@using .track_pmnu
.track_pmnu:
push rbp
mov rbp,rsp
xor eax,eax
and rsp,-16
sub rsp,40h
mov [rsp+20h],rax
mov [rsp+28h],r10
mov [rsp+30h],r11
;--- in RCX hMenu
;--- in RDX uFlags
;--- in R8 x
;--- in R9 y
;--- in R10 hwnd
;--- in R11 rect
;--- original --------------------------
;--- in RCX hMenu
;--- in RDX uFlags
;--- in R8 x horz pos, in screen coord
;--- in R9 y vert pos, in screen coord
;--- in R10 nReserved
;--- in R11 hWnd handle of owner window
;--- in RSP prcRect RECT no-dismissal area
call [TrackPopupMenu]
jmp .epilog1
@endusing
;#---------------------------------------------------ö
;| THEMES |
;ö---------------------------------------------------ü
@using .th_open
.th_open:
mov rax,[OpenThemeData]
jmp .prolog0
@endusing
@using .th_close
.th_close:
mov rax,[CloseThemeData]
jmp .prolog0
@endusing
@using .th_drawbkg
.th_drawbkg:
mov rax,[DrawThemeBackground]
jmp .prologP
@endusing
;#---------------------------------------------------ö
;| ENV and VARIALBLES |
;ö---------------------------------------------------ü
@using .set_env
;IN RCX = envname
;IN RDX = envvalue
.set_env:
mov rax,[SetEnvironmentVariableW]
jmp .prolog0
@endusing
@using .get_env
;IN RCX = envname
;IN RDX = envvalue
;IN R8 = maxsize
.get_env:
mov rax,[GetEnvironmentVariableW]
jmp .prolog0
@endusing
@using .exp_env
; ;--- IN RCX str %variableName%
; ;--- IN RDX output
; ;--- RET EAX copied cpts
; ;--- RET ECX str variable
; ;--- RET EDX output
.exp_env:
push rcx
push rdx
mov rax,[ExpandEnvironmentStringsW]
mov r8,MAX_UTF16_FILE_CPTS
call .prolog0
pop rdx
pop rcx
ret 0
; mov rax,[ExpandEnvironmentStringsW]
; jmp .prolog0
@endusing
@using .set_wl
.set_wl:
;--- IN RCX hwnd
;--- IN RDX index
mov rax,[SetWindowLongPtrW]
jmp .prolog0
@endusing
@using .set_wlproc
.set_wlproc:
mov rdx,GWL_WNDPROC
jmp .set_wl
@endusing
@using .set_wlxstyle
.set_wlxstyle:
mov rdx,GWLP_EXSTYLE
jmp .set_wl
@endusing
@using .set_wlstyle
.set_wlstyle:
mov rdx,GWLP_STYLE
jmp .set_wl
@endusing
@using .set_wldata
.set_wldata:
mov rdx,GWLP_USERDATA
jmp .set_wl
@endusing
@using .get_wl
.get_wl:
;--- IN RCX hwnd
;--- IN RDX index
mov rax,[GetWindowLongPtrW]
jmp .prolog0
@endusing
@using .get_wlstyle
.get_wlstyle:
;--- in RCX hwnd
mov rdx,GWLP_STYLE
jmp .get_wl
@endusing
@using .get_wldata
.get_wldata:
;--- in RCX hwnd
mov rdx,GWLP_USERDATA
jmp .get_wl
@endusing
;#---------------------------------------------------ö
;| LOADLIB /FREELIB |
;ö---------------------------------------------------ü
@using .get_modfname
.get_modfname:
;--- in RCX hModule/0
;--- in RDX buffer path/filename
;--- in R8 buffersize
mov rax,[GetModuleFileNameW]
jmp .prolog0
@endusing
@using .get_modh
.get_modh:
;--- in RCX module name
mov rax,[GetModuleHandleW]
jmp .prolog0
@endusing
@using .freelib_exitt
.freelib_exitt:
mov rax,[FreeLibraryAndExitThread]
jmp .loadlibB
@endusing
@using .freelib
.freelib:
;--- in RCX hModule
mov rax,[FreeLibrary]
jmp .prolog0
@endusing
@using .loadlib
.loadlib:
;in RDX = 0/flags
;in RCX = path/filename
xchg rdx,r8
mov rax,[LoadLibraryExW]
xor rdx,rdx
jmp .prolog0
@endusing
;ü------------------------------------------ö
;| file or directory |
;#------------------------------------------ä
@using .set_curdir
.set_curdir:
;--- in RCX path
mov rax,[SetCurrentDirectoryW]
jmp .prolog0
@endusing
@using .get_curdir
.get_curdir:
;--- in RCX len buffer
;--- in RDX buffer
mov rax,[GetCurrentDirectoryW]
jmp .prolog0
@endusing
@using .createdir
.createdir:
;--- in RCX pathname
;--- in RDX securityattr
mov rax,[CreateDirectoryW]
jmp .prolog0
@endusing
@using .copyf
.copyf:
mov rax,[CopyFileW]
jmp .prolog0
@endusing
;ü------------------------------------------ö
;| thread and process |
;#------------------------------------------ä
@using .tproc
;--- in RCX pAddress
;--- in RDX stacksize
;--- in R8 params
.tproc:
mov rax,[_beginthread]
jmp .prolog0
@endusing
@using .exitp
.exitp:
mov rax,[ExitProcess]
jmp .prolog0
@endusing
;ü------------------------------------------ö
;| GDI etc |
;#------------------------------------------ä
@using .beg_paint
.beg_paint:
mov rax,[BeginPaint]
jmp .prolog0
@endusing
@using .create_compbmp
.create_compbmp:
mov rax,[CreateCompatibleBitmap]
jmp .prolog0
@endusing
@using .create_bmp
.create_bmp:
xor r11,r11
mov rax,[CreateBitmap]
jmp .prologP
@endusing
@using .create_compdc
.create_compdc:
mov rax,[CreateCompatibleDC]
jmp .prolog0
@endusing
@using .create_sbrush
.create_sbrush:
mov rax,[CreateSolidBrush]
jmp .prolog0
@endusing
@using .create_pbrush
.create_pbrush:
mov rax,[CreatePatternBrush]
jmp .prolog0
@endusing
@using .delobj
.delobj:
mov rax,[DeleteObject]
jmp .prologP
@endusing
@using .draw_edge
.draw_edge:
mov rax,[DrawEdge]
jmp .prolog0
@endusing
@using .draw_fctrl
.draw_fctrl:
mov rax,[DrawFrameControl]
jmp .prolog0
@endusing
@using .get_dc
.get_dc:
mov rax,[GetDC]
jmp .prolog0
@endusing
@using .get_txtmetr
.get_txtmetr:
mov rax,[GetTextMetricsW]
jmp .prolog0
@endusing
@using .get_devcaps
.get_devcaps:
mov rax,[GetDeviceCaps]
jmp .prolog0
@endusing
@using .rel_dc
.rel_dc:
mov rax,[ReleaseDC]
jmp .prolog0
@endusing
@using .patblt
;--- in RCX hdc
;--- in RDX nXLeft
;--- in R8 nYLeft
;--- in R9 nWidth
;--- in R10 nHeight
;--- in R11 dwRop
.patblt:
mov rax,[PatBlt]
jmp .prologP
@endusing
@using .cfonti
.cfonti:
mov rax,[CreateFontIndirectW]
jmp .prolog0
@endusing
;--- ;--- in RCX bold-wi-hi <----
;--- ;--- in RDX st-un-it-ch <---
;--- ;--- in R8 font name
;--- ;--- in R9 pitch
;--- sub rsp,sizea16.LOGFONTW
;--- movzx eax,cl
;--- mov [rsp+LOGFONTW.lfHeight],eax
;--- movzx eax,ch
;--- mov [rsp+LOGFONTW.lfWidth],eax
;--- xor eax,eax
;--- shr rcx,16
;--- mov [rsp+LOGFONTW.lfEscapement],eax
;--- mov [rsp+LOGFONTW.lfOrientation],eax
;--- mov [rsp+LOGFONTW.lfWeight],ecx
;--- ;-------------------------------------
;--- mov [rsp+LOGFONTW.lfCharSet],dl
;--- mov [rsp+LOGFONTW.lfItalic],dh
;--- shr edx,16
;--- mov [rsp+LOGFONTW.lfUnderline],dl
;--- mov [rsp+LOGFONTW.lfStrikeOut],dh
;--- ;-------------------------------------
;--- or r9,FF_DONTCARE
;--- mov [rsp+LOGFONTW.lfPitchAndFamily],\
;--- r9l
;---; DEFAULT_PITCH or FF_DONTCARE
;--- mov [rsp+LOGFONTW.lfOutPrecision],\
;--- OUT_DEFAULT_PRECIS
;--- mov [rsp+LOGFONTW.lfClipPrecision],\
;--- CLIP_DEFAULT_PRECIS
;--- mov [rsp+LOGFONTW.lfQuality],\
;--- DEFAULT_QUALITY
;--- mov r9,rdi
;--- xchg r8,rsi
;--- lea rdi,[rsp+LOGFONTW.lfFaceName]
;---@@:
;--- lodsw
;--- stosw
;--- test ax,ax
;--- jnz @b
;--- xchg r9,rdi
;--- xchg r8,rsi
;--- mov rcx,rsp
;--- mov rax,[CreateFontIndirectW]
;--- call .prolog0
;--- add rsp,sizea16.LOGFONTW
;--- ret 0
;---@endusing
@using .get_tep32
; in R9 LPSIZE lpSize // address of structure for string size
; in R8 cbString
; in RDX lpString
; in RCX hdc
.get_tep32:
mov rax,[GetTextExtentPoint32W]
jmp .prolog0
@endusing
@using .selobj
.selobj:
mov rax,[SelectObject]
jmp .prologP
@endusing
@using .excl_cliprect
.excl_cliprect:
mov rax,[ExcludeClipRect]
jmp .prologP
@endusing
@using .get_syscol
.get_syscol:
mov rax,[GetSysColor]
jmp .prolog0
@endusing
@using .get_stockobj
.get_stockobj:
mov rax,[GetStockObject]
jmp .prolog0
@endusing
@using .get_syscolbr
.get_syscolbr:
mov rax,[GetSysColorBrush]
jmp .prolog0
@endusing
@using .sysparinfo
.sysparinfo:
mov rax,[SystemParametersInfoW]
jmp .prolog0
@endusing
@using .get_sysmet
.get_sysmet:
mov rax,[GetSystemMetrics]
jmp .prolog0
@endusing
@using .invrect
.invrect:
mov rax,[InvalidateRect]
jmp .prolog0
@endusing
@using .scr2cli
.scr2cli:
;--- in RCX hwnd
;--- in RDX point
mov rax,[ScreenToClient]
jmp .prolog0
@endusing
@using .cli2scr
.cli2scr:
;--- in RCX hwnd
;--- in RDX point
mov rax,[ClientToScreen]
jmp .prolog0
@endusing
@using .get_clirect
.get_clirect:
;--- in RCX hwnd
;--- in RDX pRect
mov rax,[GetClientRect]
jmp .prolog0
@endusing
@using .get_winrect
.get_winrect:
;--- in RCX hwnd
;--- in RDX pRect
mov rax,[GetWindowRect]
jmp .prolog0
@endusing
@using .get_winplacem
.get_winplacem:
;--- in RCX hwnd
;--- in RDX struct
mov rax,[GetWindowPlacement]
jmp .prolog0
@endusing
@using .get_curspos
;--- in RCX LPPOINT
.get_curspos:
mov rax,[GetCursorPos]
jmp .prolog0
@endusing
@using .set_curspos
.set_curspos:
mov rax,[SetCursorPos]
jmp .prolog0
@endusing
@using .map_wpt
;--- RCX/RDX/R8/R9
.map_wpt:
mov rax,[MapWindowPoints]
jmp .prolog0
@endusing
@using .end_paint
.end_paint:
mov rax,[EndPaint]
jmp .prolog0
@endusing
@using .fillrect
.fillrect:
mov rax,[FillRect]
jmp .prolog0
@endusing
@using .set_bkmode
.set_bkmode:
mov rax,[SetBkMode]
jmp .prolog0
@endusing
@using .set_bkcol
.set_bkcol:
mov rax,[SetBkColor]
jmp .prolog0
@endusing
@using .set_txtcol
.set_txtcol:
mov rax,[SetTextColor]
jmp .prolog0
@endusing
;ü------------------------------------------ö
;| window managing |
;#------------------------------------------ä
@using .beg_defwpos
.beg_defwpos:
mov rax,[BeginDeferWindowPos]
jmp .prolog0
@endusing
@using .chwinfptx
.chwinfptx:
mov rax,[ChildWindowFromPointEx]
jmp .prolog0
@endusing
@using .en_win
.en_win:
mov rax,[EnableWindow]
jmp .prolog0
@endusing
@using .end_defwpos
.end_defwpos:
mov rax,[EndDeferWindowPos]
jmp .prolog0
@endusing
@using .enum_cwin
.enum_cwin:
mov rax,[EnumChildWindows]
jmp .prolog0
@endusing
@using .set_lwattr
.set_lwattr:
mov rax,[SetLayeredWindowAttributes]
jmp .prolog0
@endusing
@using .set_focus
.set_focus:
mov rax,[SetFocus]
jmp .prolog0
@endusing
@using .redraw_win
.redraw_win:
mov rax,[RedrawWindow]
jmp .prolog0
@endusing
@using .regcls
.regcls:
mov rax,[RegisterClassExW]
jmp .prolog0
@endusing
@using .unregcls
.unregcls:
mov rax,[UnregisterClassW]
jmp .prolog0
@endusing
@using .set_wpos
;--- in RCX hWnd
;--- in RDX hWndInsertAfter
;--- in R8 X
;--- in R9 Y
;--- in r10 cx
;--- in R11 cy
;--- in RAX uFlags
.set_wpos:
push rbp
mov rbp,rsp
and rsp,-16
push 0
push rax
push r11
push r10
mov rax,[SetWindowPos]
jmp .epilog0
@endusing
@using .cwinex
.cwinex:
push rbp
mov rbp,rsp
and rsp,-16
push qword[rbp+104]
push qword[rbp+96]
push qword[rbp+88]
push qword[rbp+80]
push qword[rbp+72]
push qword[rbp+64]
push qword[rbp+56]
push qword[rbp+48]
sub rsp,20h
mov r9,[rbp+40]
mov r8,[rbp+32]
mov rdx,[rbp+24]
mov rcx,[rbp+16]
call [CreateWindowExW]
mov edx,12*8+8
jmp .epilog2
@endusing
@using .is_win
.is_win:
mov rax,[IsWindow]
jmp .prolog0
@endusing
@using .set_capt
.set_capt:
mov rax,[SetCapture]
jmp .prolog0
@endusing
@using .rel_capt
.rel_capt:
mov rax,[ReleaseCapture]
jmp .prolog0
@endusing
@using .set_parent
.set_parent:
;--- in RDX new parent
;--- in RCX our hwnd
mov rax,[SetParent]
jmp .prolog0
@endusing
@using .destroy
.destroy:
mov rax,[DestroyWindow]
jmp .prolog0
@endusing
@using .show
.show:
mov rax,[ShowWindow]
jmp .prolog0
@endusing
@using .update
.update:
mov rax,[UpdateWindow]
jmp .prolog0
@endusing
@using .animate
;--- in RCX hwnd
;--- in RDX timer
;--- in R8 flags
.animate:
mov rax,[AnimateWindow]
jmp .prolog0
@endusing
;ü------------------------------------------ö
;| USER |
;#------------------------------------------ä
@using .destr_icon
.destr_icon:
mov rax,[DestroyIcon]
jmp .prolog0
@endusing
@using .ddetect
.ddetect:
mov rax,[DragDetect]
jmp .prolog0
@endusing
@using .drawtext
.drawtext:
xor r11,r11
mov rax,[DrawTextW]
jmp .prologP
@endusing
@using .movewin
.movewin:
mov rax,[MoveWindow]
jmp .prologP
@endusing
@using .get_win
.get_win:
mov rax,[GetWindow]
jmp .prolog0
@endusing
@using .drawstt
.drawstt:
mov rax,[DrawStatusTextW]
jmp .prolog0
@endusing
@using .get_curs
.get_curs:
mov rax,[GetCursor]
jmp .prolog0
@endusing
@using .loadcurs
.loadcurs:
mov rax,[LoadCursorW]
jmp .prolog0
@endusing
@using .get_dlgbu
.get_dlgbu:
mov rax,[GetDialogBaseUnits]
jmp .prolog0
@endusing
@using .sms
.sms:
mov rax,[SendMessageW]
jmp .prolog0
@endusing
@using .pms
.pms:
mov rax,[PostMessageW]
jmp .prolog0
@endusing
@using .snms
.snms:
mov rax,[SendNotifyMessageW]
jmp .prolog0
@endusing
;ü------------------------------------------ö
;| RESOURCES |
;#------------------------------------------ä
@using .icex
;--- in RCX flags
.icex:
push rbp
mov rbp,rsp
and rsp,-16
sub rsp,\
sizea16.INITCOMMONCONTROLSEX
mov rdx,rsp
mov rax,\
[InitCommonControlsEx]
mov [rsp+INITCOMMONCONTROLSEX.dwICC],ecx
mov [rsp+INITCOMMONCONTROLSEX.dwSize],\
sizeof.INITCOMMONCONTROLSEX
mov rcx,rdx
jmp .epilog0
@endusing
@using .loadacc
.loadacc:
mov rax,[LoadAcceleratorsW]
jmp .prolog0
@endusing
@using .create_acct
.create_acct:
mov rax,[CreateAcceleratorTableW]
jmp .prolog0
@endusing
@using .destroy_acct
.destroy_acct:
mov rax,[DestroyAcceleratorTable]
jmp .prolog0
@endusing
@using .loadicon
.loadicon:
mov rax,[LoadIconW]
jmp .prolog0
@endusing
@using .loadmenu
.loadmenu:
mov rax,[LoadMenuW]
jmp .prolog0
@endusing
@using .loadcurs
.loadcursor:
mov rax,[LoadCursorW]
jmp .prolog0
@endusing
@using .set_curs
.set_curs:
mov rax,[SetCursor]
jmp .prolog0
@endusing
@using .enddlg
.enddlg:
mov rax,[EndDialog]
jmp .prolog0
@endusing
@using .get_dlgitem
.get_dlgitem:
;--- in RCX hDialog
;--- in RDX item id
mov rax,[GetDlgItem]
jmp .prolog0
@endusing
@using .cdlgp
.cdlgp:
;--- in RCX hInstance
;--- in RDX lpTemplate
;--- in R8 hWndParent
;--- in R9 lpDialogFunc
;--- in R10 param
mov rax,[CreateDialogParamW]
jmp .prologP
@endusing
@using .dlgbp
.dlgbp:
;--- in RCX hInstance
;--- in RDX lpTemplate
;--- in R8 hWndParent
;--- in R9 lpDialogFunc
;--- in R10 param
mov rax,[DialogBoxParamW]
jmp .prologP
@endusing
@using .loadimg
.loadimg:
mov rax,[LoadImageW]
jmp .prologP
@endusing
@using .loadbmp
.loadbmp:
mov rax,[LoadBitmapW]
jmp .prolog0
@endusing
@using .loadres
.loadres:
mov rax,[LoadResource]
jmp .prolog0
@endusing
@using .loadstr
.loadstr:
mov rax,[LoadStringW]
jmp .prolog0
@endusing
@using .findresx
.findresx:
mov rax,[FindResourceExW]
jmp .prolog0
@endusing
@using .findres
.findres:
mov rax,[FindResourceW]
jmp .prolog0
@endusing
;#---------------------------------------------------ö
;| KERNEL & RT |
;ö---------------------------------------------------ü
@using .f_close,.ff_file,.fn_file
.f_close:
mov rax,[FindClose]
jmp .prolog0
.fn_file:
mov rax,[FindNextFileW]
jmp .prolog0
.ff_file:
mov rax,[FindFirstFileW]
jmp .prolog0
@endusing
@using .cmdline
.cmdline:
mov rax,[GetCommandLineW]
jmp .prolog0
@endusing
@using .cmdargs
.cmdargs:
mov rax,[CommandLineToArgvW]
jmp .prolog0
@endusing
@using .query_pf
.query_pf:
mov rax,[QueryPerformanceFrequency]
jmp .prolog0
@endusing
@using .query_pc
.query_pc:
mov rax,[QueryPerformanceCounter]
jmp .prolog0
@endusing
@using .wait_sobj
.wait_sobj:
mov rax,[WaitForSingleObject]
jmp .prolog0
@endusing
@using .sleep
.sleep:
mov rax,[Sleep]
jmp .prolog0
@endusing
;#---------------------------------------------------ö
;| SHELL
;ö---------------------------------------------------ü
@using .sfinfo
.sfinfo:
;--- in RCX pszPath
;--- in RDX dwFileAttributes
;--- in R8 SHFILEINFO FAR *psfi,
;--- in R10 UINT uFlags
xor r11,r11
mov r9,\
sizeof.SHFILEINFOW
mov rax,[SHGetFileInfoW]
jmp .prologP
@endusing
@using .shexec
.shexec:
push rbp
mov rbp,rsp
and rsp,-16
sub rsp,\
sizeof.SHELLEXECUTEINFOW+10h
xor eax,eax
mov [rsp],rcx
mov [rsp+8],rdi
mov rcx,\
sizeof.SHELLEXECUTEINFOW / 8
lea rdi,[rsp+10h]
rep stosq
pop rcx
pop rdi
;--- in RCX hwnd handle to parent window
;--- in RDX lpOperation pointer to string that specifies operation to perform
;--- in R8 lpFile pointer to filename or folder name string
;--- in R9 lpParameters pointer to string that specifies executable-file parameters
;--- in R10 lpDirectory pointer to string that specifies default directory
;--- in R11 nShowCmd whether file is shown when opened
mov [rsp+\
SHELLEXECUTEINFOW.cbSize],\
sizeof.SHELLEXECUTEINFOW
mov [rsp+\
SHELLEXECUTEINFOW.fMask],\
SEE_MASK_DOENVSUBST or \
SEE_MASK_FLAG_NO_UI
mov [rsp+\
SHELLEXECUTEINFOW.hwnd],rcx
mov [rsp+\
SHELLEXECUTEINFOW.lpVerb],rdx
mov [rsp+\
SHELLEXECUTEINFOW.lpFile],r8
mov [rsp+\
SHELLEXECUTEINFOW.lpParameters],r9
mov [rsp+\
SHELLEXECUTEINFOW.lpDirectory],r10
mov [rsp+\
SHELLEXECUTEINFOW.nShow],r11d
mov rax,[ShellExecuteExW]
mov rcx,rsp
jmp .epilog0
@endusing
@using .shget_kfpath
.shget_kfpath:
mov rax,[SHGetKnownFolderPath]
jmp .prolog0
@endusing
;#---------------------------------------------------ö
;| .messages |
;ö---------------------------------------------------ü
@using .msg_ok
.msg_ok:
mov r9,\
MB_OK or MB_ICONINFORMATION
jmp .msg_exec
@endusing
@using .msg_yn
.msg_yn:
mov r9,\
MB_YESNO \
or MB_ICONQUESTION
jmp .msg_exec
@endusing
@using .msg_ync
.msg_ync:
mov r9,\
MB_YESNOCANCEL \
or MB_ICONQUESTION
jmp .msg_exec
@endusing
@using .msg_err
.msg_err:
mov r9,\
MB_ICONERROR\
or MB_DEFBUTTON1
jmp .msg_exec
@endusing
@using .msg_exec
.msg_exec:
mov r10,(SUBLANG_DEFAULT shl 10 ) \
or LANG_NEUTRAL
mov rax,[MessageBoxExW]
jmp .prologP
@endusing
;#---------------------------------------------------ö
;| KEYS |
;ö---------------------------------------------------ü
@using .map_vk
.map_vk:
mov rax,[MapVirtualKeyW]
jmp .prolog0
@endusing
@using .get_keynt
.get_keynt:
mov rax,[GetKeyNameTextW]
jmp .prolog0
@endusing
;#---------------------------------------------------ö
;| COM,OLE,SHELL |
;ö---------------------------------------------------ü
@using .co_init
.co_init:
xor ecx,ecx
mov rax,[CoInitialize]
jmp .prolog0
@endusing
@using .co_initx
.co_initx:
mov rax,[CoInitializeEx]
jmp .prolog0
@endusing
@using .co_createi
.co_createi:
;--- __in REFCLSID rclsid,
;--- __in LPUNKNOWN pUnkOuter,
;--- __in DWORD dwClsContext,
;--- __in REFIID riid,
;--- __out LPVOID *ppv
mov rax,[CoCreateInstance]
jmp .prologP
@endusing
@using .co_taskma
.co_taskma:
mov rax,[CoTaskMemAlloc]
jmp .prolog0
@endusing
@using .co_taskmf
.co_taskmf:
mov rax,[CoTaskMemFree]
jmp .prolog0
@endusing
@using .co_uninit
.co_uninit:
mov rax,[CoUninitialize]
jmp .prolog0
@endusing
;#---------------------------------------------------ö
;| ADVAPI |
;ö---------------------------------------------------ü
@using .get_usrname
;--- in RCX LPTSTR lpBuffer,
;--- in RDX LPDWORD lpnSize
.get_usrname:
mov rax,[GetUserNameW]
jmp .prolog0
@endusing
;#---------------------------------------------------ö
;| LANG LOCALE |
;ö---------------------------------------------------ü
@using .is_locname
.is_locname:
mov rax,[IsValidLocaleName]
jmp .prolog0
@endusing
@using .get_sysdeflocname
.get_sysdeflocname:
mov rax,[GetSystemDefaultLocaleName]
jmp .prolog0
@endusing
@using .get_locinfox
;--- in RCX LPCWSTR lpLocaleName
;--- in RDX LCTYPE LCType
;--- in R8 LPWSTR lpLCData
;--- in R9 int cchData
.get_locinfox:
mov rax,\
[GetLocaleInfoEx]
jmp .prolog0
@endusing
@using .lcid2name
.lcid2name:
;--- LCID Locale,
;--- LPWSTR lpName,
;--- int cchName,
;--- DWORD dwFlags
mov rax,\
[LCIDToLocaleName]
jmp .prolog0
@endusing
@using .name2lcid
.name2lcid:
;--- DWORD dwFlags
;--- LPWSTR lpName,
mov rax,\
[LocaleNameToLCID]
jmp .prolog0
@endusing
| 17.02079 | 88 | 0.582631 | [
"MPL-2.0"
] | 8l/x64lab.upto133 | develop/shared/api.asm | 24,622 | Assembly |
;------------------------------------------------------------------
!zone MemoryCopy
MemoryCopy
ldx PARAM2
ldy #0
.MemoryCopyLoop
; Decrement 16-bit size/counter.
txa
bne .decrementSizeLo
lda PARAM3
beq .MemoryCopyEnd
.decrementSizeHi
dec PARAM3
.decrementSizeLo
dex
.CopyByte
; Copy one byte.
lda (ZEROPAGE_POINTER_1),y
sta (ZEROPAGE_POINTER_2),y
; Increment Y index.
iny
bne .MemoryCopyLoop
; if Y index wraps around.
; Increment hi-byte of source/destination addresses
inc ZEROPAGE_POINTER_1+1
inc ZEROPAGE_POINTER_2+1
jmp .MemoryCopyLoop
.MemoryCopyEnd
rts
;------------------------------------------------------------------
; !zone MemoryCopyToRegister
; MemoryCopyToRegister
; ldy #0
; .MemoryCopyLoop
;
; ; Decrement 16-bit size/counter.
; lda PARAM1
; bne .decrementSizeLo
; lda PARAM2
; beq .MemoryCopyEnd
; .decrementSizeHi
; dec PARAM2
; .decrementSizeLo
; dec PARAM1
;
; .CopyByte
; ; Copy one byte.
; tya
; tax
; lda (ZEROPAGE_POINTER_1),y
; ldy #0
; sta (ZEROPAGE_POINTER_2),y
; ;sta VRAM_ADDRESS_REG
; txa
; tay
;
; ; Increment Y index.
; iny
; bne .MemoryCopyLoop
;
; ; if Y index wraps around.
; ; Increment hi-byte of source address
; inc ZEROPAGE_POINTER_1+1
;
; jmp .MemoryCopyLoop
;
; .MemoryCopyEnd
; rts
;------------------------------------------------------------------
!zone MemoryFill
MemoryFill
ldx PARAM2
ldy #0
.MemoryFillLoop
; Decrement 16-bit size/counter.
txa
bne .decrementSizeLo
lda PARAM3
beq .MemoryFillEnd
.decrementSizeHi
dec PARAM3
.decrementSizeLo
dex
.SetByte
; Copy one byte.
lda PARAM1
sta (ZEROPAGE_POINTER_2),y
; Increment Y index.
iny
bne .MemoryFillLoop
; if Y index wraps around.
; Increment hi-byte of destination address
inc ZEROPAGE_POINTER_2+1
jmp .MemoryFillLoop
.MemoryFillEnd
rts
| 18.20354 | 112 | 0.574623 | [
"MIT"
] | puzzud/puzl6502 | utility/IO.asm | 2,057 | Assembly |
# Seção de dados
.data
msg: .asciiz "O valor impresso no final deve ser 4 e não deve imprimir 'Erro'.\n"
errotext: .asciiz "Erro\n"
oktext: .asciiz "Valor final: "
#Seção de texto
.text
la $a0, msg # coloca em a0 o parâmetro da chamada a syscall
li $v0, 4 # 4 é o código para imprimir uma string
syscall
li $s5, 0
beq $zero, $zero, um
nop
addi $s5, $s5, 1
la $a0, errotext # coloca em a0 o parâmetro da chamada a syscall
li $v0, 4 # 4 é o código para imprimir uma string
syscall
j erro
nop
um:
addi $s5, $s5, 1
li $t1, 42
li $s1, 43
beq $t1, $s1, erro
nop
addi $s5, $s5, 1
li $t1, 42
li $s1, 42
bne $t1, $s1, erro
nop
addi $s5, $s5, 1
li $s1, 43
bne $t1, $s1, dois
nop
addi $s5, $s5, 1
la $a0, errotext # coloca em a0 o parâmetro da chamada a syscall
li $v0, 4 # 4 é o código para imprimir uma string
syscall
dois:
li $s1, 73
li $s2, 0
move $zero, $s1
beq $s1, $zero, erro
nop
addi $s5, $s5, 1
j saida
erro:
la $a0, errotext # coloca em a0 o parâmetro da chamada a syscall
li $v0, 4 # 4 é o código para imprimir uma string
syscall
saida:
la $a0, oktext # coloca em a0 o parâmetro da chamada a syscall
li $v0, 4 # 4 é o código para imprimir uma string
syscall
move $a0, $s5
li $v0, 1
syscall
# Imprime \n
li $a0, '\n'
li $v0, 11 # 11 é o código para imprimir um caractere
syscall
#Finaliza execução
li $v0, 10 # exit syscall code = 10
syscall
| 20.0875 | 91 | 0.571251 | [
"MPL-2.0",
"MPL-2.0-no-copyleft-exception"
] | EduRenesto/indy | res/04.branches.asm | 1,631 | Assembly |
_grep: file format elf32-i386
Disassembly of section .text:
00000000 <grep>:
char buf[1024];
int match(char*, char*);
void
grep(char *pattern, int fd)
{
0: 55 push %ebp
1: 89 e5 mov %esp,%ebp
3: 83 ec 18 sub $0x18,%esp
int n, m;
char *p, *q;
m = 0;
6: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
while((n = read(fd, buf+m, sizeof(buf)-m)) > 0){
d: e9 ab 00 00 00 jmp bd <grep+0xbd>
m += n;
12: 8b 45 ec mov -0x14(%ebp),%eax
15: 01 45 f4 add %eax,-0xc(%ebp)
p = buf;
18: c7 45 f0 00 0e 00 00 movl $0xe00,-0x10(%ebp)
while((q = strchr(p, '\n')) != 0){
1f: eb 4a jmp 6b <grep+0x6b>
*q = 0;
21: 8b 45 e8 mov -0x18(%ebp),%eax
24: c6 00 00 movb $0x0,(%eax)
if(match(pattern, p)){
27: 83 ec 08 sub $0x8,%esp
2a: ff 75 f0 pushl -0x10(%ebp)
2d: ff 75 08 pushl 0x8(%ebp)
30: e8 9a 01 00 00 call 1cf <match>
35: 83 c4 10 add $0x10,%esp
38: 85 c0 test %eax,%eax
3a: 74 26 je 62 <grep+0x62>
*q = '\n';
3c: 8b 45 e8 mov -0x18(%ebp),%eax
3f: c6 00 0a movb $0xa,(%eax)
write(1, p, q+1 - p);
42: 8b 45 e8 mov -0x18(%ebp),%eax
45: 83 c0 01 add $0x1,%eax
48: 89 c2 mov %eax,%edx
4a: 8b 45 f0 mov -0x10(%ebp),%eax
4d: 29 c2 sub %eax,%edx
4f: 89 d0 mov %edx,%eax
51: 83 ec 04 sub $0x4,%esp
54: 50 push %eax
55: ff 75 f0 pushl -0x10(%ebp)
58: 6a 01 push $0x1
5a: e8 43 05 00 00 call 5a2 <write>
5f: 83 c4 10 add $0x10,%esp
}
p = q+1;
62: 8b 45 e8 mov -0x18(%ebp),%eax
65: 83 c0 01 add $0x1,%eax
68: 89 45 f0 mov %eax,-0x10(%ebp)
while((q = strchr(p, '\n')) != 0){
6b: 83 ec 08 sub $0x8,%esp
6e: 6a 0a push $0xa
70: ff 75 f0 pushl -0x10(%ebp)
73: e8 89 03 00 00 call 401 <strchr>
78: 83 c4 10 add $0x10,%esp
7b: 89 45 e8 mov %eax,-0x18(%ebp)
7e: 83 7d e8 00 cmpl $0x0,-0x18(%ebp)
82: 75 9d jne 21 <grep+0x21>
}
if(p == buf)
84: 81 7d f0 00 0e 00 00 cmpl $0xe00,-0x10(%ebp)
8b: 75 07 jne 94 <grep+0x94>
m = 0;
8d: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
if(m > 0){
94: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
98: 7e 23 jle bd <grep+0xbd>
m -= p - buf;
9a: 8b 45 f0 mov -0x10(%ebp),%eax
9d: ba 00 0e 00 00 mov $0xe00,%edx
a2: 29 d0 sub %edx,%eax
a4: 29 45 f4 sub %eax,-0xc(%ebp)
memmove(buf, p, m);
a7: 83 ec 04 sub $0x4,%esp
aa: ff 75 f4 pushl -0xc(%ebp)
ad: ff 75 f0 pushl -0x10(%ebp)
b0: 68 00 0e 00 00 push $0xe00
b5: e8 83 04 00 00 call 53d <memmove>
ba: 83 c4 10 add $0x10,%esp
while((n = read(fd, buf+m, sizeof(buf)-m)) > 0){
bd: 8b 45 f4 mov -0xc(%ebp),%eax
c0: ba 00 04 00 00 mov $0x400,%edx
c5: 29 c2 sub %eax,%edx
c7: 89 d0 mov %edx,%eax
c9: 89 c2 mov %eax,%edx
cb: 8b 45 f4 mov -0xc(%ebp),%eax
ce: 05 00 0e 00 00 add $0xe00,%eax
d3: 83 ec 04 sub $0x4,%esp
d6: 52 push %edx
d7: 50 push %eax
d8: ff 75 0c pushl 0xc(%ebp)
db: e8 ba 04 00 00 call 59a <read>
e0: 83 c4 10 add $0x10,%esp
e3: 89 45 ec mov %eax,-0x14(%ebp)
e6: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
ea: 0f 8f 22 ff ff ff jg 12 <grep+0x12>
}
}
}
f0: 90 nop
f1: c9 leave
f2: c3 ret
000000f3 <main>:
int
main(int argc, char *argv[])
{
f3: 8d 4c 24 04 lea 0x4(%esp),%ecx
f7: 83 e4 f0 and $0xfffffff0,%esp
fa: ff 71 fc pushl -0x4(%ecx)
fd: 55 push %ebp
fe: 89 e5 mov %esp,%ebp
100: 53 push %ebx
101: 51 push %ecx
102: 83 ec 10 sub $0x10,%esp
105: 89 cb mov %ecx,%ebx
int fd, i;
char *pattern;
if(argc <= 1){
107: 83 3b 01 cmpl $0x1,(%ebx)
10a: 7f 17 jg 123 <main+0x30>
printf(2, "usage: grep pattern [file ...]\n");
10c: 83 ec 08 sub $0x8,%esp
10f: 68 b0 0a 00 00 push $0xab0
114: 6a 02 push $0x2
116: e8 de 05 00 00 call 6f9 <printf>
11b: 83 c4 10 add $0x10,%esp
exit();
11e: e8 5f 04 00 00 call 582 <exit>
}
pattern = argv[1];
123: 8b 43 04 mov 0x4(%ebx),%eax
126: 8b 40 04 mov 0x4(%eax),%eax
129: 89 45 f0 mov %eax,-0x10(%ebp)
if(argc <= 2){
12c: 83 3b 02 cmpl $0x2,(%ebx)
12f: 7f 15 jg 146 <main+0x53>
grep(pattern, 0);
131: 83 ec 08 sub $0x8,%esp
134: 6a 00 push $0x0
136: ff 75 f0 pushl -0x10(%ebp)
139: e8 c2 fe ff ff call 0 <grep>
13e: 83 c4 10 add $0x10,%esp
exit();
141: e8 3c 04 00 00 call 582 <exit>
}
for(i = 2; i < argc; i++){
146: c7 45 f4 02 00 00 00 movl $0x2,-0xc(%ebp)
14d: eb 74 jmp 1c3 <main+0xd0>
if((fd = open(argv[i], 0)) < 0){
14f: 8b 45 f4 mov -0xc(%ebp),%eax
152: 8d 14 85 00 00 00 00 lea 0x0(,%eax,4),%edx
159: 8b 43 04 mov 0x4(%ebx),%eax
15c: 01 d0 add %edx,%eax
15e: 8b 00 mov (%eax),%eax
160: 83 ec 08 sub $0x8,%esp
163: 6a 00 push $0x0
165: 50 push %eax
166: e8 57 04 00 00 call 5c2 <open>
16b: 83 c4 10 add $0x10,%esp
16e: 89 45 ec mov %eax,-0x14(%ebp)
171: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
175: 79 29 jns 1a0 <main+0xad>
printf(1, "grep: cannot open %s\n", argv[i]);
177: 8b 45 f4 mov -0xc(%ebp),%eax
17a: 8d 14 85 00 00 00 00 lea 0x0(,%eax,4),%edx
181: 8b 43 04 mov 0x4(%ebx),%eax
184: 01 d0 add %edx,%eax
186: 8b 00 mov (%eax),%eax
188: 83 ec 04 sub $0x4,%esp
18b: 50 push %eax
18c: 68 d0 0a 00 00 push $0xad0
191: 6a 01 push $0x1
193: e8 61 05 00 00 call 6f9 <printf>
198: 83 c4 10 add $0x10,%esp
exit();
19b: e8 e2 03 00 00 call 582 <exit>
}
grep(pattern, fd);
1a0: 83 ec 08 sub $0x8,%esp
1a3: ff 75 ec pushl -0x14(%ebp)
1a6: ff 75 f0 pushl -0x10(%ebp)
1a9: e8 52 fe ff ff call 0 <grep>
1ae: 83 c4 10 add $0x10,%esp
close(fd);
1b1: 83 ec 0c sub $0xc,%esp
1b4: ff 75 ec pushl -0x14(%ebp)
1b7: e8 ee 03 00 00 call 5aa <close>
1bc: 83 c4 10 add $0x10,%esp
for(i = 2; i < argc; i++){
1bf: 83 45 f4 01 addl $0x1,-0xc(%ebp)
1c3: 8b 45 f4 mov -0xc(%ebp),%eax
1c6: 3b 03 cmp (%ebx),%eax
1c8: 7c 85 jl 14f <main+0x5c>
}
exit();
1ca: e8 b3 03 00 00 call 582 <exit>
000001cf <match>:
int matchhere(char*, char*);
int matchstar(int, char*, char*);
int
match(char *re, char *text)
{
1cf: 55 push %ebp
1d0: 89 e5 mov %esp,%ebp
1d2: 83 ec 08 sub $0x8,%esp
if(re[0] == '^')
1d5: 8b 45 08 mov 0x8(%ebp),%eax
1d8: 0f b6 00 movzbl (%eax),%eax
1db: 3c 5e cmp $0x5e,%al
1dd: 75 17 jne 1f6 <match+0x27>
return matchhere(re+1, text);
1df: 8b 45 08 mov 0x8(%ebp),%eax
1e2: 83 c0 01 add $0x1,%eax
1e5: 83 ec 08 sub $0x8,%esp
1e8: ff 75 0c pushl 0xc(%ebp)
1eb: 50 push %eax
1ec: e8 38 00 00 00 call 229 <matchhere>
1f1: 83 c4 10 add $0x10,%esp
1f4: eb 31 jmp 227 <match+0x58>
do{ // must look at empty string
if(matchhere(re, text))
1f6: 83 ec 08 sub $0x8,%esp
1f9: ff 75 0c pushl 0xc(%ebp)
1fc: ff 75 08 pushl 0x8(%ebp)
1ff: e8 25 00 00 00 call 229 <matchhere>
204: 83 c4 10 add $0x10,%esp
207: 85 c0 test %eax,%eax
209: 74 07 je 212 <match+0x43>
return 1;
20b: b8 01 00 00 00 mov $0x1,%eax
210: eb 15 jmp 227 <match+0x58>
}while(*text++ != '\0');
212: 8b 45 0c mov 0xc(%ebp),%eax
215: 8d 50 01 lea 0x1(%eax),%edx
218: 89 55 0c mov %edx,0xc(%ebp)
21b: 0f b6 00 movzbl (%eax),%eax
21e: 84 c0 test %al,%al
220: 75 d4 jne 1f6 <match+0x27>
return 0;
222: b8 00 00 00 00 mov $0x0,%eax
}
227: c9 leave
228: c3 ret
00000229 <matchhere>:
// matchhere: search for re at beginning of text
int matchhere(char *re, char *text)
{
229: 55 push %ebp
22a: 89 e5 mov %esp,%ebp
22c: 83 ec 08 sub $0x8,%esp
if(re[0] == '\0')
22f: 8b 45 08 mov 0x8(%ebp),%eax
232: 0f b6 00 movzbl (%eax),%eax
235: 84 c0 test %al,%al
237: 75 0a jne 243 <matchhere+0x1a>
return 1;
239: b8 01 00 00 00 mov $0x1,%eax
23e: e9 99 00 00 00 jmp 2dc <matchhere+0xb3>
if(re[1] == '*')
243: 8b 45 08 mov 0x8(%ebp),%eax
246: 83 c0 01 add $0x1,%eax
249: 0f b6 00 movzbl (%eax),%eax
24c: 3c 2a cmp $0x2a,%al
24e: 75 21 jne 271 <matchhere+0x48>
return matchstar(re[0], re+2, text);
250: 8b 45 08 mov 0x8(%ebp),%eax
253: 8d 50 02 lea 0x2(%eax),%edx
256: 8b 45 08 mov 0x8(%ebp),%eax
259: 0f b6 00 movzbl (%eax),%eax
25c: 0f be c0 movsbl %al,%eax
25f: 83 ec 04 sub $0x4,%esp
262: ff 75 0c pushl 0xc(%ebp)
265: 52 push %edx
266: 50 push %eax
267: e8 72 00 00 00 call 2de <matchstar>
26c: 83 c4 10 add $0x10,%esp
26f: eb 6b jmp 2dc <matchhere+0xb3>
if(re[0] == '$' && re[1] == '\0')
271: 8b 45 08 mov 0x8(%ebp),%eax
274: 0f b6 00 movzbl (%eax),%eax
277: 3c 24 cmp $0x24,%al
279: 75 1d jne 298 <matchhere+0x6f>
27b: 8b 45 08 mov 0x8(%ebp),%eax
27e: 83 c0 01 add $0x1,%eax
281: 0f b6 00 movzbl (%eax),%eax
284: 84 c0 test %al,%al
286: 75 10 jne 298 <matchhere+0x6f>
return *text == '\0';
288: 8b 45 0c mov 0xc(%ebp),%eax
28b: 0f b6 00 movzbl (%eax),%eax
28e: 84 c0 test %al,%al
290: 0f 94 c0 sete %al
293: 0f b6 c0 movzbl %al,%eax
296: eb 44 jmp 2dc <matchhere+0xb3>
if(*text!='\0' && (re[0]=='.' || re[0]==*text))
298: 8b 45 0c mov 0xc(%ebp),%eax
29b: 0f b6 00 movzbl (%eax),%eax
29e: 84 c0 test %al,%al
2a0: 74 35 je 2d7 <matchhere+0xae>
2a2: 8b 45 08 mov 0x8(%ebp),%eax
2a5: 0f b6 00 movzbl (%eax),%eax
2a8: 3c 2e cmp $0x2e,%al
2aa: 74 10 je 2bc <matchhere+0x93>
2ac: 8b 45 08 mov 0x8(%ebp),%eax
2af: 0f b6 10 movzbl (%eax),%edx
2b2: 8b 45 0c mov 0xc(%ebp),%eax
2b5: 0f b6 00 movzbl (%eax),%eax
2b8: 38 c2 cmp %al,%dl
2ba: 75 1b jne 2d7 <matchhere+0xae>
return matchhere(re+1, text+1);
2bc: 8b 45 0c mov 0xc(%ebp),%eax
2bf: 8d 50 01 lea 0x1(%eax),%edx
2c2: 8b 45 08 mov 0x8(%ebp),%eax
2c5: 83 c0 01 add $0x1,%eax
2c8: 83 ec 08 sub $0x8,%esp
2cb: 52 push %edx
2cc: 50 push %eax
2cd: e8 57 ff ff ff call 229 <matchhere>
2d2: 83 c4 10 add $0x10,%esp
2d5: eb 05 jmp 2dc <matchhere+0xb3>
return 0;
2d7: b8 00 00 00 00 mov $0x0,%eax
}
2dc: c9 leave
2dd: c3 ret
000002de <matchstar>:
// matchstar: search for c*re at beginning of text
int matchstar(int c, char *re, char *text)
{
2de: 55 push %ebp
2df: 89 e5 mov %esp,%ebp
2e1: 83 ec 08 sub $0x8,%esp
do{ // a * matches zero or more instances
if(matchhere(re, text))
2e4: 83 ec 08 sub $0x8,%esp
2e7: ff 75 10 pushl 0x10(%ebp)
2ea: ff 75 0c pushl 0xc(%ebp)
2ed: e8 37 ff ff ff call 229 <matchhere>
2f2: 83 c4 10 add $0x10,%esp
2f5: 85 c0 test %eax,%eax
2f7: 74 07 je 300 <matchstar+0x22>
return 1;
2f9: b8 01 00 00 00 mov $0x1,%eax
2fe: eb 29 jmp 329 <matchstar+0x4b>
}while(*text!='\0' && (*text++==c || c=='.'));
300: 8b 45 10 mov 0x10(%ebp),%eax
303: 0f b6 00 movzbl (%eax),%eax
306: 84 c0 test %al,%al
308: 74 1a je 324 <matchstar+0x46>
30a: 8b 45 10 mov 0x10(%ebp),%eax
30d: 8d 50 01 lea 0x1(%eax),%edx
310: 89 55 10 mov %edx,0x10(%ebp)
313: 0f b6 00 movzbl (%eax),%eax
316: 0f be c0 movsbl %al,%eax
319: 3b 45 08 cmp 0x8(%ebp),%eax
31c: 74 c6 je 2e4 <matchstar+0x6>
31e: 83 7d 08 2e cmpl $0x2e,0x8(%ebp)
322: 74 c0 je 2e4 <matchstar+0x6>
return 0;
324: b8 00 00 00 00 mov $0x0,%eax
}
329: c9 leave
32a: c3 ret
0000032b <stosb>:
"cc");
}
static inline void
stosb(void *addr, int data, int cnt)
{
32b: 55 push %ebp
32c: 89 e5 mov %esp,%ebp
32e: 57 push %edi
32f: 53 push %ebx
asm volatile("cld; rep stosb" :
330: 8b 4d 08 mov 0x8(%ebp),%ecx
333: 8b 55 10 mov 0x10(%ebp),%edx
336: 8b 45 0c mov 0xc(%ebp),%eax
339: 89 cb mov %ecx,%ebx
33b: 89 df mov %ebx,%edi
33d: 89 d1 mov %edx,%ecx
33f: fc cld
340: f3 aa rep stos %al,%es:(%edi)
342: 89 ca mov %ecx,%edx
344: 89 fb mov %edi,%ebx
346: 89 5d 08 mov %ebx,0x8(%ebp)
349: 89 55 10 mov %edx,0x10(%ebp)
"=D" (addr), "=c" (cnt) :
"0" (addr), "1" (cnt), "a" (data) :
"memory", "cc");
}
34c: 90 nop
34d: 5b pop %ebx
34e: 5f pop %edi
34f: 5d pop %ebp
350: c3 ret
00000351 <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, char *t)
{
351: 55 push %ebp
352: 89 e5 mov %esp,%ebp
354: 83 ec 10 sub $0x10,%esp
char *os;
os = s;
357: 8b 45 08 mov 0x8(%ebp),%eax
35a: 89 45 fc mov %eax,-0x4(%ebp)
while((*s++ = *t++) != 0)
35d: 90 nop
35e: 8b 45 08 mov 0x8(%ebp),%eax
361: 8d 50 01 lea 0x1(%eax),%edx
364: 89 55 08 mov %edx,0x8(%ebp)
367: 8b 55 0c mov 0xc(%ebp),%edx
36a: 8d 4a 01 lea 0x1(%edx),%ecx
36d: 89 4d 0c mov %ecx,0xc(%ebp)
370: 0f b6 12 movzbl (%edx),%edx
373: 88 10 mov %dl,(%eax)
375: 0f b6 00 movzbl (%eax),%eax
378: 84 c0 test %al,%al
37a: 75 e2 jne 35e <strcpy+0xd>
;
return os;
37c: 8b 45 fc mov -0x4(%ebp),%eax
}
37f: c9 leave
380: c3 ret
00000381 <strcmp>:
int
strcmp(const char *p, const char *q)
{
381: 55 push %ebp
382: 89 e5 mov %esp,%ebp
while(*p && *p == *q)
384: eb 08 jmp 38e <strcmp+0xd>
p++, q++;
386: 83 45 08 01 addl $0x1,0x8(%ebp)
38a: 83 45 0c 01 addl $0x1,0xc(%ebp)
while(*p && *p == *q)
38e: 8b 45 08 mov 0x8(%ebp),%eax
391: 0f b6 00 movzbl (%eax),%eax
394: 84 c0 test %al,%al
396: 74 10 je 3a8 <strcmp+0x27>
398: 8b 45 08 mov 0x8(%ebp),%eax
39b: 0f b6 10 movzbl (%eax),%edx
39e: 8b 45 0c mov 0xc(%ebp),%eax
3a1: 0f b6 00 movzbl (%eax),%eax
3a4: 38 c2 cmp %al,%dl
3a6: 74 de je 386 <strcmp+0x5>
return (uchar)*p - (uchar)*q;
3a8: 8b 45 08 mov 0x8(%ebp),%eax
3ab: 0f b6 00 movzbl (%eax),%eax
3ae: 0f b6 d0 movzbl %al,%edx
3b1: 8b 45 0c mov 0xc(%ebp),%eax
3b4: 0f b6 00 movzbl (%eax),%eax
3b7: 0f b6 c0 movzbl %al,%eax
3ba: 29 c2 sub %eax,%edx
3bc: 89 d0 mov %edx,%eax
}
3be: 5d pop %ebp
3bf: c3 ret
000003c0 <strlen>:
uint
strlen(char *s)
{
3c0: 55 push %ebp
3c1: 89 e5 mov %esp,%ebp
3c3: 83 ec 10 sub $0x10,%esp
int n;
for(n = 0; s[n]; n++)
3c6: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
3cd: eb 04 jmp 3d3 <strlen+0x13>
3cf: 83 45 fc 01 addl $0x1,-0x4(%ebp)
3d3: 8b 55 fc mov -0x4(%ebp),%edx
3d6: 8b 45 08 mov 0x8(%ebp),%eax
3d9: 01 d0 add %edx,%eax
3db: 0f b6 00 movzbl (%eax),%eax
3de: 84 c0 test %al,%al
3e0: 75 ed jne 3cf <strlen+0xf>
;
return n;
3e2: 8b 45 fc mov -0x4(%ebp),%eax
}
3e5: c9 leave
3e6: c3 ret
000003e7 <memset>:
void*
memset(void *dst, int c, uint n)
{
3e7: 55 push %ebp
3e8: 89 e5 mov %esp,%ebp
stosb(dst, c, n);
3ea: 8b 45 10 mov 0x10(%ebp),%eax
3ed: 50 push %eax
3ee: ff 75 0c pushl 0xc(%ebp)
3f1: ff 75 08 pushl 0x8(%ebp)
3f4: e8 32 ff ff ff call 32b <stosb>
3f9: 83 c4 0c add $0xc,%esp
return dst;
3fc: 8b 45 08 mov 0x8(%ebp),%eax
}
3ff: c9 leave
400: c3 ret
00000401 <strchr>:
char*
strchr(const char *s, char c)
{
401: 55 push %ebp
402: 89 e5 mov %esp,%ebp
404: 83 ec 04 sub $0x4,%esp
407: 8b 45 0c mov 0xc(%ebp),%eax
40a: 88 45 fc mov %al,-0x4(%ebp)
for(; *s; s++)
40d: eb 14 jmp 423 <strchr+0x22>
if(*s == c)
40f: 8b 45 08 mov 0x8(%ebp),%eax
412: 0f b6 00 movzbl (%eax),%eax
415: 3a 45 fc cmp -0x4(%ebp),%al
418: 75 05 jne 41f <strchr+0x1e>
return (char*)s;
41a: 8b 45 08 mov 0x8(%ebp),%eax
41d: eb 13 jmp 432 <strchr+0x31>
for(; *s; s++)
41f: 83 45 08 01 addl $0x1,0x8(%ebp)
423: 8b 45 08 mov 0x8(%ebp),%eax
426: 0f b6 00 movzbl (%eax),%eax
429: 84 c0 test %al,%al
42b: 75 e2 jne 40f <strchr+0xe>
return 0;
42d: b8 00 00 00 00 mov $0x0,%eax
}
432: c9 leave
433: c3 ret
00000434 <gets>:
char*
gets(char *buf, int max)
{
434: 55 push %ebp
435: 89 e5 mov %esp,%ebp
437: 83 ec 18 sub $0x18,%esp
int i, cc;
char c;
for(i=0; i+1 < max; ){
43a: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
441: eb 42 jmp 485 <gets+0x51>
cc = read(0, &c, 1);
443: 83 ec 04 sub $0x4,%esp
446: 6a 01 push $0x1
448: 8d 45 ef lea -0x11(%ebp),%eax
44b: 50 push %eax
44c: 6a 00 push $0x0
44e: e8 47 01 00 00 call 59a <read>
453: 83 c4 10 add $0x10,%esp
456: 89 45 f0 mov %eax,-0x10(%ebp)
if(cc < 1)
459: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
45d: 7e 33 jle 492 <gets+0x5e>
break;
buf[i++] = c;
45f: 8b 45 f4 mov -0xc(%ebp),%eax
462: 8d 50 01 lea 0x1(%eax),%edx
465: 89 55 f4 mov %edx,-0xc(%ebp)
468: 89 c2 mov %eax,%edx
46a: 8b 45 08 mov 0x8(%ebp),%eax
46d: 01 c2 add %eax,%edx
46f: 0f b6 45 ef movzbl -0x11(%ebp),%eax
473: 88 02 mov %al,(%edx)
if(c == '\n' || c == '\r')
475: 0f b6 45 ef movzbl -0x11(%ebp),%eax
479: 3c 0a cmp $0xa,%al
47b: 74 16 je 493 <gets+0x5f>
47d: 0f b6 45 ef movzbl -0x11(%ebp),%eax
481: 3c 0d cmp $0xd,%al
483: 74 0e je 493 <gets+0x5f>
for(i=0; i+1 < max; ){
485: 8b 45 f4 mov -0xc(%ebp),%eax
488: 83 c0 01 add $0x1,%eax
48b: 3b 45 0c cmp 0xc(%ebp),%eax
48e: 7c b3 jl 443 <gets+0xf>
490: eb 01 jmp 493 <gets+0x5f>
break;
492: 90 nop
break;
}
buf[i] = '\0';
493: 8b 55 f4 mov -0xc(%ebp),%edx
496: 8b 45 08 mov 0x8(%ebp),%eax
499: 01 d0 add %edx,%eax
49b: c6 00 00 movb $0x0,(%eax)
return buf;
49e: 8b 45 08 mov 0x8(%ebp),%eax
}
4a1: c9 leave
4a2: c3 ret
000004a3 <stat>:
int
stat(char *n, struct stat *st)
{
4a3: 55 push %ebp
4a4: 89 e5 mov %esp,%ebp
4a6: 83 ec 18 sub $0x18,%esp
int fd;
int r;
fd = open(n, O_RDONLY);
4a9: 83 ec 08 sub $0x8,%esp
4ac: 6a 00 push $0x0
4ae: ff 75 08 pushl 0x8(%ebp)
4b1: e8 0c 01 00 00 call 5c2 <open>
4b6: 83 c4 10 add $0x10,%esp
4b9: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0)
4bc: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
4c0: 79 07 jns 4c9 <stat+0x26>
return -1;
4c2: b8 ff ff ff ff mov $0xffffffff,%eax
4c7: eb 25 jmp 4ee <stat+0x4b>
r = fstat(fd, st);
4c9: 83 ec 08 sub $0x8,%esp
4cc: ff 75 0c pushl 0xc(%ebp)
4cf: ff 75 f4 pushl -0xc(%ebp)
4d2: e8 03 01 00 00 call 5da <fstat>
4d7: 83 c4 10 add $0x10,%esp
4da: 89 45 f0 mov %eax,-0x10(%ebp)
close(fd);
4dd: 83 ec 0c sub $0xc,%esp
4e0: ff 75 f4 pushl -0xc(%ebp)
4e3: e8 c2 00 00 00 call 5aa <close>
4e8: 83 c4 10 add $0x10,%esp
return r;
4eb: 8b 45 f0 mov -0x10(%ebp),%eax
}
4ee: c9 leave
4ef: c3 ret
000004f0 <atoi>:
int
atoi(const char *s)
{
4f0: 55 push %ebp
4f1: 89 e5 mov %esp,%ebp
4f3: 83 ec 10 sub $0x10,%esp
int n;
n = 0;
4f6: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
while('0' <= *s && *s <= '9')
4fd: eb 25 jmp 524 <atoi+0x34>
n = n*10 + *s++ - '0';
4ff: 8b 55 fc mov -0x4(%ebp),%edx
502: 89 d0 mov %edx,%eax
504: c1 e0 02 shl $0x2,%eax
507: 01 d0 add %edx,%eax
509: 01 c0 add %eax,%eax
50b: 89 c1 mov %eax,%ecx
50d: 8b 45 08 mov 0x8(%ebp),%eax
510: 8d 50 01 lea 0x1(%eax),%edx
513: 89 55 08 mov %edx,0x8(%ebp)
516: 0f b6 00 movzbl (%eax),%eax
519: 0f be c0 movsbl %al,%eax
51c: 01 c8 add %ecx,%eax
51e: 83 e8 30 sub $0x30,%eax
521: 89 45 fc mov %eax,-0x4(%ebp)
while('0' <= *s && *s <= '9')
524: 8b 45 08 mov 0x8(%ebp),%eax
527: 0f b6 00 movzbl (%eax),%eax
52a: 3c 2f cmp $0x2f,%al
52c: 7e 0a jle 538 <atoi+0x48>
52e: 8b 45 08 mov 0x8(%ebp),%eax
531: 0f b6 00 movzbl (%eax),%eax
534: 3c 39 cmp $0x39,%al
536: 7e c7 jle 4ff <atoi+0xf>
return n;
538: 8b 45 fc mov -0x4(%ebp),%eax
}
53b: c9 leave
53c: c3 ret
0000053d <memmove>:
void*
memmove(void *vdst, void *vsrc, int n)
{
53d: 55 push %ebp
53e: 89 e5 mov %esp,%ebp
540: 83 ec 10 sub $0x10,%esp
char *dst, *src;
dst = vdst;
543: 8b 45 08 mov 0x8(%ebp),%eax
546: 89 45 fc mov %eax,-0x4(%ebp)
src = vsrc;
549: 8b 45 0c mov 0xc(%ebp),%eax
54c: 89 45 f8 mov %eax,-0x8(%ebp)
while(n-- > 0)
54f: eb 17 jmp 568 <memmove+0x2b>
*dst++ = *src++;
551: 8b 45 fc mov -0x4(%ebp),%eax
554: 8d 50 01 lea 0x1(%eax),%edx
557: 89 55 fc mov %edx,-0x4(%ebp)
55a: 8b 55 f8 mov -0x8(%ebp),%edx
55d: 8d 4a 01 lea 0x1(%edx),%ecx
560: 89 4d f8 mov %ecx,-0x8(%ebp)
563: 0f b6 12 movzbl (%edx),%edx
566: 88 10 mov %dl,(%eax)
while(n-- > 0)
568: 8b 45 10 mov 0x10(%ebp),%eax
56b: 8d 50 ff lea -0x1(%eax),%edx
56e: 89 55 10 mov %edx,0x10(%ebp)
571: 85 c0 test %eax,%eax
573: 7f dc jg 551 <memmove+0x14>
return vdst;
575: 8b 45 08 mov 0x8(%ebp),%eax
}
578: c9 leave
579: c3 ret
0000057a <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
57a: b8 01 00 00 00 mov $0x1,%eax
57f: cd 40 int $0x40
581: c3 ret
00000582 <exit>:
SYSCALL(exit)
582: b8 02 00 00 00 mov $0x2,%eax
587: cd 40 int $0x40
589: c3 ret
0000058a <wait>:
SYSCALL(wait)
58a: b8 03 00 00 00 mov $0x3,%eax
58f: cd 40 int $0x40
591: c3 ret
00000592 <pipe>:
SYSCALL(pipe)
592: b8 04 00 00 00 mov $0x4,%eax
597: cd 40 int $0x40
599: c3 ret
0000059a <read>:
SYSCALL(read)
59a: b8 05 00 00 00 mov $0x5,%eax
59f: cd 40 int $0x40
5a1: c3 ret
000005a2 <write>:
SYSCALL(write)
5a2: b8 10 00 00 00 mov $0x10,%eax
5a7: cd 40 int $0x40
5a9: c3 ret
000005aa <close>:
SYSCALL(close)
5aa: b8 15 00 00 00 mov $0x15,%eax
5af: cd 40 int $0x40
5b1: c3 ret
000005b2 <kill>:
SYSCALL(kill)
5b2: b8 06 00 00 00 mov $0x6,%eax
5b7: cd 40 int $0x40
5b9: c3 ret
000005ba <exec>:
SYSCALL(exec)
5ba: b8 07 00 00 00 mov $0x7,%eax
5bf: cd 40 int $0x40
5c1: c3 ret
000005c2 <open>:
SYSCALL(open)
5c2: b8 0f 00 00 00 mov $0xf,%eax
5c7: cd 40 int $0x40
5c9: c3 ret
000005ca <mknod>:
SYSCALL(mknod)
5ca: b8 11 00 00 00 mov $0x11,%eax
5cf: cd 40 int $0x40
5d1: c3 ret
000005d2 <unlink>:
SYSCALL(unlink)
5d2: b8 12 00 00 00 mov $0x12,%eax
5d7: cd 40 int $0x40
5d9: c3 ret
000005da <fstat>:
SYSCALL(fstat)
5da: b8 08 00 00 00 mov $0x8,%eax
5df: cd 40 int $0x40
5e1: c3 ret
000005e2 <link>:
SYSCALL(link)
5e2: b8 13 00 00 00 mov $0x13,%eax
5e7: cd 40 int $0x40
5e9: c3 ret
000005ea <mkdir>:
SYSCALL(mkdir)
5ea: b8 14 00 00 00 mov $0x14,%eax
5ef: cd 40 int $0x40
5f1: c3 ret
000005f2 <chdir>:
SYSCALL(chdir)
5f2: b8 09 00 00 00 mov $0x9,%eax
5f7: cd 40 int $0x40
5f9: c3 ret
000005fa <dup>:
SYSCALL(dup)
5fa: b8 0a 00 00 00 mov $0xa,%eax
5ff: cd 40 int $0x40
601: c3 ret
00000602 <getpid>:
SYSCALL(getpid)
602: b8 0b 00 00 00 mov $0xb,%eax
607: cd 40 int $0x40
609: c3 ret
0000060a <sbrk>:
SYSCALL(sbrk)
60a: b8 0c 00 00 00 mov $0xc,%eax
60f: cd 40 int $0x40
611: c3 ret
00000612 <sleep>:
SYSCALL(sleep)
612: b8 0d 00 00 00 mov $0xd,%eax
617: cd 40 int $0x40
619: c3 ret
0000061a <uptime>:
SYSCALL(uptime)
61a: b8 0e 00 00 00 mov $0xe,%eax
61f: cd 40 int $0x40
621: c3 ret
00000622 <putc>:
#include "stat.h"
#include "user.h"
static void
putc(int fd, char c)
{
622: 55 push %ebp
623: 89 e5 mov %esp,%ebp
625: 83 ec 18 sub $0x18,%esp
628: 8b 45 0c mov 0xc(%ebp),%eax
62b: 88 45 f4 mov %al,-0xc(%ebp)
write(fd, &c, 1);
62e: 83 ec 04 sub $0x4,%esp
631: 6a 01 push $0x1
633: 8d 45 f4 lea -0xc(%ebp),%eax
636: 50 push %eax
637: ff 75 08 pushl 0x8(%ebp)
63a: e8 63 ff ff ff call 5a2 <write>
63f: 83 c4 10 add $0x10,%esp
}
642: 90 nop
643: c9 leave
644: c3 ret
00000645 <printint>:
static void
printint(int fd, int xx, int base, int sgn)
{
645: 55 push %ebp
646: 89 e5 mov %esp,%ebp
648: 53 push %ebx
649: 83 ec 24 sub $0x24,%esp
static char digits[] = "0123456789ABCDEF";
char buf[16];
int i, neg;
uint x;
neg = 0;
64c: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
if(sgn && xx < 0){
653: 83 7d 14 00 cmpl $0x0,0x14(%ebp)
657: 74 17 je 670 <printint+0x2b>
659: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
65d: 79 11 jns 670 <printint+0x2b>
neg = 1;
65f: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp)
x = -xx;
666: 8b 45 0c mov 0xc(%ebp),%eax
669: f7 d8 neg %eax
66b: 89 45 ec mov %eax,-0x14(%ebp)
66e: eb 06 jmp 676 <printint+0x31>
} else {
x = xx;
670: 8b 45 0c mov 0xc(%ebp),%eax
673: 89 45 ec mov %eax,-0x14(%ebp)
}
i = 0;
676: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
do{
buf[i++] = digits[x % base];
67d: 8b 4d f4 mov -0xc(%ebp),%ecx
680: 8d 41 01 lea 0x1(%ecx),%eax
683: 89 45 f4 mov %eax,-0xc(%ebp)
686: 8b 5d 10 mov 0x10(%ebp),%ebx
689: 8b 45 ec mov -0x14(%ebp),%eax
68c: ba 00 00 00 00 mov $0x0,%edx
691: f7 f3 div %ebx
693: 89 d0 mov %edx,%eax
695: 0f b6 80 bc 0d 00 00 movzbl 0xdbc(%eax),%eax
69c: 88 44 0d dc mov %al,-0x24(%ebp,%ecx,1)
}while((x /= base) != 0);
6a0: 8b 5d 10 mov 0x10(%ebp),%ebx
6a3: 8b 45 ec mov -0x14(%ebp),%eax
6a6: ba 00 00 00 00 mov $0x0,%edx
6ab: f7 f3 div %ebx
6ad: 89 45 ec mov %eax,-0x14(%ebp)
6b0: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
6b4: 75 c7 jne 67d <printint+0x38>
if(neg)
6b6: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
6ba: 74 2d je 6e9 <printint+0xa4>
buf[i++] = '-';
6bc: 8b 45 f4 mov -0xc(%ebp),%eax
6bf: 8d 50 01 lea 0x1(%eax),%edx
6c2: 89 55 f4 mov %edx,-0xc(%ebp)
6c5: c6 44 05 dc 2d movb $0x2d,-0x24(%ebp,%eax,1)
while(--i >= 0)
6ca: eb 1d jmp 6e9 <printint+0xa4>
putc(fd, buf[i]);
6cc: 8d 55 dc lea -0x24(%ebp),%edx
6cf: 8b 45 f4 mov -0xc(%ebp),%eax
6d2: 01 d0 add %edx,%eax
6d4: 0f b6 00 movzbl (%eax),%eax
6d7: 0f be c0 movsbl %al,%eax
6da: 83 ec 08 sub $0x8,%esp
6dd: 50 push %eax
6de: ff 75 08 pushl 0x8(%ebp)
6e1: e8 3c ff ff ff call 622 <putc>
6e6: 83 c4 10 add $0x10,%esp
while(--i >= 0)
6e9: 83 6d f4 01 subl $0x1,-0xc(%ebp)
6ed: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
6f1: 79 d9 jns 6cc <printint+0x87>
}
6f3: 90 nop
6f4: 8b 5d fc mov -0x4(%ebp),%ebx
6f7: c9 leave
6f8: c3 ret
000006f9 <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
6f9: 55 push %ebp
6fa: 89 e5 mov %esp,%ebp
6fc: 83 ec 28 sub $0x28,%esp
char *s;
int c, i, state;
uint *ap;
state = 0;
6ff: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
ap = (uint*)(void*)&fmt + 1;
706: 8d 45 0c lea 0xc(%ebp),%eax
709: 83 c0 04 add $0x4,%eax
70c: 89 45 e8 mov %eax,-0x18(%ebp)
for(i = 0; fmt[i]; i++){
70f: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
716: e9 59 01 00 00 jmp 874 <printf+0x17b>
c = fmt[i] & 0xff;
71b: 8b 55 0c mov 0xc(%ebp),%edx
71e: 8b 45 f0 mov -0x10(%ebp),%eax
721: 01 d0 add %edx,%eax
723: 0f b6 00 movzbl (%eax),%eax
726: 0f be c0 movsbl %al,%eax
729: 25 ff 00 00 00 and $0xff,%eax
72e: 89 45 e4 mov %eax,-0x1c(%ebp)
if(state == 0){
731: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
735: 75 2c jne 763 <printf+0x6a>
if(c == '%'){
737: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp)
73b: 75 0c jne 749 <printf+0x50>
state = '%';
73d: c7 45 ec 25 00 00 00 movl $0x25,-0x14(%ebp)
744: e9 27 01 00 00 jmp 870 <printf+0x177>
} else {
putc(fd, c);
749: 8b 45 e4 mov -0x1c(%ebp),%eax
74c: 0f be c0 movsbl %al,%eax
74f: 83 ec 08 sub $0x8,%esp
752: 50 push %eax
753: ff 75 08 pushl 0x8(%ebp)
756: e8 c7 fe ff ff call 622 <putc>
75b: 83 c4 10 add $0x10,%esp
75e: e9 0d 01 00 00 jmp 870 <printf+0x177>
}
} else if(state == '%'){
763: 83 7d ec 25 cmpl $0x25,-0x14(%ebp)
767: 0f 85 03 01 00 00 jne 870 <printf+0x177>
if(c == 'd'){
76d: 83 7d e4 64 cmpl $0x64,-0x1c(%ebp)
771: 75 1e jne 791 <printf+0x98>
printint(fd, *ap, 10, 1);
773: 8b 45 e8 mov -0x18(%ebp),%eax
776: 8b 00 mov (%eax),%eax
778: 6a 01 push $0x1
77a: 6a 0a push $0xa
77c: 50 push %eax
77d: ff 75 08 pushl 0x8(%ebp)
780: e8 c0 fe ff ff call 645 <printint>
785: 83 c4 10 add $0x10,%esp
ap++;
788: 83 45 e8 04 addl $0x4,-0x18(%ebp)
78c: e9 d8 00 00 00 jmp 869 <printf+0x170>
} else if(c == 'x' || c == 'p'){
791: 83 7d e4 78 cmpl $0x78,-0x1c(%ebp)
795: 74 06 je 79d <printf+0xa4>
797: 83 7d e4 70 cmpl $0x70,-0x1c(%ebp)
79b: 75 1e jne 7bb <printf+0xc2>
printint(fd, *ap, 16, 0);
79d: 8b 45 e8 mov -0x18(%ebp),%eax
7a0: 8b 00 mov (%eax),%eax
7a2: 6a 00 push $0x0
7a4: 6a 10 push $0x10
7a6: 50 push %eax
7a7: ff 75 08 pushl 0x8(%ebp)
7aa: e8 96 fe ff ff call 645 <printint>
7af: 83 c4 10 add $0x10,%esp
ap++;
7b2: 83 45 e8 04 addl $0x4,-0x18(%ebp)
7b6: e9 ae 00 00 00 jmp 869 <printf+0x170>
} else if(c == 's'){
7bb: 83 7d e4 73 cmpl $0x73,-0x1c(%ebp)
7bf: 75 43 jne 804 <printf+0x10b>
s = (char*)*ap;
7c1: 8b 45 e8 mov -0x18(%ebp),%eax
7c4: 8b 00 mov (%eax),%eax
7c6: 89 45 f4 mov %eax,-0xc(%ebp)
ap++;
7c9: 83 45 e8 04 addl $0x4,-0x18(%ebp)
if(s == 0)
7cd: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
7d1: 75 25 jne 7f8 <printf+0xff>
s = "(null)";
7d3: c7 45 f4 e6 0a 00 00 movl $0xae6,-0xc(%ebp)
while(*s != 0){
7da: eb 1c jmp 7f8 <printf+0xff>
putc(fd, *s);
7dc: 8b 45 f4 mov -0xc(%ebp),%eax
7df: 0f b6 00 movzbl (%eax),%eax
7e2: 0f be c0 movsbl %al,%eax
7e5: 83 ec 08 sub $0x8,%esp
7e8: 50 push %eax
7e9: ff 75 08 pushl 0x8(%ebp)
7ec: e8 31 fe ff ff call 622 <putc>
7f1: 83 c4 10 add $0x10,%esp
s++;
7f4: 83 45 f4 01 addl $0x1,-0xc(%ebp)
while(*s != 0){
7f8: 8b 45 f4 mov -0xc(%ebp),%eax
7fb: 0f b6 00 movzbl (%eax),%eax
7fe: 84 c0 test %al,%al
800: 75 da jne 7dc <printf+0xe3>
802: eb 65 jmp 869 <printf+0x170>
}
} else if(c == 'c'){
804: 83 7d e4 63 cmpl $0x63,-0x1c(%ebp)
808: 75 1d jne 827 <printf+0x12e>
putc(fd, *ap);
80a: 8b 45 e8 mov -0x18(%ebp),%eax
80d: 8b 00 mov (%eax),%eax
80f: 0f be c0 movsbl %al,%eax
812: 83 ec 08 sub $0x8,%esp
815: 50 push %eax
816: ff 75 08 pushl 0x8(%ebp)
819: e8 04 fe ff ff call 622 <putc>
81e: 83 c4 10 add $0x10,%esp
ap++;
821: 83 45 e8 04 addl $0x4,-0x18(%ebp)
825: eb 42 jmp 869 <printf+0x170>
} else if(c == '%'){
827: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp)
82b: 75 17 jne 844 <printf+0x14b>
putc(fd, c);
82d: 8b 45 e4 mov -0x1c(%ebp),%eax
830: 0f be c0 movsbl %al,%eax
833: 83 ec 08 sub $0x8,%esp
836: 50 push %eax
837: ff 75 08 pushl 0x8(%ebp)
83a: e8 e3 fd ff ff call 622 <putc>
83f: 83 c4 10 add $0x10,%esp
842: eb 25 jmp 869 <printf+0x170>
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
844: 83 ec 08 sub $0x8,%esp
847: 6a 25 push $0x25
849: ff 75 08 pushl 0x8(%ebp)
84c: e8 d1 fd ff ff call 622 <putc>
851: 83 c4 10 add $0x10,%esp
putc(fd, c);
854: 8b 45 e4 mov -0x1c(%ebp),%eax
857: 0f be c0 movsbl %al,%eax
85a: 83 ec 08 sub $0x8,%esp
85d: 50 push %eax
85e: ff 75 08 pushl 0x8(%ebp)
861: e8 bc fd ff ff call 622 <putc>
866: 83 c4 10 add $0x10,%esp
}
state = 0;
869: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
for(i = 0; fmt[i]; i++){
870: 83 45 f0 01 addl $0x1,-0x10(%ebp)
874: 8b 55 0c mov 0xc(%ebp),%edx
877: 8b 45 f0 mov -0x10(%ebp),%eax
87a: 01 d0 add %edx,%eax
87c: 0f b6 00 movzbl (%eax),%eax
87f: 84 c0 test %al,%al
881: 0f 85 94 fe ff ff jne 71b <printf+0x22>
}
}
}
887: 90 nop
888: c9 leave
889: c3 ret
0000088a <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
88a: 55 push %ebp
88b: 89 e5 mov %esp,%ebp
88d: 83 ec 10 sub $0x10,%esp
Header *bp, *p;
bp = (Header*)ap - 1;
890: 8b 45 08 mov 0x8(%ebp),%eax
893: 83 e8 08 sub $0x8,%eax
896: 89 45 f8 mov %eax,-0x8(%ebp)
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
899: a1 e8 0d 00 00 mov 0xde8,%eax
89e: 89 45 fc mov %eax,-0x4(%ebp)
8a1: eb 24 jmp 8c7 <free+0x3d>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
8a3: 8b 45 fc mov -0x4(%ebp),%eax
8a6: 8b 00 mov (%eax),%eax
8a8: 3b 45 fc cmp -0x4(%ebp),%eax
8ab: 77 12 ja 8bf <free+0x35>
8ad: 8b 45 f8 mov -0x8(%ebp),%eax
8b0: 3b 45 fc cmp -0x4(%ebp),%eax
8b3: 77 24 ja 8d9 <free+0x4f>
8b5: 8b 45 fc mov -0x4(%ebp),%eax
8b8: 8b 00 mov (%eax),%eax
8ba: 3b 45 f8 cmp -0x8(%ebp),%eax
8bd: 77 1a ja 8d9 <free+0x4f>
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
8bf: 8b 45 fc mov -0x4(%ebp),%eax
8c2: 8b 00 mov (%eax),%eax
8c4: 89 45 fc mov %eax,-0x4(%ebp)
8c7: 8b 45 f8 mov -0x8(%ebp),%eax
8ca: 3b 45 fc cmp -0x4(%ebp),%eax
8cd: 76 d4 jbe 8a3 <free+0x19>
8cf: 8b 45 fc mov -0x4(%ebp),%eax
8d2: 8b 00 mov (%eax),%eax
8d4: 3b 45 f8 cmp -0x8(%ebp),%eax
8d7: 76 ca jbe 8a3 <free+0x19>
break;
if(bp + bp->s.size == p->s.ptr){
8d9: 8b 45 f8 mov -0x8(%ebp),%eax
8dc: 8b 40 04 mov 0x4(%eax),%eax
8df: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx
8e6: 8b 45 f8 mov -0x8(%ebp),%eax
8e9: 01 c2 add %eax,%edx
8eb: 8b 45 fc mov -0x4(%ebp),%eax
8ee: 8b 00 mov (%eax),%eax
8f0: 39 c2 cmp %eax,%edx
8f2: 75 24 jne 918 <free+0x8e>
bp->s.size += p->s.ptr->s.size;
8f4: 8b 45 f8 mov -0x8(%ebp),%eax
8f7: 8b 50 04 mov 0x4(%eax),%edx
8fa: 8b 45 fc mov -0x4(%ebp),%eax
8fd: 8b 00 mov (%eax),%eax
8ff: 8b 40 04 mov 0x4(%eax),%eax
902: 01 c2 add %eax,%edx
904: 8b 45 f8 mov -0x8(%ebp),%eax
907: 89 50 04 mov %edx,0x4(%eax)
bp->s.ptr = p->s.ptr->s.ptr;
90a: 8b 45 fc mov -0x4(%ebp),%eax
90d: 8b 00 mov (%eax),%eax
90f: 8b 10 mov (%eax),%edx
911: 8b 45 f8 mov -0x8(%ebp),%eax
914: 89 10 mov %edx,(%eax)
916: eb 0a jmp 922 <free+0x98>
} else
bp->s.ptr = p->s.ptr;
918: 8b 45 fc mov -0x4(%ebp),%eax
91b: 8b 10 mov (%eax),%edx
91d: 8b 45 f8 mov -0x8(%ebp),%eax
920: 89 10 mov %edx,(%eax)
if(p + p->s.size == bp){
922: 8b 45 fc mov -0x4(%ebp),%eax
925: 8b 40 04 mov 0x4(%eax),%eax
928: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx
92f: 8b 45 fc mov -0x4(%ebp),%eax
932: 01 d0 add %edx,%eax
934: 3b 45 f8 cmp -0x8(%ebp),%eax
937: 75 20 jne 959 <free+0xcf>
p->s.size += bp->s.size;
939: 8b 45 fc mov -0x4(%ebp),%eax
93c: 8b 50 04 mov 0x4(%eax),%edx
93f: 8b 45 f8 mov -0x8(%ebp),%eax
942: 8b 40 04 mov 0x4(%eax),%eax
945: 01 c2 add %eax,%edx
947: 8b 45 fc mov -0x4(%ebp),%eax
94a: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
94d: 8b 45 f8 mov -0x8(%ebp),%eax
950: 8b 10 mov (%eax),%edx
952: 8b 45 fc mov -0x4(%ebp),%eax
955: 89 10 mov %edx,(%eax)
957: eb 08 jmp 961 <free+0xd7>
} else
p->s.ptr = bp;
959: 8b 45 fc mov -0x4(%ebp),%eax
95c: 8b 55 f8 mov -0x8(%ebp),%edx
95f: 89 10 mov %edx,(%eax)
freep = p;
961: 8b 45 fc mov -0x4(%ebp),%eax
964: a3 e8 0d 00 00 mov %eax,0xde8
}
969: 90 nop
96a: c9 leave
96b: c3 ret
0000096c <morecore>:
static Header*
morecore(uint nu)
{
96c: 55 push %ebp
96d: 89 e5 mov %esp,%ebp
96f: 83 ec 18 sub $0x18,%esp
char *p;
Header *hp;
if(nu < 4096)
972: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp)
979: 77 07 ja 982 <morecore+0x16>
nu = 4096;
97b: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp)
p = sbrk(nu * sizeof(Header));
982: 8b 45 08 mov 0x8(%ebp),%eax
985: c1 e0 03 shl $0x3,%eax
988: 83 ec 0c sub $0xc,%esp
98b: 50 push %eax
98c: e8 79 fc ff ff call 60a <sbrk>
991: 83 c4 10 add $0x10,%esp
994: 89 45 f4 mov %eax,-0xc(%ebp)
if(p == (char*)-1)
997: 83 7d f4 ff cmpl $0xffffffff,-0xc(%ebp)
99b: 75 07 jne 9a4 <morecore+0x38>
return 0;
99d: b8 00 00 00 00 mov $0x0,%eax
9a2: eb 26 jmp 9ca <morecore+0x5e>
hp = (Header*)p;
9a4: 8b 45 f4 mov -0xc(%ebp),%eax
9a7: 89 45 f0 mov %eax,-0x10(%ebp)
hp->s.size = nu;
9aa: 8b 45 f0 mov -0x10(%ebp),%eax
9ad: 8b 55 08 mov 0x8(%ebp),%edx
9b0: 89 50 04 mov %edx,0x4(%eax)
free((void*)(hp + 1));
9b3: 8b 45 f0 mov -0x10(%ebp),%eax
9b6: 83 c0 08 add $0x8,%eax
9b9: 83 ec 0c sub $0xc,%esp
9bc: 50 push %eax
9bd: e8 c8 fe ff ff call 88a <free>
9c2: 83 c4 10 add $0x10,%esp
return freep;
9c5: a1 e8 0d 00 00 mov 0xde8,%eax
}
9ca: c9 leave
9cb: c3 ret
000009cc <malloc>:
void*
malloc(uint nbytes)
{
9cc: 55 push %ebp
9cd: 89 e5 mov %esp,%ebp
9cf: 83 ec 18 sub $0x18,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
9d2: 8b 45 08 mov 0x8(%ebp),%eax
9d5: 83 c0 07 add $0x7,%eax
9d8: c1 e8 03 shr $0x3,%eax
9db: 83 c0 01 add $0x1,%eax
9de: 89 45 ec mov %eax,-0x14(%ebp)
if((prevp = freep) == 0){
9e1: a1 e8 0d 00 00 mov 0xde8,%eax
9e6: 89 45 f0 mov %eax,-0x10(%ebp)
9e9: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
9ed: 75 23 jne a12 <malloc+0x46>
base.s.ptr = freep = prevp = &base;
9ef: c7 45 f0 e0 0d 00 00 movl $0xde0,-0x10(%ebp)
9f6: 8b 45 f0 mov -0x10(%ebp),%eax
9f9: a3 e8 0d 00 00 mov %eax,0xde8
9fe: a1 e8 0d 00 00 mov 0xde8,%eax
a03: a3 e0 0d 00 00 mov %eax,0xde0
base.s.size = 0;
a08: c7 05 e4 0d 00 00 00 movl $0x0,0xde4
a0f: 00 00 00
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
a12: 8b 45 f0 mov -0x10(%ebp),%eax
a15: 8b 00 mov (%eax),%eax
a17: 89 45 f4 mov %eax,-0xc(%ebp)
if(p->s.size >= nunits){
a1a: 8b 45 f4 mov -0xc(%ebp),%eax
a1d: 8b 40 04 mov 0x4(%eax),%eax
a20: 3b 45 ec cmp -0x14(%ebp),%eax
a23: 72 4d jb a72 <malloc+0xa6>
if(p->s.size == nunits)
a25: 8b 45 f4 mov -0xc(%ebp),%eax
a28: 8b 40 04 mov 0x4(%eax),%eax
a2b: 3b 45 ec cmp -0x14(%ebp),%eax
a2e: 75 0c jne a3c <malloc+0x70>
prevp->s.ptr = p->s.ptr;
a30: 8b 45 f4 mov -0xc(%ebp),%eax
a33: 8b 10 mov (%eax),%edx
a35: 8b 45 f0 mov -0x10(%ebp),%eax
a38: 89 10 mov %edx,(%eax)
a3a: eb 26 jmp a62 <malloc+0x96>
else {
p->s.size -= nunits;
a3c: 8b 45 f4 mov -0xc(%ebp),%eax
a3f: 8b 40 04 mov 0x4(%eax),%eax
a42: 2b 45 ec sub -0x14(%ebp),%eax
a45: 89 c2 mov %eax,%edx
a47: 8b 45 f4 mov -0xc(%ebp),%eax
a4a: 89 50 04 mov %edx,0x4(%eax)
p += p->s.size;
a4d: 8b 45 f4 mov -0xc(%ebp),%eax
a50: 8b 40 04 mov 0x4(%eax),%eax
a53: c1 e0 03 shl $0x3,%eax
a56: 01 45 f4 add %eax,-0xc(%ebp)
p->s.size = nunits;
a59: 8b 45 f4 mov -0xc(%ebp),%eax
a5c: 8b 55 ec mov -0x14(%ebp),%edx
a5f: 89 50 04 mov %edx,0x4(%eax)
}
freep = prevp;
a62: 8b 45 f0 mov -0x10(%ebp),%eax
a65: a3 e8 0d 00 00 mov %eax,0xde8
return (void*)(p + 1);
a6a: 8b 45 f4 mov -0xc(%ebp),%eax
a6d: 83 c0 08 add $0x8,%eax
a70: eb 3b jmp aad <malloc+0xe1>
}
if(p == freep)
a72: a1 e8 0d 00 00 mov 0xde8,%eax
a77: 39 45 f4 cmp %eax,-0xc(%ebp)
a7a: 75 1e jne a9a <malloc+0xce>
if((p = morecore(nunits)) == 0)
a7c: 83 ec 0c sub $0xc,%esp
a7f: ff 75 ec pushl -0x14(%ebp)
a82: e8 e5 fe ff ff call 96c <morecore>
a87: 83 c4 10 add $0x10,%esp
a8a: 89 45 f4 mov %eax,-0xc(%ebp)
a8d: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
a91: 75 07 jne a9a <malloc+0xce>
return 0;
a93: b8 00 00 00 00 mov $0x0,%eax
a98: eb 13 jmp aad <malloc+0xe1>
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
a9a: 8b 45 f4 mov -0xc(%ebp),%eax
a9d: 89 45 f0 mov %eax,-0x10(%ebp)
aa0: 8b 45 f4 mov -0xc(%ebp),%eax
aa3: 8b 00 mov (%eax),%eax
aa5: 89 45 f4 mov %eax,-0xc(%ebp)
if(p->s.size >= nunits){
aa8: e9 6d ff ff ff jmp a1a <malloc+0x4e>
}
}
aad: c9 leave
aae: c3 ret
| 36.318182 | 60 | 0.423617 | [
"MIT-0"
] | eudemkeon/EEE3535 | grep.asm | 52,734 | Assembly |
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r13
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WT_ht+0x11aa9, %rdi
nop
nop
nop
nop
nop
and %rdx, %rdx
mov $0x6162636465666768, %rbp
movq %rbp, (%rdi)
nop
nop
nop
nop
and %rdx, %rdx
lea addresses_WC_ht+0x8092, %rsi
nop
nop
cmp $63760, %r13
mov (%rsi), %rcx
nop
nop
nop
cmp %rcx, %rcx
lea addresses_normal_ht+0x1a770, %rsi
lea addresses_WT_ht+0x1970a, %rdi
nop
and $27593, %r10
mov $54, %rcx
rep movsl
nop
nop
nop
nop
nop
inc %rbp
lea addresses_WC_ht+0xa375, %rsi
lea addresses_A_ht+0xbda6, %rdi
nop
nop
nop
nop
nop
inc %r11
mov $15, %rcx
rep movsl
nop
nop
nop
nop
sub $44152, %rsi
lea addresses_normal_ht+0x15792, %r13
nop
nop
nop
nop
cmp $51311, %rdx
movw $0x6162, (%r13)
and $40985, %r10
lea addresses_WT_ht+0x44f2, %r10
nop
nop
nop
nop
nop
xor %rdi, %rdi
movb (%r10), %r11b
nop
nop
nop
sub $35704, %r10
lea addresses_A_ht+0x6d12, %rcx
nop
nop
nop
and $32580, %rdi
movups (%rcx), %xmm1
vpextrq $0, %xmm1, %r13
nop
dec %rsi
lea addresses_D_ht+0x19a92, %rcx
nop
xor %rdi, %rdi
mov (%rcx), %rdx
nop
nop
nop
sub $33486, %rdx
lea addresses_UC_ht+0x6c6a, %rsi
lea addresses_UC_ht+0x14c92, %rdi
nop
nop
nop
nop
nop
xor %r13, %r13
mov $17, %rcx
rep movsl
nop
nop
nop
nop
nop
add $43377, %r10
lea addresses_UC_ht+0x17d5e, %rsi
lea addresses_WC_ht+0x10b92, %rdi
nop
nop
nop
nop
and $59453, %r11
mov $68, %rcx
rep movsl
cmp %rbp, %rbp
lea addresses_UC_ht+0x1eaf6, %rsi
lea addresses_WT_ht+0x7792, %rdi
nop
nop
nop
nop
nop
add %r11, %r11
mov $64, %rcx
rep movsw
nop
xor %r11, %r11
lea addresses_WC_ht+0x11992, %rsi
lea addresses_UC_ht+0xb25a, %rdi
nop
nop
and $29975, %r13
mov $22, %rcx
rep movsq
nop
nop
nop
nop
dec %rcx
lea addresses_WT_ht+0x140b2, %rcx
nop
nop
nop
xor $45203, %rdi
mov (%rcx), %rbp
sub $13118, %rcx
lea addresses_WC_ht+0x10592, %rdx
nop
add $50143, %rcx
mov $0x6162636465666768, %rdi
movq %rdi, %xmm6
movups %xmm6, (%rdx)
nop
nop
nop
nop
nop
and $39310, %rcx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %r13
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r15
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
// REPMOV
lea addresses_WT+0xd492, %rsi
lea addresses_UC+0x1f3c, %rdi
cmp $61773, %rdx
mov $74, %rcx
rep movsq
nop
nop
nop
nop
nop
and $49451, %rcx
// Store
mov $0x7a94560000000092, %rdi
clflush (%rdi)
dec %r15
movl $0x51525354, (%rdi)
nop
nop
nop
add %r15, %r15
// Store
lea addresses_normal+0xe212, %rdi
clflush (%rdi)
nop
nop
nop
nop
nop
xor %r15, %r15
mov $0x5152535455565758, %r12
movq %r12, (%rdi)
nop
nop
dec %rsi
// Store
lea addresses_A+0xe228, %rsi
nop
nop
nop
inc %rcx
mov $0x5152535455565758, %rax
movq %rax, %xmm2
vmovups %ymm2, (%rsi)
nop
nop
xor $52451, %rsi
// Faulty Load
mov $0x7a94560000000092, %r12
nop
nop
nop
add $49356, %r15
mov (%r12), %eax
lea oracles, %rsi
and $0xff, %rax
shlq $12, %rax
mov (%rsi,%rax,1), %rax
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r15
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_NC', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT', 'congruent': 8, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC', 'congruent': 1, 'same': False}}
{'OP': 'STOR', 'dst': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_NC', 'size': 4, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_normal', 'size': 8, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_A', 'size': 32, 'AVXalign': False}}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_NC', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_WT_ht', 'size': 8, 'AVXalign': False}}
{'src': {'same': True, 'congruent': 7, 'NT': False, 'type': 'addresses_WC_ht', 'size': 8, 'AVXalign': True}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 0, 'same': False}}
{'src': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 2, 'same': True}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 8, 'NT': False, 'type': 'addresses_normal_ht', 'size': 2, 'AVXalign': True}}
{'src': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_A_ht', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 8, 'NT': False, 'type': 'addresses_D_ht', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_UC_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 9, 'same': False}}
{'src': {'type': 'addresses_UC_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 8, 'same': False}}
{'src': {'type': 'addresses_UC_ht', 'congruent': 2, 'same': True}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 6, 'same': False}}
{'src': {'type': 'addresses_WC_ht', 'congruent': 8, 'same': True}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 2, 'same': False}}
{'src': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_WT_ht', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_WC_ht', 'size': 16, 'AVXalign': False}}
{'54': 22}
54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54
*/
| 20.108392 | 152 | 0.652756 | [
"MIT"
] | danielmgmi/medusa | Transynther/_processed/NC/_st_sm_/i3-7100_9_0xca_notsx.log_22_1978.asm | 5,751 | Assembly |
; A270049: Number of 123 avoiding set partitions of [n].
; Submitted by Jamie Morken(s2)
; 1,1,3,7,21,61,199,659,2345,8569,32971,130527,538045,2279733,9987727,44897131,207693905,983926001,4780294291,23740460215,120595843941,625175300653,3308054119767,17837452131139,98006292402553,548026191197801,3118110841312091,18034745343703183,106009802431689997,632803481771642661,3834918364438606111,23579656911507482139,147057678667462473889,929781909205567586785,5957918193269157383459,38675517903501351079271,254265587658433912628917,1692322683078495955690525,11400153464992998039797223
lpb $0
sub $0,1
add $1,1
add $2,$3
mov $3,$1
mov $1,$2
add $4,1
mul $1,$4
lpe
mov $0,$1
add $0,1
| 43.25 | 490 | 0.820809 | [
"Apache-2.0"
] | ckrause/loda-programs | oeis/270/A270049.asm | 692 | Assembly |
; A016905: a(n) = (5*n + 4)^9.
; 262144,387420489,20661046784,322687697779,2641807540224,14507145975869,60716992766464,208728361158759,618121839509504,1628413597910449,3904305912313344,8662995818654939,18014398509481984,35452087835576229,66540410775079424,119851595982618319,208215748530929664,350356403707485209,572994802228616704,913517247483640899,1423311812421484544,2171893279442309389,3251948521156637184,4785448563124474679,6930988311686938624,9892530380752880769,13929745610903012864,19370159742424031659,26623333280885243904,36197319879620191349,48717667557975775744,64949246777441383839,85821209809770512384,112455406951957393129,146198606972431117824,188658891711079763219,241746618002717016064,307720364049353798109,389238302031137391104,489415464119070561799,611887395134623186944,760880711892098878289,941291116759119107584,1158769441178837331579,1419816323814495617024,1731886157602686265669,2103500970336180939264,2544374934440439784559,3065550233359913058304,3679545044430997752249,4400514431288011718144,5244424972726797792739,6229243989537570422784,7375144266114367290029,8704725199652968436224,10243251346462395388119,12018909372337102782464,14063084452067724991009,16410657202007740245504,19100322269161664762699,22174929740517389369344,25681850577311021127189,29673367320587092457984,34207091356800250268479,39346408075296537575424,45160951293313130130569,51727108368644890545664,59128557465344352417459,67456838483748746952704,76811959212763434593149,87303038309675604140544,99048986760825351881639,112179229525223253213184,126834469112674289266929,143167492898147491034624,161344026025018913493019,181543631801412552228864,203960661546169565063909,228805255893990661179904,256304399623019770243599,286703032122569104031744,320265215673826473056089,357275363772235220688384,398039531776795387285379,442886772228801716813824,492170557240509868475469,546270270412906695832064,605592770801153705930359,670574031506374810927104,741680855533270234714049,819412671614557937042944,904303412765472167650539,996923480394485762883584,1097881796860068547323829,1207827949427648702913024,1327454428646007218077919,1457498964228107529355264,1598746961587843218016809,1752034042251376124194304,1918248691429635491004499
mul $0,5
add $0,4
pow $0,9
| 322.428571 | 2,197 | 0.941072 | [
"Apache-2.0"
] | ckrause/cm | programs/oeis/016/A016905.asm | 2,257 | Assembly |
BITS 32
;TEST_FILE_META_BEGIN
;TEST_TYPE=TEST_F
;TEST_IGNOREFLAGS=
;TEST_FILE_META_END
; allocate 16 byte aligned stack space for the packed values
lea ecx, [esp-33]
and ecx, 0xfffffff0
; load a 128 bit value into xmm0
mov DWORD [ecx], 0x55555555
mov DWORD [ecx+4], 0x14530451
mov DWORD [ecx+8], 0x1badb002
mov DWORD [ecx+12], 0xf0f0f0f0
movaps xmm0, [ecx]
lea ecx, [ecx+16]
; load a 128 bit value into xmm1
mov DWORD [ecx], 0xaaaaaaaa
mov DWORD [ecx+4], 0xcafebabe
mov DWORD [ecx+8], 0x2badb002
mov DWORD [ecx+12], 0x0e0e0e0e
movaps xmm1, [ecx]
;TEST_BEGIN_RECORDING
paddd xmm0, xmm1
;TEST_END_RECORDING
xor ecx, ecx
cvtsi2sd xmm0, ecx
cvtsi2sd xmm1, ecx
| 19.470588 | 60 | 0.758308 | [
"BSD-3-Clause"
] | 0xDEC0DE8/mcsema | mc-sema/validator/x86/tests/PADDDrr.asm | 662 | Assembly |
; A192816: a(n) = A192815(n)/2.
; Submitted by Christian Krause
; 0,1,2,7,36,173,806,3763,17608,82393,385482,1803487,8437740,39476613,184694254,864105611,4042781584,18914450865,88492648850,414019362743,1937020023220,9062490569821,42399528318646,198369310046307,928085399264344,4342115764413321,20314907794597722,95044789474599055,444674034340095356,2080440157838863669,9733492212496225662,45538858829345204795,213056898614109392672,996802362069984928609,4663613126313012898594,21819056835653875455847,102082061333820233083716,477598428046330629341197
mov $1,-1
mov $4,1
lpb $0
sub $0,1
add $1,$3
mul $2,2
sub $1,$2
mov $2,$4
add $4,$1
add $2,$4
sub $4,$3
add $3,$2
add $3,$2
add $1,$3
lpe
mov $0,$3
div $0,2
| 33.227273 | 486 | 0.783858 | [
"Apache-2.0"
] | ckrause/loda-programs | oeis/192/A192816.asm | 731 | Assembly |
.686
.XMM
.MODEL flat, c
ASSUME fs:_DATA
.data
.code
EXTERN SW2_GetSyscallNumber: PROC
WhisperMain PROC
pop eax ; Remove return address from CALL instruction
call SW2_GetSyscallNumber ; Resolve function hash into syscall number
add esp, 4 ; Restore ESP
mov ecx, fs:[0c0h]
test ecx, ecx
jne _wow64
lea edx, [esp+4h]
INT 02eh
ret
_wow64:
xor ecx, ecx
lea edx, [esp+4h]
call dword ptr fs:[0c0h]
ret
WhisperMain ENDP
NtAccessCheck PROC
push 0FA40F4F9h
call WhisperMain
NtAccessCheck ENDP
NtWorkerFactoryWorkerReady PROC
push 011A63B35h
call WhisperMain
NtWorkerFactoryWorkerReady ENDP
NtAcceptConnectPort PROC
push 064F17B62h
call WhisperMain
NtAcceptConnectPort ENDP
NtMapUserPhysicalPagesScatter PROC
push 0238A0D17h
call WhisperMain
NtMapUserPhysicalPagesScatter ENDP
NtWaitForSingleObject PROC
push 0009E3E33h
call WhisperMain
NtWaitForSingleObject ENDP
NtCallbackReturn PROC
push 0168C371Ah
call WhisperMain
NtCallbackReturn ENDP
NtReadFile PROC
push 0C544CDF1h
call WhisperMain
NtReadFile ENDP
NtDeviceIoControlFile PROC
push 022342AD2h
call WhisperMain
NtDeviceIoControlFile ENDP
NtWriteFile PROC
push 0E97AEB1Fh
call WhisperMain
NtWriteFile ENDP
NtRemoveIoCompletion PROC
push 0088E0821h
call WhisperMain
NtRemoveIoCompletion ENDP
NtReleaseSemaphore PROC
push 034A10CFCh
call WhisperMain
NtReleaseSemaphore ENDP
NtReplyWaitReceivePort PROC
push 0ACFE8EA0h
call WhisperMain
NtReplyWaitReceivePort ENDP
NtReplyPort PROC
push 062B0692Eh
call WhisperMain
NtReplyPort ENDP
NtSetInformationThread PROC
push 00A2E4E86h
call WhisperMain
NtSetInformationThread ENDP
NtSetEvent PROC
push 058924AF4h
call WhisperMain
NtSetEvent ENDP
NtClose PROC
push 00352369Dh
call WhisperMain
NtClose ENDP
NtQueryObject PROC
push 08CA077CCh
call WhisperMain
NtQueryObject ENDP
NtQueryInformationFile PROC
push 0A635B086h
call WhisperMain
NtQueryInformationFile ENDP
NtOpenKey PROC
push 00F1A54C7h
call WhisperMain
NtOpenKey ENDP
NtEnumerateValueKey PROC
push 016AB2319h
call WhisperMain
NtEnumerateValueKey ENDP
NtFindAtom PROC
push 03565D433h
call WhisperMain
NtFindAtom ENDP
NtQueryDefaultLocale PROC
push 0025D728Bh
call WhisperMain
NtQueryDefaultLocale ENDP
NtQueryKey PROC
push 008172BACh
call WhisperMain
NtQueryKey ENDP
NtQueryValueKey PROC
push 0E15C142Eh
call WhisperMain
NtQueryValueKey ENDP
NtAllocateVirtualMemory PROC
push 01F88E9E7h
call WhisperMain
NtAllocateVirtualMemory ENDP
NtQueryInformationProcess PROC
push 0D99B2213h
call WhisperMain
NtQueryInformationProcess ENDP
NtWaitForMultipleObjects32 PROC
push 08E9DAF4Ah
call WhisperMain
NtWaitForMultipleObjects32 ENDP
NtWriteFileGather PROC
push 02B907B53h
call WhisperMain
NtWriteFileGather ENDP
NtCreateKey PROC
push 07EC9073Bh
call WhisperMain
NtCreateKey ENDP
NtFreeVirtualMemory PROC
push 0099E0519h
call WhisperMain
NtFreeVirtualMemory ENDP
NtImpersonateClientOfPort PROC
push 060F36F68h
call WhisperMain
NtImpersonateClientOfPort ENDP
NtReleaseMutant PROC
push 02D4A0AD0h
call WhisperMain
NtReleaseMutant ENDP
NtQueryInformationToken PROC
push 035AA1F32h
call WhisperMain
NtQueryInformationToken ENDP
NtRequestWaitReplyPort PROC
push 0E273D9DCh
call WhisperMain
NtRequestWaitReplyPort ENDP
NtQueryVirtualMemory PROC
push 09514A39Bh
call WhisperMain
NtQueryVirtualMemory ENDP
NtOpenThreadToken PROC
push 0F8512DEAh
call WhisperMain
NtOpenThreadToken ENDP
NtQueryInformationThread PROC
push 024881E11h
call WhisperMain
NtQueryInformationThread ENDP
NtOpenProcess PROC
push 006AC0521h
call WhisperMain
NtOpenProcess ENDP
NtSetInformationFile PROC
push 0CA7AC2ECh
call WhisperMain
NtSetInformationFile ENDP
NtMapViewOfSection PROC
push 004960E0Bh
call WhisperMain
NtMapViewOfSection ENDP
NtAccessCheckAndAuditAlarm PROC
push 00F2EC371h
call WhisperMain
NtAccessCheckAndAuditAlarm ENDP
NtUnmapViewOfSection PROC
push 0568C3591h
call WhisperMain
NtUnmapViewOfSection ENDP
NtReplyWaitReceivePortEx PROC
push 0A25FEA98h
call WhisperMain
NtReplyWaitReceivePortEx ENDP
NtTerminateProcess PROC
push 0FE26D5BBh
call WhisperMain
NtTerminateProcess ENDP
NtSetEventBoostPriority PROC
push 030863C0Ch
call WhisperMain
NtSetEventBoostPriority ENDP
NtReadFileScatter PROC
push 0159C1D07h
call WhisperMain
NtReadFileScatter ENDP
NtOpenThreadTokenEx PROC
push 02FBAF2EFh
call WhisperMain
NtOpenThreadTokenEx ENDP
NtOpenProcessTokenEx PROC
push 0791FB957h
call WhisperMain
NtOpenProcessTokenEx ENDP
NtQueryPerformanceCounter PROC
push 037D24B39h
call WhisperMain
NtQueryPerformanceCounter ENDP
NtEnumerateKey PROC
push 0B6AE97F4h
call WhisperMain
NtEnumerateKey ENDP
NtOpenFile PROC
push 0AD1C2B01h
call WhisperMain
NtOpenFile ENDP
NtDelayExecution PROC
push 0520D529Fh
call WhisperMain
NtDelayExecution ENDP
NtQueryDirectoryFile PROC
push 058BBAAE2h
call WhisperMain
NtQueryDirectoryFile ENDP
NtQuerySystemInformation PROC
push 054CD765Dh
call WhisperMain
NtQuerySystemInformation ENDP
NtOpenSection PROC
push 00A9E284Fh
call WhisperMain
NtOpenSection ENDP
NtQueryTimer PROC
push 0179F7F46h
call WhisperMain
NtQueryTimer ENDP
NtFsControlFile PROC
push 06AF45662h
call WhisperMain
NtFsControlFile ENDP
NtWriteVirtualMemory PROC
push 005953B23h
call WhisperMain
NtWriteVirtualMemory ENDP
NtCloseObjectAuditAlarm PROC
push 05CDA584Ch
call WhisperMain
NtCloseObjectAuditAlarm ENDP
NtDuplicateObject PROC
push 03EA1F6FDh
call WhisperMain
NtDuplicateObject ENDP
NtQueryAttributesFile PROC
push 0DD5DD9FDh
call WhisperMain
NtQueryAttributesFile ENDP
NtClearEvent PROC
push 0200B65DAh
call WhisperMain
NtClearEvent ENDP
NtReadVirtualMemory PROC
push 0071473E9h
call WhisperMain
NtReadVirtualMemory ENDP
NtOpenEvent PROC
push 030D52978h
call WhisperMain
NtOpenEvent ENDP
NtAdjustPrivilegesToken PROC
push 001940B2Dh
call WhisperMain
NtAdjustPrivilegesToken ENDP
NtDuplicateToken PROC
push 06DD92558h
call WhisperMain
NtDuplicateToken ENDP
NtContinue PROC
push 0009CD3D0h
call WhisperMain
NtContinue ENDP
NtQueryDefaultUILanguage PROC
push 013C5D178h
call WhisperMain
NtQueryDefaultUILanguage ENDP
NtQueueApcThread PROC
push 02E8A0C2Bh
call WhisperMain
NtQueueApcThread ENDP
NtYieldExecution PROC
push 014B63E33h
call WhisperMain
NtYieldExecution ENDP
NtAddAtom PROC
push 022BF272Eh
call WhisperMain
NtAddAtom ENDP
NtCreateEvent PROC
push 0B0B4AF3Fh
call WhisperMain
NtCreateEvent ENDP
NtQueryVolumeInformationFile PROC
push 0E5B3BD76h
call WhisperMain
NtQueryVolumeInformationFile ENDP
NtCreateSection PROC
push 04EC54C51h
call WhisperMain
NtCreateSection ENDP
NtFlushBuffersFile PROC
push 06CFB5E2Eh
call WhisperMain
NtFlushBuffersFile ENDP
NtApphelpCacheControl PROC
push 0FD6DDFBBh
call WhisperMain
NtApphelpCacheControl ENDP
NtCreateProcessEx PROC
push 0B998FB42h
call WhisperMain
NtCreateProcessEx ENDP
NtCreateThread PROC
push 0AF8CB334h
call WhisperMain
NtCreateThread ENDP
NtIsProcessInJob PROC
push 05CE54854h
call WhisperMain
NtIsProcessInJob ENDP
NtProtectVirtualMemory PROC
push 00F940311h
call WhisperMain
NtProtectVirtualMemory ENDP
NtQuerySection PROC
push 002EC25B9h
call WhisperMain
NtQuerySection ENDP
NtResumeThread PROC
push 07D5445CFh
call WhisperMain
NtResumeThread ENDP
NtTerminateThread PROC
push 0228E3037h
call WhisperMain
NtTerminateThread ENDP
NtReadRequestData PROC
push 0A23EB14Ch
call WhisperMain
NtReadRequestData ENDP
NtCreateFile PROC
push 02A9AE32Eh
call WhisperMain
NtCreateFile ENDP
NtQueryEvent PROC
push 02AB1F0E6h
call WhisperMain
NtQueryEvent ENDP
NtWriteRequestData PROC
push 09DC08975h
call WhisperMain
NtWriteRequestData ENDP
NtOpenDirectoryObject PROC
push 03C802E0Dh
call WhisperMain
NtOpenDirectoryObject ENDP
NtAccessCheckByTypeAndAuditAlarm PROC
push 0DD42B9D5h
call WhisperMain
NtAccessCheckByTypeAndAuditAlarm ENDP
NtWaitForMultipleObjects PROC
push 061AD6331h
call WhisperMain
NtWaitForMultipleObjects ENDP
NtSetInformationObject PROC
push 0271915A7h
call WhisperMain
NtSetInformationObject ENDP
NtCancelIoFile PROC
push 0821B7543h
call WhisperMain
NtCancelIoFile ENDP
NtTraceEvent PROC
push 0CAED7BD0h
call WhisperMain
NtTraceEvent ENDP
NtPowerInformation PROC
push 054C25A5Fh
call WhisperMain
NtPowerInformation ENDP
NtSetValueKey PROC
push 01DC11E58h
call WhisperMain
NtSetValueKey ENDP
NtCancelTimer PROC
push 001A23302h
call WhisperMain
NtCancelTimer ENDP
NtSetTimer PROC
push 005977F7Ch
call WhisperMain
NtSetTimer ENDP
NtAccessCheckByType PROC
push 0D442E30Ah
call WhisperMain
NtAccessCheckByType ENDP
NtAccessCheckByTypeResultList PROC
push 07EA17221h
call WhisperMain
NtAccessCheckByTypeResultList ENDP
NtAccessCheckByTypeResultListAndAuditAlarm PROC
push 0552A6982h
call WhisperMain
NtAccessCheckByTypeResultListAndAuditAlarm ENDP
NtAccessCheckByTypeResultListAndAuditAlarmByHandle PROC
push 099B41796h
call WhisperMain
NtAccessCheckByTypeResultListAndAuditAlarmByHandle ENDP
NtAcquireProcessActivityReference PROC
push 01A8958A0h
call WhisperMain
NtAcquireProcessActivityReference ENDP
NtAddAtomEx PROC
push 09390C74Ch
call WhisperMain
NtAddAtomEx ENDP
NtAddBootEntry PROC
push 005951912h
call WhisperMain
NtAddBootEntry ENDP
NtAddDriverEntry PROC
push 03B67B174h
call WhisperMain
NtAddDriverEntry ENDP
NtAdjustGroupsToken PROC
push 025971314h
call WhisperMain
NtAdjustGroupsToken ENDP
NtAdjustTokenClaimsAndDeviceGroups PROC
push 007900309h
call WhisperMain
NtAdjustTokenClaimsAndDeviceGroups ENDP
NtAlertResumeThread PROC
push 0A48BA81Ah
call WhisperMain
NtAlertResumeThread ENDP
NtAlertThread PROC
push 01CA4540Bh
call WhisperMain
NtAlertThread ENDP
NtAlertThreadByThreadId PROC
push 0B8A26896h
call WhisperMain
NtAlertThreadByThreadId ENDP
NtAllocateLocallyUniqueId PROC
push 0FFE51B65h
call WhisperMain
NtAllocateLocallyUniqueId ENDP
NtAllocateReserveObject PROC
push 018B4E6C9h
call WhisperMain
NtAllocateReserveObject ENDP
NtAllocateUserPhysicalPages PROC
push 019BF3A24h
call WhisperMain
NtAllocateUserPhysicalPages ENDP
NtAllocateUuids PROC
push 0338FFDD3h
call WhisperMain
NtAllocateUuids ENDP
NtAllocateVirtualMemoryEx PROC
push 0C8503B3Ah
call WhisperMain
NtAllocateVirtualMemoryEx ENDP
NtAlpcAcceptConnectPort PROC
push 030B2213Ch
call WhisperMain
NtAlpcAcceptConnectPort ENDP
NtAlpcCancelMessage PROC
push 073D77E7Ch
call WhisperMain
NtAlpcCancelMessage ENDP
NtAlpcConnectPort PROC
push 03EB1DDDEh
call WhisperMain
NtAlpcConnectPort ENDP
NtAlpcConnectPortEx PROC
push 0636DBF29h
call WhisperMain
NtAlpcConnectPortEx ENDP
NtAlpcCreatePort PROC
push 0194B9F58h
call WhisperMain
NtAlpcCreatePort ENDP
NtAlpcCreatePortSection PROC
push 0C4F5DE41h
call WhisperMain
NtAlpcCreatePortSection ENDP
NtAlpcCreateResourceReserve PROC
push 0389F4A77h
call WhisperMain
NtAlpcCreateResourceReserve ENDP
NtAlpcCreateSectionView PROC
push 02CA81D13h
call WhisperMain
NtAlpcCreateSectionView ENDP
NtAlpcCreateSecurityContext PROC
push 0FA1DE794h
call WhisperMain
NtAlpcCreateSecurityContext ENDP
NtAlpcDeletePortSection PROC
push 00C982C0Bh
call WhisperMain
NtAlpcDeletePortSection ENDP
NtAlpcDeleteResourceReserve PROC
push 01888F4C3h
call WhisperMain
NtAlpcDeleteResourceReserve ENDP
NtAlpcDeleteSectionView PROC
push 056EC6753h
call WhisperMain
NtAlpcDeleteSectionView ENDP
NtAlpcDeleteSecurityContext PROC
push 008B3EDDAh
call WhisperMain
NtAlpcDeleteSecurityContext ENDP
NtAlpcDisconnectPort PROC
push 022B5D93Ah
call WhisperMain
NtAlpcDisconnectPort ENDP
NtAlpcImpersonateClientContainerOfPort PROC
push 02233A722h
call WhisperMain
NtAlpcImpersonateClientContainerOfPort ENDP
NtAlpcImpersonateClientOfPort PROC
push 0D836C9DAh
call WhisperMain
NtAlpcImpersonateClientOfPort ENDP
NtAlpcOpenSenderProcess PROC
push 0C654C5C9h
call WhisperMain
NtAlpcOpenSenderProcess ENDP
NtAlpcOpenSenderThread PROC
push 0F85F36EDh
call WhisperMain
NtAlpcOpenSenderThread ENDP
NtAlpcQueryInformation PROC
push 0024618CEh
call WhisperMain
NtAlpcQueryInformation ENDP
NtAlpcQueryInformationMessage PROC
push 0A40091ADh
call WhisperMain
NtAlpcQueryInformationMessage ENDP
NtAlpcRevokeSecurityContext PROC
push 040998DC8h
call WhisperMain
NtAlpcRevokeSecurityContext ENDP
NtAlpcSendWaitReceivePort PROC
push 022B2A5B8h
call WhisperMain
NtAlpcSendWaitReceivePort ENDP
NtAlpcSetInformation PROC
push 0C897E64Bh
call WhisperMain
NtAlpcSetInformation ENDP
NtAreMappedFilesTheSame PROC
push 0D65AEDFDh
call WhisperMain
NtAreMappedFilesTheSame ENDP
NtAssignProcessToJobObject PROC
push 0FF2A6100h
call WhisperMain
NtAssignProcessToJobObject ENDP
NtAssociateWaitCompletionPacket PROC
push 007B22910h
call WhisperMain
NtAssociateWaitCompletionPacket ENDP
NtCallEnclave PROC
push 08736BB65h
call WhisperMain
NtCallEnclave ENDP
NtCancelIoFileEx PROC
push 0F758392Dh
call WhisperMain
NtCancelIoFileEx ENDP
NtCancelSynchronousIoFile PROC
push 0256033EAh
call WhisperMain
NtCancelSynchronousIoFile ENDP
NtCancelTimer2 PROC
push 003A35E2Dh
call WhisperMain
NtCancelTimer2 ENDP
NtCancelWaitCompletionPacket PROC
push 0BC9C9AC6h
call WhisperMain
NtCancelWaitCompletionPacket ENDP
NtCommitComplete PROC
push 00C9007FEh
call WhisperMain
NtCommitComplete ENDP
NtCommitEnlistment PROC
push 0164B0FC6h
call WhisperMain
NtCommitEnlistment ENDP
NtCommitRegistryTransaction PROC
push 004B43E31h
call WhisperMain
NtCommitRegistryTransaction ENDP
NtCommitTransaction PROC
push 018813A51h
call WhisperMain
NtCommitTransaction ENDP
NtCompactKeys PROC
push 057BA6A14h
call WhisperMain
NtCompactKeys ENDP
NtCompareObjects PROC
push 084648AF6h
call WhisperMain
NtCompareObjects ENDP
NtCompareSigningLevels PROC
push 0AEF09E73h
call WhisperMain
NtCompareSigningLevels ENDP
NtCompareTokens PROC
push 0F494EC01h
call WhisperMain
NtCompareTokens ENDP
NtCompleteConnectPort PROC
push 03A7637F8h
call WhisperMain
NtCompleteConnectPort ENDP
NtCompressKey PROC
push 0782E5F8Eh
call WhisperMain
NtCompressKey ENDP
NtConnectPort PROC
push 0A23C9072h
call WhisperMain
NtConnectPort ENDP
NtConvertBetweenAuxiliaryCounterAndPerformanceCounter PROC
push 079468945h
call WhisperMain
NtConvertBetweenAuxiliaryCounterAndPerformanceCounter ENDP
NtCreateDebugObject PROC
push 0009E21C3h
call WhisperMain
NtCreateDebugObject ENDP
NtCreateDirectoryObject PROC
push 0FAD436BBh
call WhisperMain
NtCreateDirectoryObject ENDP
NtCreateDirectoryObjectEx PROC
push 0426E10B4h
call WhisperMain
NtCreateDirectoryObjectEx ENDP
NtCreateEnclave PROC
push 0CA2FDE86h
call WhisperMain
NtCreateEnclave ENDP
NtCreateEnlistment PROC
push 00F90ECC7h
call WhisperMain
NtCreateEnlistment ENDP
NtCreateEventPair PROC
push 012B1CCFCh
call WhisperMain
NtCreateEventPair ENDP
NtCreateIRTimer PROC
push 0178C3F36h
call WhisperMain
NtCreateIRTimer ENDP
NtCreateIoCompletion PROC
push 00E1750D7h
call WhisperMain
NtCreateIoCompletion ENDP
NtCreateJobObject PROC
push 0F65B6E57h
call WhisperMain
NtCreateJobObject ENDP
NtCreateJobSet PROC
push 08740AF1Ch
call WhisperMain
NtCreateJobSet ENDP
NtCreateKeyTransacted PROC
push 0A69A66C6h
call WhisperMain
NtCreateKeyTransacted ENDP
NtCreateKeyedEvent PROC
push 068CF755Eh
call WhisperMain
NtCreateKeyedEvent ENDP
NtCreateLowBoxToken PROC
push 017C73D1Ch
call WhisperMain
NtCreateLowBoxToken ENDP
NtCreateMailslotFile PROC
push 0E47DC2FEh
call WhisperMain
NtCreateMailslotFile ENDP
NtCreateMutant PROC
push 0FDDC08A5h
call WhisperMain
NtCreateMutant ENDP
NtCreateNamedPipeFile PROC
push 0ED7AA75Bh
call WhisperMain
NtCreateNamedPipeFile ENDP
NtCreatePagingFile PROC
push 054C36C00h
call WhisperMain
NtCreatePagingFile ENDP
NtCreatePartition PROC
push 0444E255Dh
call WhisperMain
NtCreatePartition ENDP
NtCreatePort PROC
push 02EB4CCDAh
call WhisperMain
NtCreatePort ENDP
NtCreatePrivateNamespace PROC
push 009B1CFEBh
call WhisperMain
NtCreatePrivateNamespace ENDP
NtCreateProcess PROC
push 081288EB0h
call WhisperMain
NtCreateProcess ENDP
NtCreateProfile PROC
push 06E3E6AA4h
call WhisperMain
NtCreateProfile ENDP
NtCreateProfileEx PROC
push 0029AC0C1h
call WhisperMain
NtCreateProfileEx ENDP
NtCreateRegistryTransaction PROC
push 0970FD3DEh
call WhisperMain
NtCreateRegistryTransaction ENDP
NtCreateResourceManager PROC
push 06E52FA4Fh
call WhisperMain
NtCreateResourceManager ENDP
NtCreateSemaphore PROC
push 0FCB62D1Ah
call WhisperMain
NtCreateSemaphore ENDP
NtCreateSymbolicLinkObject PROC
push 083189384h
call WhisperMain
NtCreateSymbolicLinkObject ENDP
NtCreateThreadEx PROC
push 096A7CC64h
call WhisperMain
NtCreateThreadEx ENDP
NtCreateTimer PROC
push 0E58D8F55h
call WhisperMain
NtCreateTimer ENDP
NtCreateTimer2 PROC
push 0B0684CA6h
call WhisperMain
NtCreateTimer2 ENDP
NtCreateToken PROC
push 0099F9FBFh
call WhisperMain
NtCreateToken ENDP
NtCreateTokenEx PROC
push 06022A67Ch
call WhisperMain
NtCreateTokenEx ENDP
NtCreateTransaction PROC
push 03CEE2243h
call WhisperMain
NtCreateTransaction ENDP
NtCreateTransactionManager PROC
push 01BA730FAh
call WhisperMain
NtCreateTransactionManager ENDP
NtCreateUserProcess PROC
push 0EC26CFBBh
call WhisperMain
NtCreateUserProcess ENDP
NtCreateWaitCompletionPacket PROC
push 001813F0Ah
call WhisperMain
NtCreateWaitCompletionPacket ENDP
NtCreateWaitablePort PROC
push 0A97288DFh
call WhisperMain
NtCreateWaitablePort ENDP
NtCreateWnfStateName PROC
push 0CED0FB42h
call WhisperMain
NtCreateWnfStateName ENDP
NtCreateWorkerFactory PROC
push 0089C140Ah
call WhisperMain
NtCreateWorkerFactory ENDP
NtDebugActiveProcess PROC
push 0923099ADh
call WhisperMain
NtDebugActiveProcess ENDP
NtDebugContinue PROC
push 05D24BC68h
call WhisperMain
NtDebugContinue ENDP
NtDeleteAtom PROC
push 0BED35C8Bh
call WhisperMain
NtDeleteAtom ENDP
NtDeleteBootEntry PROC
push 0336B3BE4h
call WhisperMain
NtDeleteBootEntry ENDP
NtDeleteDriverEntry PROC
push 033930B14h
call WhisperMain
NtDeleteDriverEntry ENDP
NtDeleteFile PROC
push 06EF46592h
call WhisperMain
NtDeleteFile ENDP
NtDeleteKey PROC
push 03AEE1D71h
call WhisperMain
NtDeleteKey ENDP
NtDeleteObjectAuditAlarm PROC
push 016B57464h
call WhisperMain
NtDeleteObjectAuditAlarm ENDP
NtDeletePrivateNamespace PROC
push 02A88393Fh
call WhisperMain
NtDeletePrivateNamespace ENDP
NtDeleteValueKey PROC
push 036820931h
call WhisperMain
NtDeleteValueKey ENDP
NtDeleteWnfStateData PROC
push 032CE441Ah
call WhisperMain
NtDeleteWnfStateData ENDP
NtDeleteWnfStateName PROC
push 0A8B02387h
call WhisperMain
NtDeleteWnfStateName ENDP
NtDisableLastKnownGood PROC
push 0386B35C2h
call WhisperMain
NtDisableLastKnownGood ENDP
NtDisplayString PROC
push 076E83238h
call WhisperMain
NtDisplayString ENDP
NtDrawText PROC
push 04918735Eh
call WhisperMain
NtDrawText ENDP
NtEnableLastKnownGood PROC
push 02DBE03F4h
call WhisperMain
NtEnableLastKnownGood ENDP
NtEnumerateBootEntries PROC
push 02C97BD9Bh
call WhisperMain
NtEnumerateBootEntries ENDP
NtEnumerateDriverEntries PROC
push 07CDC2D7Fh
call WhisperMain
NtEnumerateDriverEntries ENDP
NtEnumerateSystemEnvironmentValuesEx PROC
push 053AF8FFBh
call WhisperMain
NtEnumerateSystemEnvironmentValuesEx ENDP
NtEnumerateTransactionObject PROC
push 096B4A608h
call WhisperMain
NtEnumerateTransactionObject ENDP
NtExtendSection PROC
push 00E8A340Fh
call WhisperMain
NtExtendSection ENDP
NtFilterBootOption PROC
push 008A20BCFh
call WhisperMain
NtFilterBootOption ENDP
NtFilterToken PROC
push 07FD56972h
call WhisperMain
NtFilterToken ENDP
NtFilterTokenEx PROC
push 08E59B5DBh
call WhisperMain
NtFilterTokenEx ENDP
NtFlushBuffersFileEx PROC
push 026D4E08Ah
call WhisperMain
NtFlushBuffersFileEx ENDP
NtFlushInstallUILanguage PROC
push 0A5BAD1A1h
call WhisperMain
NtFlushInstallUILanguage ENDP
NtFlushInstructionCache PROC
push 00DAE4997h
call WhisperMain
NtFlushInstructionCache ENDP
NtFlushKey PROC
push 09ED4BF6Eh
call WhisperMain
NtFlushKey ENDP
NtFlushProcessWriteBuffers PROC
push 0D83A3DA2h
call WhisperMain
NtFlushProcessWriteBuffers ENDP
NtFlushVirtualMemory PROC
push 08713938Fh
call WhisperMain
NtFlushVirtualMemory ENDP
NtFlushWriteBuffer PROC
push 0A538B5A7h
call WhisperMain
NtFlushWriteBuffer ENDP
NtFreeUserPhysicalPages PROC
push 0E5BEEE26h
call WhisperMain
NtFreeUserPhysicalPages ENDP
NtFreezeRegistry PROC
push 0069B203Bh
call WhisperMain
NtFreezeRegistry ENDP
NtFreezeTransactions PROC
push 04FAA257Dh
call WhisperMain
NtFreezeTransactions ENDP
NtGetCachedSigningLevel PROC
push 076BCA01Eh
call WhisperMain
NtGetCachedSigningLevel ENDP
NtGetCompleteWnfStateSubscription PROC
push 0148F1A13h
call WhisperMain
NtGetCompleteWnfStateSubscription ENDP
NtGetContextThread PROC
push 00C9C1E2Dh
call WhisperMain
NtGetContextThread ENDP
NtGetCurrentProcessorNumber PROC
push 08E33C8E6h
call WhisperMain
NtGetCurrentProcessorNumber ENDP
NtGetCurrentProcessorNumberEx PROC
push 05AD599AEh
call WhisperMain
NtGetCurrentProcessorNumberEx ENDP
NtGetDevicePowerState PROC
push 0A43BB4B4h
call WhisperMain
NtGetDevicePowerState ENDP
NtGetMUIRegistryInfo PROC
push 07ACEA663h
call WhisperMain
NtGetMUIRegistryInfo ENDP
NtGetNextProcess PROC
push 00DA3362Ch
call WhisperMain
NtGetNextProcess ENDP
NtGetNextThread PROC
push 09A3DD48Fh
call WhisperMain
NtGetNextThread ENDP
NtGetNlsSectionPtr PROC
push 0FF5DD282h
call WhisperMain
NtGetNlsSectionPtr ENDP
NtGetNotificationResourceManager PROC
push 0EFB2719Eh
call WhisperMain
NtGetNotificationResourceManager ENDP
NtGetWriteWatch PROC
push 08AA31383h
call WhisperMain
NtGetWriteWatch ENDP
NtImpersonateAnonymousToken PROC
push 03F8F0F22h
call WhisperMain
NtImpersonateAnonymousToken ENDP
NtImpersonateThread PROC
push 0FA202799h
call WhisperMain
NtImpersonateThread ENDP
NtInitializeEnclave PROC
push 02C9310D2h
call WhisperMain
NtInitializeEnclave ENDP
NtInitializeNlsFiles PROC
push 0744F05ACh
call WhisperMain
NtInitializeNlsFiles ENDP
NtInitializeRegistry PROC
push 034901C3Fh
call WhisperMain
NtInitializeRegistry ENDP
NtInitiatePowerAction PROC
push 0C690DF3Bh
call WhisperMain
NtInitiatePowerAction ENDP
NtIsSystemResumeAutomatic PROC
push 0A4A02186h
call WhisperMain
NtIsSystemResumeAutomatic ENDP
NtIsUILanguageComitted PROC
push 0D5EB91C3h
call WhisperMain
NtIsUILanguageComitted ENDP
NtListenPort PROC
push 0DCB0DF3Fh
call WhisperMain
NtListenPort ENDP
NtLoadDriver PROC
push 01C9F4E5Ch
call WhisperMain
NtLoadDriver ENDP
NtLoadEnclaveData PROC
push 0074E907Ah
call WhisperMain
NtLoadEnclaveData ENDP
NtLoadHotPatch PROC
push 09F721D4Fh
call WhisperMain
NtLoadHotPatch ENDP
NtLoadKey PROC
push 03F1844E5h
call WhisperMain
NtLoadKey ENDP
NtLoadKey2 PROC
push 0DA270AA1h
call WhisperMain
NtLoadKey2 ENDP
NtLoadKeyEx PROC
push 0BBFD8746h
call WhisperMain
NtLoadKeyEx ENDP
NtLockFile PROC
push 0E17FCDAFh
call WhisperMain
NtLockFile ENDP
NtLockProductActivationKeys PROC
push 067E66A7Ch
call WhisperMain
NtLockProductActivationKeys ENDP
NtLockRegistryKey PROC
push 0130628B6h
call WhisperMain
NtLockRegistryKey ENDP
NtLockVirtualMemory PROC
push 00B981D77h
call WhisperMain
NtLockVirtualMemory ENDP
NtMakePermanentObject PROC
push 0243B2EA5h
call WhisperMain
NtMakePermanentObject ENDP
NtMakeTemporaryObject PROC
push 0263B5ED7h
call WhisperMain
NtMakeTemporaryObject ENDP
NtManagePartition PROC
push 008B1E6EDh
call WhisperMain
NtManagePartition ENDP
NtMapCMFModule PROC
push 03917A320h
call WhisperMain
NtMapCMFModule ENDP
NtMapUserPhysicalPages PROC
push 01142E82Ch
call WhisperMain
NtMapUserPhysicalPages ENDP
NtMapViewOfSectionEx PROC
push 0BE9CE842h
call WhisperMain
NtMapViewOfSectionEx ENDP
NtModifyBootEntry PROC
push 009941D38h
call WhisperMain
NtModifyBootEntry ENDP
NtModifyDriverEntry PROC
push 071E16D64h
call WhisperMain
NtModifyDriverEntry ENDP
NtNotifyChangeDirectoryFile PROC
push 01999E00Dh
call WhisperMain
NtNotifyChangeDirectoryFile ENDP
NtNotifyChangeDirectoryFileEx PROC
push 06B97BFCBh
call WhisperMain
NtNotifyChangeDirectoryFileEx ENDP
NtNotifyChangeKey PROC
push 0CB12AAE8h
call WhisperMain
NtNotifyChangeKey ENDP
NtNotifyChangeMultipleKeys PROC
push 07F837404h
call WhisperMain
NtNotifyChangeMultipleKeys ENDP
NtNotifyChangeSession PROC
push 0E78FE71Dh
call WhisperMain
NtNotifyChangeSession ENDP
NtOpenEnlistment PROC
push 0BABADD51h
call WhisperMain
NtOpenEnlistment ENDP
NtOpenEventPair PROC
push 090B047E6h
call WhisperMain
NtOpenEventPair ENDP
NtOpenIoCompletion PROC
push 00C656AADh
call WhisperMain
NtOpenIoCompletion ENDP
NtOpenJobObject PROC
push 0429C0E63h
call WhisperMain
NtOpenJobObject ENDP
NtOpenKeyEx PROC
push 06BDD9BA6h
call WhisperMain
NtOpenKeyEx ENDP
NtOpenKeyTransacted PROC
push 010CD1A62h
call WhisperMain
NtOpenKeyTransacted ENDP
NtOpenKeyTransactedEx PROC
push 086AEC878h
call WhisperMain
NtOpenKeyTransactedEx ENDP
NtOpenKeyedEvent PROC
push 050CB5D4Ah
call WhisperMain
NtOpenKeyedEvent ENDP
NtOpenMutant PROC
push 01693FCC5h
call WhisperMain
NtOpenMutant ENDP
NtOpenObjectAuditAlarm PROC
push 074B25FF4h
call WhisperMain
NtOpenObjectAuditAlarm ENDP
NtOpenPartition PROC
push 00ABA2FF1h
call WhisperMain
NtOpenPartition ENDP
NtOpenPrivateNamespace PROC
push 0B09231BFh
call WhisperMain
NtOpenPrivateNamespace ENDP
NtOpenProcessToken PROC
push 0079A848Bh
call WhisperMain
NtOpenProcessToken ENDP
NtOpenRegistryTransaction PROC
push 09A319AAFh
call WhisperMain
NtOpenRegistryTransaction ENDP
NtOpenResourceManager PROC
push 0B66CDF77h
call WhisperMain
NtOpenResourceManager ENDP
NtOpenSemaphore PROC
push 0F6A700EFh
call WhisperMain
NtOpenSemaphore ENDP
NtOpenSession PROC
push 00D814956h
call WhisperMain
NtOpenSession ENDP
NtOpenSymbolicLinkObject PROC
push 01904FB1Ah
call WhisperMain
NtOpenSymbolicLinkObject ENDP
NtOpenThread PROC
push 01A394106h
call WhisperMain
NtOpenThread ENDP
NtOpenTimer PROC
push 0EFDDD16Ch
call WhisperMain
NtOpenTimer ENDP
NtOpenTransaction PROC
push 005512406h
call WhisperMain
NtOpenTransaction ENDP
NtOpenTransactionManager PROC
push 075CB4D46h
call WhisperMain
NtOpenTransactionManager ENDP
NtPlugPlayControl PROC
push 03DAA0509h
call WhisperMain
NtPlugPlayControl ENDP
NtPrePrepareComplete PROC
push 02CB80836h
call WhisperMain
NtPrePrepareComplete ENDP
NtPrePrepareEnlistment PROC
push 0CBA5EC3Eh
call WhisperMain
NtPrePrepareEnlistment ENDP
NtPrepareComplete PROC
push 036B3A4BCh
call WhisperMain
NtPrepareComplete ENDP
NtPrepareEnlistment PROC
push 009A70C2Dh
call WhisperMain
NtPrepareEnlistment ENDP
NtPrivilegeCheck PROC
push 0369A4D17h
call WhisperMain
NtPrivilegeCheck ENDP
NtPrivilegeObjectAuditAlarm PROC
push 0E121E24Fh
call WhisperMain
NtPrivilegeObjectAuditAlarm ENDP
NtPrivilegedServiceAuditAlarm PROC
push 018BE3C28h
call WhisperMain
NtPrivilegedServiceAuditAlarm ENDP
NtPropagationComplete PROC
push 0EC50B8DEh
call WhisperMain
NtPropagationComplete ENDP
NtPropagationFailed PROC
push 03B967B3Dh
call WhisperMain
NtPropagationFailed ENDP
NtPulseEvent PROC
push 0B83B91A6h
call WhisperMain
NtPulseEvent ENDP
NtQueryAuxiliaryCounterFrequency PROC
push 02A98F7CCh
call WhisperMain
NtQueryAuxiliaryCounterFrequency ENDP
NtQueryBootEntryOrder PROC
push 01F8FFB1Dh
call WhisperMain
NtQueryBootEntryOrder ENDP
NtQueryBootOptions PROC
push 03FA93D3Dh
call WhisperMain
NtQueryBootOptions ENDP
NtQueryDebugFilterState PROC
push 032B3381Ch
call WhisperMain
NtQueryDebugFilterState ENDP
NtQueryDirectoryFileEx PROC
push 06A583A81h
call WhisperMain
NtQueryDirectoryFileEx ENDP
NtQueryDirectoryObject PROC
push 01E2038BDh
call WhisperMain
NtQueryDirectoryObject ENDP
NtQueryDriverEntryOrder PROC
push 0030611A3h
call WhisperMain
NtQueryDriverEntryOrder ENDP
NtQueryEaFile PROC
push 068B37000h
call WhisperMain
NtQueryEaFile ENDP
NtQueryFullAttributesFile PROC
push 05AC5645Eh
call WhisperMain
NtQueryFullAttributesFile ENDP
NtQueryInformationAtom PROC
push 09602B592h
call WhisperMain
NtQueryInformationAtom ENDP
NtQueryInformationByName PROC
push 0E70F1F6Ch
call WhisperMain
NtQueryInformationByName ENDP
NtQueryInformationEnlistment PROC
push 0264639ECh
call WhisperMain
NtQueryInformationEnlistment ENDP
NtQueryInformationJobObject PROC
push 0C4592CC5h
call WhisperMain
NtQueryInformationJobObject ENDP
NtQueryInformationPort PROC
push 0920FB59Ch
call WhisperMain
NtQueryInformationPort ENDP
NtQueryInformationResourceManager PROC
push 00FB2919Eh
call WhisperMain
NtQueryInformationResourceManager ENDP
NtQueryInformationTransaction PROC
push 00C982C0Bh
call WhisperMain
NtQueryInformationTransaction ENDP
NtQueryInformationTransactionManager PROC
push 0C7A72CDFh
call WhisperMain
NtQueryInformationTransactionManager ENDP
NtQueryInformationWorkerFactory PROC
push 002921C16h
call WhisperMain
NtQueryInformationWorkerFactory ENDP
NtQueryInstallUILanguage PROC
push 017B127EAh
call WhisperMain
NtQueryInstallUILanguage ENDP
NtQueryIntervalProfile PROC
push 0AC3DA4AEh
call WhisperMain
NtQueryIntervalProfile ENDP
NtQueryIoCompletion PROC
push 0D44FD6DBh
call WhisperMain
NtQueryIoCompletion ENDP
NtQueryLicenseValue PROC
push 02C911B3Ah
call WhisperMain
NtQueryLicenseValue ENDP
NtQueryMultipleValueKey PROC
push 0AD19D0EAh
call WhisperMain
NtQueryMultipleValueKey ENDP
NtQueryMutant PROC
push 096B0913Bh
call WhisperMain
NtQueryMutant ENDP
NtQueryOpenSubKeys PROC
push 04BB626A8h
call WhisperMain
NtQueryOpenSubKeys ENDP
NtQueryOpenSubKeysEx PROC
push 0E319B7C5h
call WhisperMain
NtQueryOpenSubKeysEx ENDP
NtQueryPortInformationProcess PROC
push 05F927806h
call WhisperMain
NtQueryPortInformationProcess ENDP
NtQueryQuotaInformationFile PROC
push 077C5FEE7h
call WhisperMain
NtQueryQuotaInformationFile ENDP
NtQuerySecurityAttributesToken PROC
push 07BDE4D76h
call WhisperMain
NtQuerySecurityAttributesToken ENDP
NtQuerySecurityObject PROC
push 090BFA0F3h
call WhisperMain
NtQuerySecurityObject ENDP
NtQuerySecurityPolicy PROC
push 0924491DFh
call WhisperMain
NtQuerySecurityPolicy ENDP
NtQuerySemaphore PROC
push 0FD6197B7h
call WhisperMain
NtQuerySemaphore ENDP
NtQuerySymbolicLinkObject PROC
push 095B8ABF2h
call WhisperMain
NtQuerySymbolicLinkObject ENDP
NtQuerySystemEnvironmentValue PROC
push 0EEBB8F76h
call WhisperMain
NtQuerySystemEnvironmentValue ENDP
NtQuerySystemEnvironmentValueEx PROC
push 0F7CCB537h
call WhisperMain
NtQuerySystemEnvironmentValueEx ENDP
NtQuerySystemInformationEx PROC
push 0AC916FCBh
call WhisperMain
NtQuerySystemInformationEx ENDP
NtQueryTimerResolution PROC
push 00E952C59h
call WhisperMain
NtQueryTimerResolution ENDP
NtQueryWnfStateData PROC
push 0BE05928Ah
call WhisperMain
NtQueryWnfStateData ENDP
NtQueryWnfStateNameInformation PROC
push 084D362C7h
call WhisperMain
NtQueryWnfStateNameInformation ENDP
NtQueueApcThreadEx PROC
push 0A0A0EE66h
call WhisperMain
NtQueueApcThreadEx ENDP
NtRaiseException PROC
push 006D2298Fh
call WhisperMain
NtRaiseException ENDP
NtRaiseHardError PROC
push 003911D39h
call WhisperMain
NtRaiseHardError ENDP
NtReadOnlyEnlistment PROC
push 049C28E91h
call WhisperMain
NtReadOnlyEnlistment ENDP
NtRecoverEnlistment PROC
push 09B359EA3h
call WhisperMain
NtRecoverEnlistment ENDP
NtRecoverResourceManager PROC
push 06E35F61Fh
call WhisperMain
NtRecoverResourceManager ENDP
NtRecoverTransactionManager PROC
push 0042EDC04h
call WhisperMain
NtRecoverTransactionManager ENDP
NtRegisterProtocolAddressInformation PROC
push 0163F1CABh
call WhisperMain
NtRegisterProtocolAddressInformation ENDP
NtRegisterThreadTerminatePort PROC
push 0A23783AAh
call WhisperMain
NtRegisterThreadTerminatePort ENDP
NtReleaseKeyedEvent PROC
push 070C34B44h
call WhisperMain
NtReleaseKeyedEvent ENDP
NtReleaseWorkerFactoryWorker PROC
push 0A4902D8Ah
call WhisperMain
NtReleaseWorkerFactoryWorker ENDP
NtRemoveIoCompletionEx PROC
push 09CAECE74h
call WhisperMain
NtRemoveIoCompletionEx ENDP
NtRemoveProcessDebug PROC
push 022BCCF36h
call WhisperMain
NtRemoveProcessDebug ENDP
NtRenameKey PROC
push 0299D0C3Eh
call WhisperMain
NtRenameKey ENDP
NtRenameTransactionManager PROC
push 08E319293h
call WhisperMain
NtRenameTransactionManager ENDP
NtReplaceKey PROC
push 0491C78A6h
call WhisperMain
NtReplaceKey ENDP
NtReplacePartitionUnit PROC
push 060B16C32h
call WhisperMain
NtReplacePartitionUnit ENDP
NtReplyWaitReplyPort PROC
push 020B10F6Ah
call WhisperMain
NtReplyWaitReplyPort ENDP
NtRequestPort PROC
push 05AB65B38h
call WhisperMain
NtRequestPort ENDP
NtResetEvent PROC
push 0EB51ECC2h
call WhisperMain
NtResetEvent ENDP
NtResetWriteWatch PROC
push 098D39446h
call WhisperMain
NtResetWriteWatch ENDP
NtRestoreKey PROC
push 01BC3F6A9h
call WhisperMain
NtRestoreKey ENDP
NtResumeProcess PROC
push 0419F7230h
call WhisperMain
NtResumeProcess ENDP
NtRevertContainerImpersonation PROC
push 034A21431h
call WhisperMain
NtRevertContainerImpersonation ENDP
NtRollbackComplete PROC
push 068B8741Ah
call WhisperMain
NtRollbackComplete ENDP
NtRollbackEnlistment PROC
push 09136B2A1h
call WhisperMain
NtRollbackEnlistment ENDP
NtRollbackRegistryTransaction PROC
push 070BB5E67h
call WhisperMain
NtRollbackRegistryTransaction ENDP
NtRollbackTransaction PROC
push 01CF8004Bh
call WhisperMain
NtRollbackTransaction ENDP
NtRollforwardTransactionManager PROC
push 011C3410Eh
call WhisperMain
NtRollforwardTransactionManager ENDP
NtSaveKey PROC
push 080016B6Ah
call WhisperMain
NtSaveKey ENDP
NtSaveKeyEx PROC
push 0EB6BDED6h
call WhisperMain
NtSaveKeyEx ENDP
NtSaveMergedKeys PROC
push 0D3B4D6C4h
call WhisperMain
NtSaveMergedKeys ENDP
NtSecureConnectPort PROC
push 072ED4142h
call WhisperMain
NtSecureConnectPort ENDP
NtSerializeBoot PROC
push 0B0207C61h
call WhisperMain
NtSerializeBoot ENDP
NtSetBootEntryOrder PROC
push 0CDEFFD41h
call WhisperMain
NtSetBootEntryOrder ENDP
NtSetBootOptions PROC
push 09F099D9Dh
call WhisperMain
NtSetBootOptions ENDP
NtSetCachedSigningLevel PROC
push 0CF7DE7A1h
call WhisperMain
NtSetCachedSigningLevel ENDP
NtSetCachedSigningLevel2 PROC
push 06EB2EC62h
call WhisperMain
NtSetCachedSigningLevel2 ENDP
NtSetContextThread PROC
push 04CFC0A5Dh
call WhisperMain
NtSetContextThread ENDP
NtSetDebugFilterState PROC
push 0348E382Ch
call WhisperMain
NtSetDebugFilterState ENDP
NtSetDefaultHardErrorPort PROC
push 0B8AAB528h
call WhisperMain
NtSetDefaultHardErrorPort ENDP
NtSetDefaultLocale PROC
push 085A95D9Dh
call WhisperMain
NtSetDefaultLocale ENDP
NtSetDefaultUILanguage PROC
push 0AD325030h
call WhisperMain
NtSetDefaultUILanguage ENDP
NtSetDriverEntryOrder PROC
push 00F9C1D01h
call WhisperMain
NtSetDriverEntryOrder ENDP
NtSetEaFile PROC
push 0533D3DE8h
call WhisperMain
NtSetEaFile ENDP
NtSetHighEventPair PROC
push 0A6AF463Dh
call WhisperMain
NtSetHighEventPair ENDP
NtSetHighWaitLowEventPair PROC
push 0A6B5AA27h
call WhisperMain
NtSetHighWaitLowEventPair ENDP
NtSetIRTimer PROC
push 0CD9D38FDh
call WhisperMain
NtSetIRTimer ENDP
NtSetInformationDebugObject PROC
push 018382487h
call WhisperMain
NtSetInformationDebugObject ENDP
NtSetInformationEnlistment PROC
push 00B6410F3h
call WhisperMain
NtSetInformationEnlistment ENDP
NtSetInformationJobObject PROC
push 01A25FA79h
call WhisperMain
NtSetInformationJobObject ENDP
NtSetInformationKey PROC
push 0F2C103B9h
call WhisperMain
NtSetInformationKey ENDP
NtSetInformationResourceManager PROC
push 031965B0Ah
call WhisperMain
NtSetInformationResourceManager ENDP
NtSetInformationSymbolicLink PROC
push 0FAA72212h
call WhisperMain
NtSetInformationSymbolicLink ENDP
NtSetInformationToken PROC
push 00386750Eh
call WhisperMain
NtSetInformationToken ENDP
NtSetInformationTransaction PROC
push 028823A2Fh
call WhisperMain
NtSetInformationTransaction ENDP
NtSetInformationTransactionManager PROC
push 0AB96218Bh
call WhisperMain
NtSetInformationTransactionManager ENDP
NtSetInformationVirtualMemory PROC
push 01B911D1Fh
call WhisperMain
NtSetInformationVirtualMemory ENDP
NtSetInformationWorkerFactory PROC
push 08A2290B6h
call WhisperMain
NtSetInformationWorkerFactory ENDP
NtSetIntervalProfile PROC
push 02581DD85h
call WhisperMain
NtSetIntervalProfile ENDP
NtSetIoCompletion PROC
push 002980237h
call WhisperMain
NtSetIoCompletion ENDP
NtSetIoCompletionEx PROC
push 08CAEC268h
call WhisperMain
NtSetIoCompletionEx ENDP
NtSetLdtEntries PROC
push 0FB53ECFBh
call WhisperMain
NtSetLdtEntries ENDP
NtSetLowEventPair PROC
push 016B1CAE3h
call WhisperMain
NtSetLowEventPair ENDP
NtSetLowWaitHighEventPair PROC
push 0F2D21640h
call WhisperMain
NtSetLowWaitHighEventPair ENDP
NtSetQuotaInformationFile PROC
push 09706A793h
call WhisperMain
NtSetQuotaInformationFile ENDP
NtSetSecurityObject PROC
push 016B85055h
call WhisperMain
NtSetSecurityObject ENDP
NtSetSystemEnvironmentValue PROC
push 0C457E39Ch
call WhisperMain
NtSetSystemEnvironmentValue ENDP
NtSetSystemEnvironmentValueEx PROC
push 037CBF2B6h
call WhisperMain
NtSetSystemEnvironmentValueEx ENDP
NtSetSystemInformation PROC
push 0036F07FDh
call WhisperMain
NtSetSystemInformation ENDP
NtSetSystemPowerState PROC
push 06C8F86C2h
call WhisperMain
NtSetSystemPowerState ENDP
NtSetSystemTime PROC
push 08725CE82h
call WhisperMain
NtSetSystemTime ENDP
NtSetThreadExecutionState PROC
push 0923D7C34h
call WhisperMain
NtSetThreadExecutionState ENDP
NtSetTimer2 PROC
push 079929A43h
call WhisperMain
NtSetTimer2 ENDP
NtSetTimerEx PROC
push 072E8ACBEh
call WhisperMain
NtSetTimerEx ENDP
NtSetTimerResolution PROC
push 041146399h
call WhisperMain
NtSetTimerResolution ENDP
NtSetUuidSeed PROC
push 0D14ED7D4h
call WhisperMain
NtSetUuidSeed ENDP
NtSetVolumeInformationFile PROC
push 024B1D2A2h
call WhisperMain
NtSetVolumeInformationFile ENDP
NtSetWnfProcessNotificationEvent PROC
push 0999D8030h
call WhisperMain
NtSetWnfProcessNotificationEvent ENDP
NtShutdownSystem PROC
push 0D36EC9C1h
call WhisperMain
NtShutdownSystem ENDP
NtShutdownWorkerFactory PROC
push 0151D1594h
call WhisperMain
NtShutdownWorkerFactory ENDP
NtSignalAndWaitForSingleObject PROC
push 00AB43429h
call WhisperMain
NtSignalAndWaitForSingleObject ENDP
NtSinglePhaseReject PROC
push 0745E2285h
call WhisperMain
NtSinglePhaseReject ENDP
NtStartProfile PROC
push 058942A5Ch
call WhisperMain
NtStartProfile ENDP
NtStopProfile PROC
push 08F1B7843h
call WhisperMain
NtStopProfile ENDP
NtSubscribeWnfStateChange PROC
push 036A72F3Ah
call WhisperMain
NtSubscribeWnfStateChange ENDP
NtSuspendProcess PROC
push 082C1834Fh
call WhisperMain
NtSuspendProcess ENDP
NtSuspendThread PROC
push 07CDF2E69h
call WhisperMain
NtSuspendThread ENDP
NtSystemDebugControl PROC
push 0D78BF51Dh
call WhisperMain
NtSystemDebugControl ENDP
NtTerminateEnclave PROC
push 04A8B16B2h
call WhisperMain
NtTerminateEnclave ENDP
NtTerminateJobObject PROC
push 0188433DBh
call WhisperMain
NtTerminateJobObject ENDP
NtTestAlert PROC
push 066379875h
call WhisperMain
NtTestAlert ENDP
NtThawRegistry PROC
push 032A03229h
call WhisperMain
NtThawRegistry ENDP
NtThawTransactions PROC
push 0F144D313h
call WhisperMain
NtThawTransactions ENDP
NtTraceControl PROC
push 00552E3C0h
call WhisperMain
NtTraceControl ENDP
NtTranslateFilePath PROC
push 0873F6C6Bh
call WhisperMain
NtTranslateFilePath ENDP
NtUmsThreadYield PROC
push 03FA60EF3h
call WhisperMain
NtUmsThreadYield ENDP
NtUnloadDriver PROC
push 016B73BE8h
call WhisperMain
NtUnloadDriver ENDP
NtUnloadKey PROC
push 01A2F63DDh
call WhisperMain
NtUnloadKey ENDP
NtUnloadKey2 PROC
push 0C7350282h
call WhisperMain
NtUnloadKey2 ENDP
NtUnloadKeyEx PROC
push 099F2AF4Fh
call WhisperMain
NtUnloadKeyEx ENDP
NtUnlockFile PROC
push 03298E3D2h
call WhisperMain
NtUnlockFile ENDP
NtUnlockVirtualMemory PROC
push 005966B01h
call WhisperMain
NtUnlockVirtualMemory ENDP
NtUnmapViewOfSectionEx PROC
push 09B1D5659h
call WhisperMain
NtUnmapViewOfSectionEx ENDP
NtUnsubscribeWnfStateChange PROC
push 082400D68h
call WhisperMain
NtUnsubscribeWnfStateChange ENDP
NtUpdateWnfStateData PROC
push 062B9740Eh
call WhisperMain
NtUpdateWnfStateData ENDP
NtVdmControl PROC
push 05DB24511h
call WhisperMain
NtVdmControl ENDP
NtWaitForAlertByThreadId PROC
push 09AAE3A6Ah
call WhisperMain
NtWaitForAlertByThreadId ENDP
NtWaitForDebugEvent PROC
push 03E9BC0E9h
call WhisperMain
NtWaitForDebugEvent ENDP
NtWaitForKeyedEvent PROC
push 0EB0AEA9Fh
call WhisperMain
NtWaitForKeyedEvent ENDP
NtWaitForWorkViaWorkerFactory PROC
push 0C091CA00h
call WhisperMain
NtWaitForWorkViaWorkerFactory ENDP
NtWaitHighEventPair PROC
push 0219FDE96h
call WhisperMain
NtWaitHighEventPair ENDP
NtWaitLowEventPair PROC
push 0203804A9h
call WhisperMain
NtWaitLowEventPair ENDP
NtAcquireCMFViewOwnership PROC
push 0DA4C1D1Ah
call WhisperMain
NtAcquireCMFViewOwnership ENDP
NtCancelDeviceWakeupRequest PROC
push 073816522h
call WhisperMain
NtCancelDeviceWakeupRequest ENDP
NtClearAllSavepointsTransaction PROC
push 01A0E44C7h
call WhisperMain
NtClearAllSavepointsTransaction ENDP
NtClearSavepointTransaction PROC
push 0DCB3D223h
call WhisperMain
NtClearSavepointTransaction ENDP
NtRollbackSavepointTransaction PROC
push 0144F351Ch
call WhisperMain
NtRollbackSavepointTransaction ENDP
NtSavepointTransaction PROC
push 04CD76C19h
call WhisperMain
NtSavepointTransaction ENDP
NtSavepointComplete PROC
push 0009AF898h
call WhisperMain
NtSavepointComplete ENDP
NtCreateSectionEx PROC
push 080953FB3h
call WhisperMain
NtCreateSectionEx ENDP
NtCreateCrossVmEvent PROC
push 01B2074B2h
call WhisperMain
NtCreateCrossVmEvent ENDP
NtGetPlugPlayEvent PROC
push 00E088D1Eh
call WhisperMain
NtGetPlugPlayEvent ENDP
NtListTransactions PROC
push 0B8299EB8h
call WhisperMain
NtListTransactions ENDP
NtMarshallTransaction PROC
push 032A62A0Dh
call WhisperMain
NtMarshallTransaction ENDP
NtPullTransaction PROC
push 0040B2499h
call WhisperMain
NtPullTransaction ENDP
NtReleaseCMFViewOwnership PROC
push 034AD2036h
call WhisperMain
NtReleaseCMFViewOwnership ENDP
NtWaitForWnfNotifications PROC
push 05B896703h
call WhisperMain
NtWaitForWnfNotifications ENDP
NtStartTm PROC
push 0D19DFE2Dh
call WhisperMain
NtStartTm ENDP
NtSetInformationProcess PROC
push 096288E47h
call WhisperMain
NtSetInformationProcess ENDP
NtRequestDeviceWakeup PROC
push 02EA1223Ch
call WhisperMain
NtRequestDeviceWakeup ENDP
NtRequestWakeupLatency PROC
push 0904BB1E6h
call WhisperMain
NtRequestWakeupLatency ENDP
NtQuerySystemTime PROC
push 0B6AEC6BBh
call WhisperMain
NtQuerySystemTime ENDP
NtManageHotPatch PROC
push 068A5287Eh
call WhisperMain
NtManageHotPatch ENDP
NtContinueEx PROC
push 0D34D0411h
call WhisperMain
NtContinueEx ENDP
RtlCreateUserThread PROC
push 0B4AF2B95h
call WhisperMain
RtlCreateUserThread ENDP
end | 18.783961 | 80 | 0.816699 | [
"Apache-2.0"
] | FDlucifer/SysWhispers2 | example-output/SyscallsStubs.x86.asm | 45,908 | Assembly |
extern m7_ippsGFpECESGetBuffersSize_SM2:function
extern n8_ippsGFpECESGetBuffersSize_SM2:function
extern y8_ippsGFpECESGetBuffersSize_SM2:function
extern e9_ippsGFpECESGetBuffersSize_SM2:function
extern l9_ippsGFpECESGetBuffersSize_SM2:function
extern n0_ippsGFpECESGetBuffersSize_SM2:function
extern k0_ippsGFpECESGetBuffersSize_SM2:function
extern ippcpJumpIndexForMergedLibs
extern ippcpSafeInit:function
segment .data
align 8
dq .Lin_ippsGFpECESGetBuffersSize_SM2
.Larraddr_ippsGFpECESGetBuffersSize_SM2:
dq m7_ippsGFpECESGetBuffersSize_SM2
dq n8_ippsGFpECESGetBuffersSize_SM2
dq y8_ippsGFpECESGetBuffersSize_SM2
dq e9_ippsGFpECESGetBuffersSize_SM2
dq l9_ippsGFpECESGetBuffersSize_SM2
dq n0_ippsGFpECESGetBuffersSize_SM2
dq k0_ippsGFpECESGetBuffersSize_SM2
segment .text
global ippsGFpECESGetBuffersSize_SM2:function (ippsGFpECESGetBuffersSize_SM2.LEndippsGFpECESGetBuffersSize_SM2 - ippsGFpECESGetBuffersSize_SM2)
.Lin_ippsGFpECESGetBuffersSize_SM2:
db 0xf3, 0x0f, 0x1e, 0xfa
call ippcpSafeInit wrt ..plt
align 16
ippsGFpECESGetBuffersSize_SM2:
db 0xf3, 0x0f, 0x1e, 0xfa
mov rax, qword [rel ippcpJumpIndexForMergedLibs wrt ..gotpc]
movsxd rax, dword [rax]
lea r11, [rel .Larraddr_ippsGFpECESGetBuffersSize_SM2]
mov r11, qword [r11+rax*8]
jmp r11
.LEndippsGFpECESGetBuffersSize_SM2:
| 35.205128 | 143 | 0.839767 | [
"Apache-2.0"
] | zyktrcn/ippcp | _build/dispatcher/jmp_ippsGFpECESGetBuffersSize_SM2_33226034.asm | 1,373 | Assembly |
;;
;; Title: VGM replay.
;;
;; Song format:
;; The VGM data used by the following replay routine is a stripped down version
;; of the VGM v1.61 format.
;;
;; First the 512 bytes header is removed.
;; Only the following commands are kepts.
;;
;; $b9 rr dd - HuC6280 command. *rr* is the index of the PSG register,
;; *dd* the byte to be written.
;; $62 - End of frame (wait for next vsync).
;; $66 - End of data.
;;
;; As there are only 10 PSG registers ($0800-$0809), the HuC6280 command byte is
;; omitted, and the register index and data are directly output.
;;
;; So if we read a value less to 10, we know that this is a register index and
;; the next byte is the data to be written to this register.
;; Otherwise it is either a "end of frame" or "end of data" special command.
;; The format is then.
;;
;; rr dd - *rr* is the index of the PSG register. Its value is between 0 and 9.
;; *dd* is the data byte to be written to the register.
;; $f0 - End of frame.
;; $ff - End of data.
;;
;; Translated into pseudo-code, we will have :
;; > do
;; > {
;; > A = vgm_read_byte
;; > if (A < 10)
;; > { // PSG register index.
;; > data = vgm_read_byte
;; > psgport[A] = data
;; > }
;; > } while (A < 10);
;; >
;; > if (A == 0xf0)
;; > { // Nothing else to do for current frame.
;; > }
;; > else if (A == 0xff)
;; > { // The song is finished.
;; > }
;; >
;;
;; Tool:
;; A small command line utility to strip down a standard VGM file is available
;; in the *tools* directory (*tools/vgmrip.c*).
;; > vgmrip -b bb -o hhll input.vgm out
;; The command line arguments are,
;;
;; -b, --bank - Specify the first ROM bank of the VGM data.
;; -o, --org - Address of the VGM data.
;; input.vgm - VGM (at least 1.61) song.
;; out - Basename for output files.
;;
;; *vgmrip* generates an assembly file containing the include directive and the
;; start bank and base address of the VGM data, as long as the bank and address
;; for song looping. The song data is split into files which size is at most
;; 8192 bytes.
;;
;; Example:
;; Let's suppose that the song data was generated using the *vgmrip* tool with
;; *song* as the output basename. The output assembly file will contain the
;; following values,
;;
;; song_bank - The first ROM bank of the VGM data.
;; song_base_address - The base address of the VGM data.
;; song_loop_bank - ROM bank of the loop address.
;; song_loop - Loop address.
;;
;;
;; First the following ZP variables must be inialized,
;;
;; vgm_base - VGM data logical address.
;; vgm_bank - Current VGM data ROM bank.
;; vgm_ptr - Current VGM pointer.
;; vgm_end - Sentinal for the current VGM pointer.
;; It is the MSB of ((vgm_mpr+1)<<13).
;; vgm_loop_bank - ROM bank of the loop.
;; vgm_loop_ptr - Logical address of the song loop.
;;
;;
;; Once these variables has been setup, the song is played by calling the
;; *vgm_update* routine at each VSYNC.
;;
;; > lda #low(song_base_address)
;; > sta <vgm_base
;; > sta <vgm_ptr
;; >
;; > lda #high(song_base_address)
;; > sta <vgm_base+1
;; > sta <vgm_ptr+1
;; >
;; > lda #song_bank
;; > sta <vgm_bank
;; >
;; > lda <vgm_base+1
;; > clc
;; > adc #$20
;; > sta <vgm_end
;; >
;; > lda #song_loop_bank
;; > sta <vgm_loop_bank
;; > stw #song_loop, <vgm_loop_ptr
;; >
;; > ; [...]
;; >
;; > vsync_hook:
;; > jsr vgm_update
;; > ; [...]
;; > rts
;;
;;
;; ubyte: vgm_mpr
;; MPR used to map VGM data.
;;
vgm_mpr = 6
.zp
;;
;; uword: vgm_base
;; VGM data base pointer.
;;
vgm_base .ds 2
;;
;; ubyte: vgm_bank
;; First ROM bank of the VGM data.
;;
vgm_bank .ds 1
;;
;; uword: vgm_ptr
;; Current VGM data pointer.
;;
vgm_ptr .ds 2
;;
;; ubyte: vgm_end
;; VGM data upper bound.
;;
vgm_end .ds 1
;;
;; ubyte: vgm_loop_bank
;; Bank of the VGM loop address.
;;
vgm_loop_bank .ds 1
;;
;; ubyte: vgm_loop_ptr
;; VGM loop address.
;;
vgm_loop_ptr .ds 2
.code
;;
;; Macro: vgm_map
;; Map VGM data to MPR 6.
;;
.macro vgm_map
tma6
pha
lda <vgm_bank
tam6
.endmacro
;;
;; Macro: vgm_unmap
;; Restore the value of MPR 6.
;;
.macro vgm_unmap
pla
tam6
.endmacro
;;
;; Function: vgm_next_byte
;; Increment VGM data pointer.
;;
;; If the VGM data pointer crosses the MPR boundary, the address is reseted and
;; the next bank is mapped.
;;
;; This routine may be called after each VSYNC.
;;
vgm_next_byte:
inc <vgm_ptr
bne .l0
inc <vgm_ptr+1
lda <vgm_ptr+1
cmp <vgm_end
bcc .l0
stw <vgm_base, <vgm_ptr
inc <vgm_bank
lda <vgm_bank
tam6
.l0:
rts
;;
;; Function: vgm_update
;; Read VGM frame data.
;;
vgm_update:
vgm_map
.loop
lda [vgm_ptr]
cmp #$f0
bcs .check_end
tax
jsr vgm_next_byte
lda [vgm_ptr]
sta psgport, X
jsr vgm_next_byte
bra .loop
.check_end:
cmp #$ff
bne .frame_end
vgm_unmap
lda <vgm_loop_bank
sta <vgm_bank
stw <vgm_loop_ptr, <vgm_ptr
rts
.frame_end:
jsr vgm_next_byte
vgm_unmap
rts
| 23.33913 | 80 | 0.584016 | [
"BSD-3-Clause"
] | BlockoS/up-17 | src/vgm.asm | 5,368 | Assembly |
; make some instructions to accept single-comma multi-arg even when --syntax=a mode is specified
; instructions supporting relaxed multi-arg: dec, inc, pop, push
; errors of double-comma used without --syntax=a mode
dec bc,,de
inc bc,,de
push hl,,de
pop hl,,de
OPT --reversepop
pop hl,,de
; enabled --syntax=a mode, and check mixed commas for relaxed instructions
OPT reset --syntax=a
dec bc,de,,hl,sp,,ix,iy,,b,c,d,e,,h,l,(hl),a
inc bc,de,,hl,sp,,ix,iy,,b,c,d,e,,h,l,(hl),a
push bc,de,,hl,af,,ix,iy
pop bc,de,,hl,af,,ix,iy
OPT --reversepop
pop bc,de,,hl,af,,ix,iy
| 28.227273 | 96 | 0.640902 | [
"BSD-3-Clause"
] | NEO-SPECTRUMAN/sjasmplus | tests/parsing/issue166_multiarg_exceptions.asm | 621 | Assembly |
; function to print a BCD (Binary-coded decimal) number
; de = address of BCD number
; hl = destination address
; c = flags and length
; bit 7: if set, do not print leading zeroes
; if unset, print leading zeroes
; bit 6: if set, left-align the string (do not pad empty digits with spaces)
; if unset, right-align the string
; bit 5: if set, print currency symbol at the beginning of the string
; if unset, do not print the currency symbol
; bits 0-4: length of BCD number in bytes
; Note that bits 5 and 7 are modified during execution. The above reflects
; their meaning at the beginning of the functions's execution.
PrintBCDNumber::
ld b, c ; save flags in b
res 7, c
res 6, c
res 5, c ; c now holds the length
bit 5, b
jr z, .loop
bit 7, b
jr nz, .loop
ld [hl], "¥"
inc hl
.loop
ld a, [de]
swap a
call PrintBCDDigit ; print upper digit
ld a, [de]
call PrintBCDDigit ; print lower digit
inc de
dec c
jr nz, .loop
bit 7, b ; were any non-zero digits printed?
jr z, .done ; if so, we are done
.numberEqualsZero ; if every digit of the BCD number is zero
bit 6, b ; left or right alignment?
jr nz, .skipRightAlignmentAdjustment
dec hl ; if the string is right-aligned, it needs to be moved back one space
.skipRightAlignmentAdjustment
bit 5, b
jr z, .skipCurrencySymbol
ld [hl], "¥"
inc hl
.skipCurrencySymbol
ld [hl], "0"
call PrintLetterDelay
inc hl
.done
ret
PrintBCDDigit::
and $f
and a
jr z, .zeroDigit
.nonzeroDigit
bit 7, b ; have any non-space characters been printed?
jr z, .outputDigit
; if bit 7 is set, then no numbers have been printed yet
bit 5, b ; print the currency symbol?
jr z, .skipCurrencySymbol
ld [hl], "¥"
inc hl
res 5, b
.skipCurrencySymbol
res 7, b ; unset 7 to indicate that a nonzero digit has been reached
.outputDigit
add "0"
ld [hli], a
jp PrintLetterDelay
.zeroDigit
bit 7, b ; either printing leading zeroes or already reached a nonzero digit?
jr z, .outputDigit ; if so, print a zero digit
bit 6, b ; left or right alignment?
ret nz
inc hl ; if right-aligned, "print" a space by advancing the pointer
ret
| 27.089744 | 78 | 0.706578 | [
"CC0-1.0"
] | opiter09/ASM-Machina | home/print_bcd.asm | 2,116 | Assembly |
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r8
push %r9
push %rbp
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x30d8, %rbx
nop
nop
nop
sub %rdi, %rdi
movw $0x6162, (%rbx)
nop
nop
nop
nop
nop
cmp %rsi, %rsi
lea addresses_WC_ht+0x130d8, %rsi
lea addresses_A_ht+0xe6d8, %rdi
nop
nop
nop
nop
nop
and $8002, %rbx
mov $3, %rcx
rep movsl
nop
add %rbp, %rbp
lea addresses_normal_ht+0x94d8, %rsi
lea addresses_normal_ht+0x1c9f8, %rdi
nop
dec %r10
mov $16, %rcx
rep movsw
nop
nop
nop
xor $18061, %rsi
lea addresses_D_ht+0x1b278, %rsi
lea addresses_A_ht+0x100d8, %rdi
nop
nop
nop
xor %r9, %r9
mov $76, %rcx
rep movsb
nop
nop
nop
nop
nop
sub %r10, %r10
lea addresses_UC_ht+0xbdd8, %rcx
inc %r10
movb $0x61, (%rcx)
nop
nop
nop
inc %rbx
lea addresses_A_ht+0x14262, %r9
nop
nop
nop
dec %rcx
mov $0x6162636465666768, %r10
movq %r10, %xmm4
movups %xmm4, (%r9)
nop
nop
nop
inc %rcx
lea addresses_A_ht+0xc078, %rsi
lea addresses_D_ht+0x47d8, %rdi
nop
nop
nop
nop
add %r8, %r8
mov $13, %rcx
rep movsw
nop
sub $21252, %rbx
lea addresses_normal_ht+0x9ad8, %rdi
nop
nop
nop
nop
xor $20572, %r9
mov (%rdi), %r10d
nop
nop
nop
sub %rbp, %rbp
lea addresses_A_ht+0x6808, %rcx
add %r9, %r9
mov (%rcx), %bx
sub %rsi, %rsi
lea addresses_normal_ht+0xb998, %r8
nop
xor %rsi, %rsi
mov $0x6162636465666768, %rbp
movq %rbp, (%r8)
nop
nop
nop
nop
nop
sub %rcx, %rcx
lea addresses_WC_ht+0x6c18, %rcx
cmp $61037, %r9
mov (%rcx), %esi
and %rdi, %rdi
lea addresses_WC_ht+0x72d8, %rsi
lea addresses_D_ht+0x125c8, %rdi
inc %rbx
mov $61, %rcx
rep movsb
nop
nop
nop
and $34674, %rsi
lea addresses_UC_ht+0x16af2, %r10
nop
nop
add %rbp, %rbp
mov (%r10), %edi
nop
nop
nop
nop
cmp $29488, %r10
lea addresses_WC_ht+0x1758c, %rsi
lea addresses_normal_ht+0xa94, %rdi
nop
nop
nop
cmp $53058, %r9
mov $4, %rcx
rep movsw
nop
nop
nop
nop
nop
add %rdi, %rdi
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r9
pop %r8
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r14
push %r9
push %rcx
push %rsi
// Faulty Load
lea addresses_WT+0x1a0d8, %r14
nop
nop
nop
add $25102, %rcx
vmovups (%r14), %ymm5
vextracti128 $0, %ymm5, %xmm5
vpextrq $1, %xmm5, %r12
lea oracles, %rcx
and $0xff, %r12
shlq $12, %r12
mov (%rcx,%r12,1), %r12
pop %rsi
pop %rcx
pop %r9
pop %r14
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'size': 2, 'AVXalign': True, 'NT': True, 'congruent': 0, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 2, 'AVXalign': True, 'NT': False, 'congruent': 10, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 6, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 11, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 3, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': True}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 1, 'same': True}}
{'39': 715}
39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39
*/
| 30.847222 | 2,144 | 0.657211 | [
"MIT"
] | danielmgmi/medusa | Transynther/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_715_1602.asm | 6,663 | Assembly |
;------------------------------------------------------------------------------
; NCB85 CP/M BIOS
; Roman Borik/RM-Team 2/2012, 2/2013, 1/2014
; archeocomp 2014-2016
; NCB85 is a SBC based on 8085 and 64k SRAM. There is also 8kB ROM from 0000H
; that can be shadowed by outputting 1 to SOD pin of 8085
; BIOS is in the ROM and moved to target RAM after reset. CP/M is loaded from
; diskette drive or from ROM
;------------------------------------------------------------------------------
;DEBUG equ 1 ; floppy driver debug on uart 2.2
cpu 8085undoc
jnk macro adr
jnx5 adr
endm
jk macro adr
jx5 adr
endm
;------------------------------------------------------------------------------
CPMVer equ 22 ; CP/M ver 2.2
BIOSVer equ 30 ; BIOS ver 3.0
CRYSTAL equ 10 ; MHz
; physical floppy sectors
HSTSIZ equ 256 ; HOST DISK SECTOR SIZE
; step rate, head settle time
;FloppySpeed equ "FAST" ;for TEAC drives
FloppySpeed equ "MEDIUM" ;slower drives MITSUMI?
ifndef Floppy
message "Floppy type not defined!!!!!!"
endif
; drives used
if (Extra==0)
NumFlps equ 2 ; number of floppy drives
else
NumFlps equ 3 ; number of floppy drives
endif
CCPLength equ 0800h ; CCP len
BDOSLength equ 0E00h ; BDOS len
BIOSLengthMax equ 1000h ; BIOS (Max) len
CcpBdosSec equ (CCPLength+BDOSLength)/128 ; CCP + BDOS len in sectors
; be sure to include correct cp/m image at the end of file
if (Floppy == 360)
BaseBIOS equ 0F500h ; BIOS address (with CPM bundled in 8k ROM) for 2x360k
elseif (Floppy==720)
BaseBIOS equ 0F500h ; BIOS address (with CPM bundled in 8k ROM) for 2x720k
elseif (Floppy==120)
if (Extra==120)
BaseBIOS equ 0F400h ; BIOS address (with CPM bundled in 8k ROM) for 2x1.2MB + 1x 1.2MB
else
BaseBIOS equ 0F500h ; BIOS address (with CPM bundled in 8k ROM) for 2x1.2MB + 500kB 8"(or just 2 drives)
endif
elseif (Floppy==144)
if (Extra==0)
BaseBIOS equ 0F500h ; BIOS address (with CPM bundled in 8k ROM) for 2x1.44MB
else
BaseBIOS equ 0F400h ; BIOS address (with CPM bundled in 8k ROM) for 2x1.44MB + 500kB 8"(or 3 1.44MB drives)
endif
elseif (Floppy==100)
BaseBIOS equ 0F500h ; BIOS address (with CPM bundled in 8k ROM) for 2x1.0MB, IBM floppy
endif
BaseCCP equ BaseBIOS-(CCPLength+BDOSLength) ; CCP address
BaseBDOS equ BaseCCP+CCPLength+6 ; BDOS address
message "BIOS begins at \{BaseBIOS}"
message "CCP begins at \{BaseCCP}"
IOByte equ 0003h ; IO byte (not used)
CurrentDisk equ 0004h ; default disk
Buffer equ 0080h ; default DMA address
Rst55Vect equ 002Ch ; RST5.5 (USART)
Rst65Vect equ 0034h ; RST6.5 (TIMER)
BEL equ 7
CR equ 0Dh
LF equ 0Ah
EOF equ 1Ah
ESC equ 1Bh
SPACE equ 20h
;------------------------------------------------------------------------------
; IO ports
PIO_PA equ 10h ; 8255
PIO_PB equ 11h
PIO_PC equ 12h
PIO_CWR equ 13h
USART_DATA equ 8 ; 8251
USART_CWR equ 9
USART_STAT equ 9
PCF8584_ADDR equ 58h ; I2C Controller
MUART_ADDR equ 60h ; 8256
; paging ROM/RAM - values for SIM instruction
XROM equ 40h
XRAM equ 0C0h
; init USART
USART_RESET equ 01000000b
USART_CMD1 equ 01001110b
USART_CMD2 equ 00010101b
; USART 16552
FIFO_CTRL_REG_1 equ 2Ah
FIFO_CTRL_REG_2 equ 22h
LINE_CTRL_REG_1 equ 2Bh
LINE_CTRL_REG_2 equ 23h
DIVISOR_LOW_BYTE_1 equ 28h
DIVISOR_HIGH_BYTE_1 equ 29h
DIVISOR_LOW_BYTE_2 equ 20h
DIVISOR_HIGH_BYTE_2 equ 21h
LINE_STATUS_REG_1 equ 2Dh
TRANSMITTER_BUFFER_REG_1 equ 28h
RECEIVER_BUFFER_REG_1 equ 28h
LINE_STATUS_REG_2 equ 25h
TRANSMITTER_BUFFER_REG_2 equ 20h
;------------------------------------------------------------------------------
org 0
Boot:
include "rom_loader.asm"
;------------------------------------------------------------------------------
QBaseBIOS: equ $
phase BaseBIOS
; BIOS entry points
CBOOTE: jmp CBOOT ; Cold boot
WBOOTE: jmp WBOOT ; Warm Boot
jmp CONST ; Console status
jmp CONIN ; Console input
jmp CONOUT ; Console output
jmp LIST ; List (printer) output
jmp PUNCH ; Character output
jmp READER ; Character input
jmp HOME ; Go to track 0
jmp SELDSK ; Select disk
jmp SETTRK ; Set track
jmp SETSEC ; Set sector
jmp SETDMA ; Set DMA
jmp READ ; Read sector
jmp WRITE ; Write sector
jmp LISTST ; List (printer) status
jmp SECTRN ; Sector translation
;------------------------------------------------------------------------------
Signature: db ESC,"[0m" ; reset terminal attributes
db ESC,"[2J" ; clear console
db CR,LF
db "NCB85 64k CP/M v"
db CPMVer/10+'0','.',CPMVer#10+'0'
db ", BIOS v"
db BIOSVer/10+'0','.',BIOSVer#10+'0'
db ", ",BaseBIOS/4096+'A'-10,(BaseBIOS#4096)/256+'0',"00-FFFF"
if ((NumFlps==3) && (Extra==Floppy))
if (Floppy==360)
db ", 3x 360kB 5.25\""
elseif (Floppy==720)
db ", 3x 720kB 5.25\""
elseif (Floppy==120)
db ", 3x 1.2MB 5.25\""
elseif (Floppy==144)
db ", 3x 1.44MB 3.5\""
elseif (Floppy==100)
db ", 3x 1.0MB 8\" IBM"
endif
elseif
if (Floppy==360)
db ", 2x 360kB 5.25\""
elseif (Floppy==720)
db ", 2x 720kB 5.25\""
elseif (Floppy==120)
db ", 2x 1.2MB 5.25\""
elseif (Floppy==144)
db ", 2x 1.44MB 3.5\""
elseif (Floppy==100)
db ", 2x 1.0MB 8\" IBM"
endif
if (Extra==50)
db " + 1x 500kB 8\""
elseif (Extra==120)
db " + 1x 1.2MB 5.25\""
elseif (Extra==144)
db " + 1x 1.44MB 3.5\""
endif
endif
db CR,LF
db "RomBor, Archeocomp 07/2014, 12/2018"
TCRLF: db CR,LF,0
ErrBoot: db "BOOT Error!"
db CR,LF,CR,LF,BEL,0
ErrRead: db CR,LF,"Read",0
ErrWrite: db CR,LF,"Write",0
ErrError: db " Error! - ",0
ErrRetry: db " [R]etry [I]gnore Re[B]oot"
db CR,LF,BEL,0
; ; flag, do not move
db 0 ; 0=warm start, 1=cold start
CCPCommand:
db 3,"DIR",0
CCPCommandLen: equ $ - CCPCommand
;------------------------------------------------------------------------------
; * CBOOT * Cold boot
CBOOT: di
lxi sp,0 ; stack to ram end
;
mvi a,XRAM ; disable ROM
sim
;
call HardwareInit ; HW init
lxi h,Signature
call Print0
;
xra a ; zero
sta IOByte ; IOByte
sta CurrentDisk ; current disk and user
;DRI blocking alg.
;STA HSTACT ; CLEAR HOST ACTIVE FLAG
;STA UNACNT
;
inr a
sta CCPCommand-1 ; flag: cold start
;------------------------------------------------------------------------------
; * WBOOT * Warm boot
WBOOT: di
lxi sp,0 ; stack to ram end
;
lda CCPCommand-1
ora a
cz HardwareInit ; initialize HW at warm start
;
xra a ; clear A
dcr a ; decrement
sta drive_nr ; drive -1, track -1, sector -1, head N.A.
sta track_nr ; FDC driver variables, avoid false detection of
sta sector_nr ; cached sector in deblocking algorithm
;
WBoot2: xra a
sta motor_0_state ; floppy motor A:
sta motor_1_state ; floppy motor B:
if (Extra==50)
sta motor_2_state ; floppy motor C:
endif
inr a ; 256 bytes per sector
sta NUMBER_OF_BYTES ; FDC driver variables
call set_drv_type ; set disk drive type (param form build)
call fd_init ; initialize FDC
call long_delay ; wait
jnc .f1 ; load CPM from ROM
lxi h,ErrBoot ; print boot error
call Print0
hlt
.f1 mvi a,XROM+1Fh ; connect ROM to bus and disable interrupts
sim
lxi h,CPMBIN ; source ROM address
lxi d,BaseCCP ; destination RAM
lxi b,CCPLength+BDOSLength ; length
call CopyBlock ; copy
mvi a,XRAM ; disable ROM
sim
WBootEnd: lxi h,Buffer ; DMA address
shld DMAADR
mvi a,0C3h ; jmp instruction to WBOOT to address 0
sta 0
lxi h,WBOOTE
shld 1
sta 5 ; jmp instruction to BDOS to address 5
lxi h,BaseBDOS
shld 6
lda CurrentDisk ; last used drive
mov c,a ; send to CCP in C register
lxi h,CCPCommand-1 ; cold/warm start ?
mov a,m ; flag to A
mvi m,0 ; clear flag
ora a ; warm start ?
jz BaseCCP+3 ; jump to CCP with empty edit buffer
inx h ; move to beg of "DIR"
;jmp BaseCCP+3 ; jump to CCP with empty edit buffer
lxi d,BaseCCP+7 ; copy to edit buffer
lxi b,CCPCommandLen
call CopyBlock
jmp BaseCCP ; jump to CCP
;
;------------------------------------------------------------------------------
CopyBlock: mov a,m
stax d
inx h
inx d
dcx b
mov a,b
ora c
jnz CopyBlock
ret
;------------------------------------------------------------------------------
; * Unused services *
;------------------------------------------------------------------------------
; printer ready - unused
LISTST: mvi a,255 ; always ready
;------------------------------------------------------------------------------
; Char out to printer - unused
LIST:
;------------------------------------------------------------------------------
; Char out to char output - unused
PUNCH:
ret
;------------------------------------------------------------------------------
; Char in from char input - unused
READER: mvi a,EOF ; always return EOF
ret
;------------------------------------------------------------------------------
; Print zero terminated text
; I: HL=text address
; O:
; M: HL, AF, C
Print0: mov a,m ; get char
inx h ; move to next
ora a ; end of text?
rz ; yes, return
call ConsoleOutputA ; send char
jmp Print0 ; repeat
;------------------------------------------------------------------------------
; Show error
; Read Error - D/T/S
; Write Error - D/T/S
; D - drive
; T - track
; S - sector
PrintError: call Print0 ; text Read/Write Error
lxi h,ErrError
call Print0
lda SEKDSK ; show Drive
adi 'A'
call ConsoleOutputA
mvi c,'/'
call ConsoleOutputC
lda SEKTRK ; show Track
call Dec8
mvi c,'/'
call ConsoleOutputC
lda SEKSEC ; show Sector
call Dec8
lxi h,ErrRetry
call Print0
call CONIN ; wait
ani 05Fh
cpi 'B' ; is it 'B'?
jz WBOOT ; warm start
ret
;------------------------------------------------------------------------------
; Print 8 bit number on 3 digits.
; Leading zeros are suppresed
; I: A= 0 .. 255
; O: -
; M: AF, B, DE, HL
Dec8: mov h,a ; number to H
mvi b,8 ; 8 bit number
lxi d,0 ; clear result in DE
Dec8L: dad h ; highest bit to CY
mov a,e ; lower and higher digits
adc a ; double it and add carry from DAD H
daa ; make it decimal
mov e,a
mov a,d ; hundreds - third digit
adc a ; double it and add carry from DAA
mov d,a
dcr b ; repeat for 8 bits
jnz Dec8L
lxi h,PrtBCDX+1 ; flag - leading zeroes
mov m,b ; clear flag - do not print leading zero
mov a,d ; higher digit to A
call PrtBCDchar ; print
mov a,e ; lower and higher digits to A
;------------------------------------------------------------------------------
; Print BCD number
; I: A=BCD number, HL=PrtBCDX+1
; O: -
; M: AF, B
PrtBCD: mov b,a ; back up
rrc ; swap higher digit to lower
rrc
rrc
rrc
call PrtBCDchar ; print digit
mov m,h ; set flag - leading zero
mov a,b ; restore
PrtBCDchar: ani 15 ; low 4 bits
jnz PrtBCDchar2 ; digit > 0
PrtBCDX: mvi a,0 ; any digit printed ?
ora a
rz ; no, return - do not print leading zero
xra a ; print also zero
PrtBCDchar2: adi '0' ; convert to char '0' - '9'
mov m,a ; set flag - valid digits
push b
push d
call ConsoleOutputA ; print char
pop d
pop b
ret
;------------------------------------------------------------------------------
; * READ - Read sector
; I: disk drive, sector and track at addresses Drive, Sector, Track
; source address at address Dma
; O: A=0 - OK
; A=1 - error
; M: all
READ: di
call LocalSP ; set local stack
call read_flp ; handle floppy
ana a ; check success
jz READ2
lxi h,ErrRead ; text Read Error
call PrintError ; show err
mvi a,1 ; A=1 - err
READ2: call RestoreSP ; restore original stack
ei
ret
;------------------------------------------------------------------------------
; * WRITE - Write sector
; I: disk drive, sector and track at addresses Drive, Sector, Track
; source address at address Dma
; O: A=0 - OK
; A=1 - error
; M: all
WRITE: di
call LocalSP ; set local stack
call write_flp ; handle floppy
ana a ; check success
jz WRITE2
lxi h,ErrWrite ; text Read Error
call PrintError ; show err
mvi a,1 ; A=1 - err
WRITE2: call RestoreSP ; restore original stack
ei
ret
;------------------------------------------------------------------------------
; Set local stack
; I: -
; O: -
; M: DE, HL, SP
LocalSP: pop d ; ret address to DE
lxi h,0 ; stack address to HL
dad sp
lxi sp,Stack ; new stack address
push h ; old stack address on new stack
xchg ; return indirectly
pchl
;------------------------------------------------------------------------------
; Restores original stack
; I: -
; O: -
; M: DE, HL, SP
RestoreSP: pop d ; ret address to DE
lhld Stack-2 ; original stack to HL
sphl ; set original stack address
xchg ; return indirectly
pchl
;------------------------------------------------------------------------------
; Init USART and PIO
; I: -
; O: -
; M: AF
HardwareInit:
; init USART 8251
xra a ; be sure to be in Command mode
out USART_CWR ; 3x 00
out USART_CWR
out USART_CWR
mvi a,USART_RESET ; Reset 8251
out USART_CWR
mvi a,USART_CMD1 ; 8 data, 1 stop, x16
out USART_CWR ; RxC a TxC = 307,2 kHz -> 19200 Bd
mvi a,USART_CMD2 ; RTS, DTR, Enable RX, TX
out USART_CWR
; I2C Controller PCF8584
mvi a,80h ; RESET, will also choose register S0_OWN i.e. next byte will be
out PCF8584_ADDR+1 ; loaded into reg S0^ (own address reg); serial interface off.
mvi a,55h ; loads byte 55H into reg S0^ effective own address becomes AAH.
out PCF8584_ADDR ; pcf8584 shifts this value left one bit
mvi a,0A0h ; loads byte A0H into reg S1, i.e. next byte will
out PCF8584_ADDR+1 ; be loaded into the clock control reg S2.
mvi a,10h ; loads byte 10H into reg S2;system clock is 4.43 MHz; SCL = 90 kHz
out PCF8584_ADDR
mvi a,0C1h ; loads byte C1H into reg S1; reg enable serial interface
out PCF8584_ADDR+1 ; next write or read operation will be to/from data transfer reg S0
; 8256 MUART
mvi a,01h ; 8256 in 8085 mode, command1
out MUART_ADDR
mvi a,03h ; PARITY | SYSTEM_CLK | BAUD_RATE_19, command2
out MUART_ADDR+1
mvi a,0C1h ; SET_BIT | RXE | RST_BIT, command3
out MUART_ADDR+2
mvi a,0C0h ; T35 | T24, P2C2=P2C1=P2C0=input, mode
out MUART_ADDR+3
mvi a,00h ; port1, input
out MUART_ADDR+4
mvi a,0FFh ; reset interrupts
out MUART_ADDR+6
;
uart_init_16552:
mvi a, 0C6h ;06-no FIFO, 07-enable FIFO, bits 6,7 - fifo trigger
out FIFO_CTRL_REG_1
out FIFO_CTRL_REG_2
mvi a, 83h
out LINE_CTRL_REG_1
out LINE_CTRL_REG_2
mvi a, 02h ;8-4800,4-9600,2-19200,1-38400
out DIVISOR_LOW_BYTE_1
out DIVISOR_LOW_BYTE_2
xra a
out DIVISOR_HIGH_BYTE_1
out DIVISOR_HIGH_BYTE_2
mvi a, 03h
out LINE_CTRL_REG_1
out LINE_CTRL_REG_2
ret
;
; print char in C reg on UART2.2
ifdef DEBUG
CONOUT2: in LINE_STATUS_REG_2 ; 16552
ani 20h
jz CONOUT2 ; wait
mov a,c ; char to A
out TRANSMITTER_BUFFER_REG_2 ; send
ret
;
;print hl in hex format
hl_to_hex: mov a,h
call tohexh
call CONOUT2 ;output
mov a,h
call tohexl
call CONOUT2 ;output
l_to_hex: mov a,l
call tohexh
call CONOUT2 ;output
l2_to_buff: mov a,l
call tohexl
call CONOUT2 ;output
ret
tohexh: rlc ;high 4-bits
rlc
rlc
rlc
tohexl: ani 0Fh ;low 4-bits
adi 30h
cpi 3Ah ;9 is 0x39
jm nohex ;0-9 ?
adi 07h ;no, it is A-F
nohex: mov c,a ;return in c
ret
newline: mvi c,13
call CONOUT2
mvi c,10
call CONOUT2
ret
endif
;------------------------------------------------------------------------------
; Variables in BIOS
StackX: ds 32 ; stack for BIOS
Stack equ $
;------------------------------------------------------------------------------
; choose one of the implementations of serial routines
; 8251 uart polling mode, no special char decode
;include "serial_mini.asm"
;
; 8251 uart, interrupt mode, with special char decoding
;include "serial_int.asm"
;
; 16552 uart, channel 1, pulling mode, no special char decode
include "serial_mini_16552.asm"
;
; 8256 muart, polling mode, no special char decode
;include "serial_8256.asm"
;------------------------------------------------------------------------------
include "fdc_driver.asm"
;------------------------------------------------------------------------------
; choose one of the implementations of blocking algorithm
;include "blocking_dri.asm"
; with dri uncomment also 2 lines following comment 'DRI blocking alg.' in CBOOT
;
include "blocking_chuck.asm"
;------------------------------------------------------------------------------
include "disk_params.asm"
;------------------------------------------------------------------------------
XBIOSBuffers: equ $
XBIOSLength: equ $ - BaseBIOS
if XBIOSLength > BIOSLengthMax
warning "\aBIOS is too long"
endif
;------------------------------------------------------------------------------
dephase
;------------------------------------------------------------------------------
CPMBIN:
if (BaseBIOS==0F300h)
binclude "../CPM/cpmDD00.bin"
elseif (BaseBIOS==0F400h)
binclude "../CPM/cpmDE00.bin"
elseif (BaseBIOS==0F500h)
binclude "../CPM/cpmDF00.bin"
elseif (BaseBIOS==0F600h)
binclude "../CPM/cpmE000.bin"
else
message "MISSING CPM image. FIX IT!!!"
endif
;------------------------------------------------------------------------------
phase XBIOSBuffers
;------------------------------------------------------------------------------
include "disk_buffers.asm"
message "END ADDRESS : \{$}"
;------------------------------------------------------------------------------
dephase
end
;------------------------------------------------------------------------------
| 31.257329 | 109 | 0.523395 | [
"Unlicense"
] | ncb85/NCB85V2-BIOS | bios_fdc_30/ncb85bios.asm | 19,192 | Assembly |
Name: zel_ending.asm
Type: file
Size: 102214
Last-Modified: '2016-05-13T04:20:48Z'
SHA-1: 0E8089D31DD7F75CEEA3049A12607260C426354F
Description: null
| 21.285714 | 47 | 0.818792 | [
"MIT"
] | prismotizm/gigaleak | other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/フランス_PAL/Fra_asm/zel_ending.asm | 149 | Assembly |
COMMENT @----------------------------------------------------------------------
Copyright (c) GeoWorks 1989 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: Text/TextGraphic
FILE: tgReplace.asm
METHODS:
Name Description
---- -----------
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 9/89 Initial version
DESCRIPTION:
...
$Id: tgReplace.asm,v 1.1 97/04/07 11:19:40 newdeal Exp $
------------------------------------------------------------------------------@
TextGraphic segment resource
COMMENT @----------------------------------------------------------------------
METHOD: VisTextReplaceWithGraphic --
MSG_VIS_TEXT_REPLACE_WITH_GRAPHIC for VisTextClass
DESCRIPTION: Replace the current selection with a graphic
PASS:
*ds:si - instance data (VisTextInstance)
dx - size ReplaceWithGraphicParams
ss:bp - ReplaceWithGraphicParams
RETURN:
carry set if error. (maxLength would be exceeded by adding graphic).
DESTROYED:
ax, bx, cx, dx, di, bp
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 9/89 Initial version
SH 5/94 XIP'ed
------------------------------------------------------------------------------@
VisTextReplaceWithGraphic proc far ; MSG_VIS_TEXT_REPLACE_WITH_GRAPHIC
class VisTextClass
; If the graphic is coming from a VM file, make sure this text
; object resides in a VM file as well.
;
tst ss:[bp].RWGP_sourceFile
jz afterVMCheck
; T_GetVMFile will return the process handle if this is a
; non-VM text object, so bail if that happens.
call T_GetVMFile
mov_tr ax, bx
call GeodeGetProcessHandle
cmp ax, bx
jne afterVMCheck
ret ; <- EXIT
afterVMCheck:
; suspend the text object
call TextSuspend
; insert the C_GRAPHIC character
mov ax, offset ReplacementString
call TU_StartChainIfUndoable
push bp
movdw dxax, ss:[bp].RWGP_range.VTR_start
movdw cxbx, ss:[bp].RWGP_range.VTR_end
sub sp, size VisTextReplaceParameters
mov bp, sp
movdw ss:[bp].VTRP_range.VTR_start, dxax
movdw ss:[bp].VTRP_range.VTR_end, cxbx
movdw ss:[bp].VTRP_insCount, 1
mov ss:[bp].VTRP_flags, 0
mov ss:[bp].VTRP_textReference.TR_type, TRT_POINTER
NOFXIP< mov ss:[bp].VTRP_textReference.TR_ref.TRU_pointer.\
TRP_pointer.segment, cs >
FXIP < mov ss:[bp].VTRP_textReference.TR_ref.TRU_pointer.\
TRP_pointer.segment, segment dummyChar >
mov ss:[bp].VTRP_textReference.TR_ref.TRU_pointer.\
TRP_pointer.offset, offset dummyChar
call QuickMoveSpecial
jc error
mov ax, MSG_VIS_TEXT_REPLACE_TEXT
push bp
call ObjCallInstanceNoLock
pop bp
jc error ;Exit, if we couldn't add the graphic
; change the dummy character that we inserted to a C_GRAPHIC
movdw dxax, ss:[bp].VTRP_range.VTR_start
incdw dxax
movdw ss:[bp].VTRP_range.VTR_end, dxax
mov ss:[bp].VTRP_textReference.TR_ref.TRU_pointer.\
TRP_pointer.offset, offset graphicChar
call TS_ReplaceRange
movdw dxax, ss:[bp].VTRP_range.VTR_start
add sp, size VisTextReplaceParameters
pop bp
; add the element and the run
push bp
mov bx, ss:[bp].RWGP_sourceFile
lea bp, ss:[bp].RWGP_graphic
call TA_AddGraphicAndRun
; nuke any cached information
mov ax, TEMP_VIS_TEXT_CACHED_RUN_INFO
call ObjVarDeleteData
clc ;Replace succeeded...
exit:
pushf
; un-suspend the object
call TU_EndChainIfUndoable
call TextUnsuspend
popf
pop bp
ret
error:
add sp, size VisTextReplaceParameters
stc ;Return carry set to denote error
jmp exit
VisTextReplaceWithGraphic endp
;
; On XIP systems, put these characters in a fixed resource, to save us lots
; of headaches...
;
FXIP <TextFixed segment resource >
SBCS <dummyChar char "x" >
DBCS <dummyChar wchar "x" >
SBCS <graphicChar char C_GRAPHIC >
DBCS <graphicChar wchar C_GRAPHIC >
FXIP <TextFixed ends >
COMMENT @----------------------------------------------------------------------
FUNCTION: TG_CopyGraphic
DESCRIPTION: Copy a graphic to a VM file
PASS:
bx - destination file
dx - source vm file
ss:bp - VisTextGraphic
RETURN:
ss:bp - VisTextGraphic
DESTROYED:
none
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 9/89 Initial version
------------------------------------------------------------------------------@
TG_CopyGraphic proc far uses ax, bx, cx, dx, si, di, es
.enter
; get the dest file
xchg bx, dx ;bx = source, dx = dest
tst bx
jnz gotSource
mov bx, dx ;source = dest
gotSource:
mov ax, ss:[bp].VTG_vmChain.high
tst ax
jz done
push bp
mov bp, ss:[bp].VTG_vmChain.low
clr cx ;preserve VM id's
call VMCopyVMChain ;axbp = chain
mov cx, bp ;axcx = chain
pop bp
; don't copy lmem chunk
movdw ss:[bp].VTG_vmChain, axcx
done:
.leave
ret
TG_CopyGraphic endp
COMMENT @----------------------------------------------------------------------
FUNCTION: TG_CompareGraphics
DESCRIPTION: Compare two VisTextGraphic structures
CALLED BY: INTERNAL
PASS:
ds:si - element in array
es:di - element to compare against
ss:ax - file for es:di element, file for ds:si element
RETURN:
carry - set if equal
DESTROYED:
ax, bx, cx, dx
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 1/90 Initial version
------------------------------------------------------------------------------@
TG_CompareGraphics proc far uses si, di, bp, ds, es
.enter
if ERROR_CHECK
;
; Validate that the element is not in a movable code segment
;
FXIP< push bx, si >
FXIP< mov bx, es >
FXIP< mov si, di >
FXIP< call ECAssertValidFarPointerXIP >
FXIP< pop bx, si >
endif
mov_tr bp, ax
mov dx, ss:[bp] ;dx = source file
mov bx, ss:[bp+2] ;bx = dest file
; compare everything but the data...
push si, di
mov cx, (size VisTextGraphic) - (offset VTG_size)
add si, offset VTG_size
add di, offset VTG_size
repe cmpsb
pop si, di
jnz different
; compare vm data
mov ax, ds:[si].VTG_vmChain.high
mov cx, es:[di].VTG_vmChain.high
jcxz esdiIsLMem
tst ax
jz different
; get the dest file
tst dx
jnz gotESDIfile
mov dx, bx
gotESDIfile:
; bx = dssi file, dx = esdi file
mov bp, ds:[si].VTG_vmChain.low
mov di, es:[di].VTG_vmChain.low
call VMCompareVMChains
jmp done
esdiIsLMem:
tst ax
jnz different
mov si, ds:[si].VTG_vmChain.low
mov di, es:[di].VTG_vmChain.low
tst di
jz esdiInNone
tst si
jz different
mov si, ds:[si]
mov di, ds:[di]
; Crash if either chunk is empty. If they *can* be empty, then the
; code should change to check for this case.
EC < cmp si, -1 >
EC < ERROR_Z -1 >
EC < cmp di, -1 >
EC < ERROR_Z -1 >
mov cx, ds:[si].LMC_size
cmp cx, ds:[di].LMC_size
jnz different
segmov es, ds
dec cx
dec cx
shr cx, 1
jnc 20$
cmpsb
jne different
20$:
repe cmpsw
stc
je done
different:
clc
done:
.leave
ret
esdiInNone:
tst si
jnz different
stc
jmp done
TG_CompareGraphics endp
TextGraphic ends
| 20.341463 | 80 | 0.620304 | [
"Apache-2.0"
] | BOBBYWY/pcgeos | Library/Text/TextGraphic/tgReplace.asm | 7,506 | Assembly |
; int esxdos_disk_write(uchar device, ulong position, void *src)
SECTION code_clib
SECTION code_esxdos
PUBLIC _esxdos_disk_write
EXTERN l0_esxdos_disk_write_callee
_esxdos_disk_write:
pop af
ex af,af'
dec sp
pop af
pop de
pop bc
pop hl
push hl
push bc
push de
dec sp
ex af,af'
push af
ex af,af'
jp l0_esxdos_disk_write_callee
| 12.172414 | 64 | 0.753541 | [
"BSD-2-Clause"
] | ByteProject/Puddle-BuildTools | FictionTools/z88dk/libsrc/_DEVELOPMENT/arch/zx/esxdos/c/sdcc_ix/esxdos_disk_write.asm | 353 | Assembly |
.data
sizeofarray: .word 3
array: .word 2, 4, 6, 8
.text
.globl main
main:
la $s0, sizeofarray
lw $s1, 0($s0) #$s1 = sizeofarray
ori $s2, $0, 0 #$s2 = i
la $s3, array #$s3 = &array
loopFor:
beq $s1, $s2, funcExit #if(i = sizeofarray) call funcExit
lw $s4, 0($s3) #$s4 = array[i]
lw $s5, 4($s3) #$s5 = array[i+1]
sub $t5, $s5, $s4 #$t5 = diff
blez $t5, negFunc #if(diff <= 0) call negFunc
bgtz $t5, posFunc #if(diff > 0) call posFunc
j update #call function for i++
negFunc:
bgtz $t5, update #call function for i++
sll $t2, $s4, 2 #multiply by 4
sll $t3, $s4, 0 #multiply by 1
add $t3, $t2, $t3 #add mult. by 1 and mult. by 4
sub $t4, $0, $t3 #negative of result
sw $t4, 4($s3) #array[i+1] = result(*-5)
j update
posFunc:
bltz $t5, update #call function for i++
sll $t2, $s4, 2 #multiply by 4
sll $t3, $s4, 0 #multiply by 1
add $t4, $t2, $t3 #add mult. by 1 and mult. by 4
sw $t4, 0($s3) #array[i] = result (*5)
j update
update:
addi $s2, $s2, 1 #i++
addi $s3, $s3, 4 #move array pointer
j loopFor
funcExit:
jr $ra | 27.069767 | 61 | 0.544674 | [
"MIT"
] | zorlubirhat/mips-array-and-function | array.asm | 1,164 | Assembly |
.global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r14
push %r15
push %r8
push %rbp
push %rdi
push %rsi
lea addresses_normal_ht+0x8093, %rsi
sub %r8, %r8
movb $0x61, (%rsi)
nop
nop
and %rdi, %rdi
lea addresses_A_ht+0xfcd3, %r14
clflush (%r14)
nop
lfence
movups (%r14), %xmm2
vpextrq $0, %xmm2, %rbp
nop
nop
nop
lfence
pop %rsi
pop %rdi
pop %rbp
pop %r8
pop %r15
pop %r14
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r15
push %rdi
push %rdx
push %rsi
// Faulty Load
lea addresses_A+0x1ecd3, %rdi
nop
and %r15, %r15
movb (%rdi), %r10b
lea oracles, %rdx
and $0xff, %r10
shlq $12, %r10
mov (%rdx,%r10,1), %r10
pop %rsi
pop %rdx
pop %rdi
pop %r15
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0, 'same': False, 'type': 'addresses_A'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': True, 'size': 1, 'congruent': 0, 'same': True, 'type': 'addresses_A'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 6, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 11, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'}
{'35': 21829}
35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35
*/
| 58.726027 | 2,999 | 0.661535 | [
"MIT"
] | danielmgmi/medusa | Transynther/_processed/AVXALIGN/_st_/i7-7700_9_0xca_notsx.log_21829_302.asm | 4,287 | Assembly |
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %rbp
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_UC_ht+0x1eaf2, %rsi
lea addresses_D_ht+0xf012, %rdi
nop
nop
nop
nop
sub %rbx, %rbx
mov $92, %rcx
rep movsw
nop
cmp %rbp, %rbp
lea addresses_UC_ht+0x58f2, %r10
nop
nop
nop
nop
nop
dec %rbx
movw $0x6162, (%r10)
xor %rbx, %rbx
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r14
push %r8
push %r9
push %rcx
push %rdi
push %rdx
push %rsi
// Store
lea addresses_D+0x141f2, %r9
nop
nop
nop
nop
and $15226, %r10
movl $0x51525354, (%r9)
nop
nop
nop
nop
and %rsi, %rsi
// Load
lea addresses_RW+0x146f2, %rdx
nop
nop
nop
inc %r9
movups (%rdx), %xmm1
vpextrq $0, %xmm1, %r8
cmp $1610, %r9
// REPMOV
lea addresses_D+0x40f2, %rsi
lea addresses_PSE+0xa2f2, %rdi
nop
nop
nop
dec %r9
mov $25, %rcx
rep movsl
sub %rcx, %rcx
// Store
lea addresses_D+0x17af2, %r9
nop
xor %rdx, %rdx
movl $0x51525354, (%r9)
nop
nop
nop
nop
nop
and %r14, %r14
// Store
lea addresses_normal+0x1fd72, %rdx
nop
xor $57260, %rsi
mov $0x5152535455565758, %rdi
movq %rdi, (%rdx)
nop
nop
nop
nop
xor %r9, %r9
// Store
lea addresses_WC+0x1c2f2, %r8
nop
nop
nop
nop
xor $8273, %rdi
movw $0x5152, (%r8)
nop
nop
nop
nop
nop
sub %rdx, %rdx
// Store
lea addresses_WT+0x65f2, %r10
nop
nop
xor $14990, %r14
movw $0x5152, (%r10)
nop
nop
add $36131, %r9
// Load
mov $0x67ae3d00000006f2, %r14
nop
dec %r8
vmovups (%r14), %ymm2
vextracti128 $0, %ymm2, %xmm2
vpextrq $1, %xmm2, %r9
nop
nop
nop
nop
cmp $49370, %rdi
// Store
lea addresses_WT+0x11d1e, %r14
nop
nop
nop
nop
nop
sub %r9, %r9
mov $0x5152535455565758, %r8
movq %r8, %xmm5
movups %xmm5, (%r14)
nop
xor $25126, %rdi
// Load
lea addresses_PSE+0xcd72, %r8
nop
nop
nop
and %rsi, %rsi
vmovups (%r8), %ymm3
vextracti128 $0, %ymm3, %xmm3
vpextrq $1, %xmm3, %rdi
nop
nop
nop
nop
inc %r8
// Load
lea addresses_D+0x17af2, %r14
nop
nop
nop
nop
sub $58329, %rdx
mov (%r14), %si
nop
xor %rdx, %rdx
// Store
lea addresses_UC+0xecaa, %rcx
nop
nop
nop
nop
nop
cmp $45458, %r8
movw $0x5152, (%rcx)
nop
nop
add %r10, %r10
// Faulty Load
lea addresses_D+0x17af2, %rsi
nop
nop
nop
nop
add $38407, %r10
vmovntdqa (%rsi), %ymm1
vextracti128 $1, %ymm1, %xmm1
vpextrq $1, %xmm1, %rdx
lea oracles, %r8
and $0xff, %rdx
shlq $12, %rdx
mov (%r8,%rdx,1), %rdx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r9
pop %r8
pop %r14
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_D', 'NT': False, 'AVXalign': True, 'size': 2, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 7}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_RW', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 10}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 9, 'type': 'addresses_D'}, 'dst': {'same': False, 'congruent': 11, 'type': 'addresses_PSE'}}
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_D', 'NT': True, 'AVXalign': False, 'size': 4, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 7}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 11}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 8}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_NC', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 8}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 2}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_PSE', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 7}}
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_D', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 2}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_D', 'NT': True, 'AVXalign': False, 'size': 32, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'same': False, 'congruent': 11, 'type': 'addresses_UC_ht'}, 'dst': {'same': False, 'congruent': 5, 'type': 'addresses_D_ht'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 8}}
{'00': 1}
00
*/
| 18.260163 | 148 | 0.63691 | [
"MIT"
] | danielmgmi/medusa | Transynther/_processed/AVXALIGN/_zr_/i9-9900K_12_0xca_notsx.log_1_1872.asm | 4,492 | Assembly |
; A010236: Continued fraction for sqrt(194).
; 13,1,12,1,26,1,12,1,26,1,12,1,26,1,12,1,26,1,12,1,26,1,12,1,26,1,12,1,26,1,12,1,26,1,12,1,26,1,12,1,26,1,12,1,26,1,12,1,26,1,12,1,26,1,12,1,26,1,12,1,26,1,12,1,26,1
add $0,3
mul $0,5
lpb $0
mov $2,$0
add $0,5
mod $2,10
trn $2,1
add $2,3
add $4,$3
mov $3,1
add $4,3
sub $3,$4
sub $3,$0
mov $0,$3
add $0,2
mul $3,2
gcd $0,$3
add $4,$2
mul $2,$0
mov $0,$2
mov $3,1
add $4,$2
lpe
sub $0,2
mov $1,$0
| 16.586207 | 166 | 0.532225 | [
"Apache-2.0"
] | jmorken/loda | programs/oeis/010/A010236.asm | 481 | Assembly |
%ifdef CONFIG
{
"RegData": {
"RBX": "0xDA",
"RCX": "0x67EA",
"RDX": "0x656667FA",
"RBP": "0x616263646566680A",
"RDI": "0x82",
"RSP": "0x8082",
"R8": "0x80808082",
"R9": "0x1",
"R10": "0x414244164618471A",
"R11": "0x515253545556582A",
"R12": "0x6162636465666768"
},
"MemoryRegions": {
"0x100000000": "4096"
}
}
%endif
mov r15, 0xe0000000
mov rax, 0x4142434445464748
mov [r15 + 8 * 0], rax
mov rax, 0x5152535455565758
mov [r15 + 8 * 1], rax
mov rax, 0x6162636465666768
mov [r15 + 8 * 2], rax
mov rax, 0xD1
stc
lock adc byte [r15 + 8 * 0 + 0], al
stc
lock adc word [r15 + 8 * 0 + 2], ax
stc
lock adc dword [r15 + 8 * 0 + 4], eax
stc
lock adc qword [r15 + 8 * 1 + 0], rax
mov rbx, 0x71
mov rcx, 0x81
mov rdx, 0x91
mov rbp, 0xA1
stc
adc bl, byte [r15 + 8 * 2]
stc
adc cx, word [r15 + 8 * 2]
stc
adc edx, dword [r15 + 8 * 2]
stc
adc rbp, qword [r15 + 8 * 2]
mov rax, 0x01
stc
adc al, 0x80
mov rdi, rax
mov rax, 0x01
stc
adc ax, 0x8080
mov rsp, rax
mov rax, 0x01
stc
adc eax, 0x80808080
mov r8, rax
mov rax, 0x01
stc
adc rax, -1
mov r9, rax
mov r10, [r15 + 8 * 0]
mov r11, [r15 + 8 * 1]
mov r12, [r15 + 8 * 2]
hlt
| 14.604938 | 37 | 0.58918 | [
"MIT"
] | Azkali/FEX | unittests/ASM/Primary/Primary_10_4.asm | 1,183 | Assembly |
; A032119: Number of labeled series-reduced dyslexic planted planar trees (root unlabeled) with n leaves.
; Submitted by Christian Krause
; 1,1,6,57,750,12645,260190,6322365,177181830,5625873225,199608636150,7826601269025,336070622037150,15684327120386925,790493799998652750,42790196611446409125,2475921578709979149750,152499324058939789556625,9961887269457311273835750,687922376268803482237055625,50071665931962039555909468750,3831395578289634654171991243125,307468486722845282854191080658750,25821599740742181918912125488858125,2264887014640102791030726905364843750,207111507583803318917636764569661265625
mov $1,2
mov $2,1
mov $3,$0
mov $4,2
lpb $3
add $0,1
mul $1,$3
mul $1,$0
mul $2,$5
sub $3,1
add $5,$4
div $1,$5
add $2,$1
div $2,2
lpe
mov $0,$2
| 36.761905 | 469 | 0.816062 | [
"Apache-2.0"
] | ckrause/loda-programs | oeis/032/A032119.asm | 772 | Assembly |
* set error - Bad parameter
*
section utils
*
xdef err_bp
*
include dev8_sbsext_ext_keys
*
err_bp
moveq #err.bp,d0
rts
end
| 13.538462 | 36 | 0.528409 | [
"BSD-2-Clause"
] | olifink/smsqe | sbsext/ut/errbp.asm | 176 | Assembly |
; A228293: a(n) = Sum_{k=1..9} n^k.
; 0,9,1022,29523,349524,2441405,12093234,47079207,153391688,435848049,1111111110,2593742459,5628851292,11488207653,22250358074,41189313615,73300775184,125999618777,210027483918,340614792099,538947368420,833994048909,1264758228162,1883023236983,2756668737624,3973642985025,5646683826134,7918889695947,10970250618348,15025258332149,20361724137930,27320942899359,36319351833632,47861843289513,62556901638174,81133745691635,104461669716084,133571788122717,169681401296978,214221212768199,268865641025640,335566482753809,416590198089702,514559102697243,632496766009724,773877929909445,942683277395034,1143459396431087,1381384300181808,1662338881200249,1992984693877550,2380848476552259,2834413842138372,3363220583952173,3977972061602274,4690651150354455,5514645256292984,6464880918873057,7557968542094838,8812357815528299
mov $2,$0
mov $3,10
lpb $3,1
mul $1,$2
add $1,8
sub $3,1
lpe
sub $1,8
div $1,8
| 72.230769 | 816 | 0.870075 | [
"Apache-2.0"
] | karttu/loda | programs/oeis/228/A228293.asm | 939 | Assembly |
; A100192: a(n) = Sum_{k=0..n} binomial(2n,n+k)*2^k.
; Submitted by Jamie Morken(w3)
; 1,4,18,82,374,1704,7752,35214,159750,723880,3276908,14821668,66991436,302605528,1366182276,6165204102,27811282374,125415953208,565408947756,2548400193852,11483706241044,51739037228688,233070330199296,1049777052815052,4727770393417884,21289800668074704,95862446363153592,431610600547593064,1943151638626076840,8747742971165975640,39378874761280009532,177260253730040381302,797889311325770119494,3591362678971559784792,16164529433458614921324,72753796027259237703564,327445058976079993787492
mov $4,$0
add $0,1
mul $4,2
lpb $0
sub $0,1
mov $3,$4
bin $3,$1
add $1,1
add $3,$2
add $2,$3
lpe
mov $0,$2
| 41 | 491 | 0.809182 | [
"Apache-2.0"
] | ckrause/loda-programs | oeis/100/A100192.asm | 697 | Assembly |
; ----------------------------------------------------------------------------
; Altair, CIDLESA's 1981 arcade game remade for the ZX Spectrum and
; Amstrad CPC.
; ----------------------------------------------------------------------------
; ----------------------------------------------------------------------------
; Menu state.
; ----------------------------------------------------------------------------
#ifdef LANG_EN
txdefeat0 .db "WIN BATTLE AFTER", 0
txdefeat1 .db "BATTLE AND DESTROY", 0
txdefeat2 .db "THE MONSTER", 0
txdefeat3 .db "THE MONSTER AS DID", 0
txpoints .db "POINTS", 0
#endif
#ifdef LANG_ES
txdefeat0 .db "VENCE BATALLA TRAS", 0
txdefeat1 .db "BATALLA Y DESTRUYE AL", 0
txdefeat2 .db "MONSTRUO", 0
txdefeat3 .db "MONSTRUO COMO HIZO", 0
txpoints .db "PUNTOS", 0
#endif
txextra .db "EXTRA", 0
tenthou .db 1, 0, 0, 0, 0
txtop .db "AAAAAAAAAAAAAAAAAAAAA", 0
; If the bird has been killed at least once.
bird_killed_once .db 0
MENU_CDELAY .equ $007f >> 2
MENU_TXDELAY .equ $00ff >> 2
MENU_WDELAY .equ $4fff
NUMCLR .equ PBLUE|YELLOW
menu_code .db ICLS, PBLUE|BLUE
.db ITEXT, PBLUE|CYAN, SCRWC-TXCIDELSA_LEN, 23
.db txcidelsa_str&255, txcidelsa_str>>8
.db IDELAY, MENU_CDELAY&255, MENU_CDELAY>>8
.db IDRHLINE, 'C', PBLUE|GREEN, 0, 0, 31
.db IDRVLINE, 'C', PBLUE|GREEN, 31, 1, 7
.db IDRHLINE, 'C', PBLUE|GREEN, 8, 31, 0
.db IDRVLINE, 'C', PBLUE|GREEN, 0, 7, 1
.db IDELAY, MENU_TXDELAY&255, MENU_TXDELAY>>8
.db ITEXT, PBLUE|WHITE, 5, 2, txdefeat0&255, txdefeat0>>8
.db ITEXT, PBLUE|WHITE, 5, 3, txdefeat1&255, txdefeat1>>8
.db IIFBIRDK, 0
.db ITEXT, PBLUE|WHITE, 5, 4, txdefeat2&255, txdefeat2>>8
.db IENDIF
.db IIFBIRDK, 1
.db ITEXT, PBLUE|WHITE, 5, 4, txdefeat3&255, txdefeat3>>8
.db ITEXT, PBLUE|YELLOW, 5, 6, txtop&255, txtop>>8
.db IENDIF
.db IDELAY, MENU_CDELAY&255, MENU_CDELAY>>8
.db IDRVLINE, 'C', PBLUE|GREEN, 31, 8, 22
.db IDRHLINE, 'C', PBLUE|GREEN, 22, 30, 0
.db IDRVLINE, 'C', PBLUE|GREEN, 0, 21, 8
.db IDELAY, MENU_TXDELAY&255, MENU_TXDELAY>>8
.db IDRALIEN, 0, PBLUE|YELLOW, 8, 11
.db IDRNUM, NUMCLR, SCORDIG, scoral0&255, scoral0>>8, 11, 11
.db ITEXT, PBLUE|WHITE, 18, 11, txpoints&255, txpoints>>8
.db IDRALIEN, 1, PBLUE|CYAN, 8, 12
.db IDRNUM, NUMCLR, SCORDIG, scoral1&255, scoral1>>8, 11, 12
.db ITEXT, PBLUE|WHITE, 18, 12, txpoints&255, txpoints>>8
.db IDRALIEN, 2, PBLUE|MAGENT, 8, 13
.db IDRNUM, NUMCLR, SCORDIG, scoral2&255, scoral2>>8, 11, 13
.db ITEXT, PBLUE|WHITE, 18, 13, txpoints&255, txpoints>>8
.db IDRALIEN, 3, PBLUE|WHITE, 8, 14
.db IDRNUM, NUMCLR, SCORDIG, scoral3&255, scoral3>>8, 11, 14
.db ITEXT, PBLUE|WHITE, 18, 14, txpoints&255, txpoints>>8
.db IDRALIEN, 4, PBLUE|YELLOW, 8, 15
.db IDRNUM, NUMCLR, SCORDIG, scoral4&255, scoral4>>8, 11, 15
.db ITEXT, PBLUE|WHITE, 18, 15, txpoints&255, txpoints>>8
.db IDRALIEN, 5, PBLUE|RED, 8, 16
.db IDRNUM, NUMCLR, SCORDIG, scoral5&255, scoral5>>8, 11, 16
.db ITEXT, PBLUE|WHITE, 18, 16, txpoints&255, txpoints>>8
.db IDRALIEN, 6, PBLUE|GREEN, 8, 17
.db IDRNUM, NUMCLR, SCORDIG, scoral6&255, scoral6>>8, 11, 17
.db ITEXT, PBLUE|WHITE, 18, 17, txpoints&255, txpoints>>8
.db ITEXT, PBLUE|WHITE, 6, 19, txextra&255, txextra>>8
.db IDRCHR, PBLUE|CYAN, 12, 19, hudlife&255, hudlife>>8
.db IDRNUM, NUMCLR, SCORDIG, tenthou&255, tenthou>>8, 14, 19
.db ITEXT, PBLUE|WHITE, 20, 19, txpoints&255, txpoints>>8
.db IDELAY, MENU_WDELAY&255, MENU_WDELAY>>8
.db ISTOP
; ---------------
; 'enter_menu_st'
; ---------------
enter_menu_st
ld a,BORDER_MENU
call set_border_color
ld hl,menu_code
call mach_start
ret
; ----------------
; 'update_menu_st'
; ----------------
update_menu_st
; Check keys.
call pollk
call anykey_options
ret c
call mach_update
jr nz,update_menu_st_timeout
ret
update_menu_st_timeout
ld a,STATE_ATTRACT
call set_state
ret
| 29.51145 | 78 | 0.619245 | [
"MIT"
] | jorgicor/altair | menu_st.asm | 3,866 | Assembly |
; A121240: Numerator of sum_{k=1..n} 1/2^prime(k).
; Submitted by Christian Krause
; 1,3,13,53,849,3397,54353,217413,3478609,222630977,890523909,56993530177,911896482833,3647585931333,58361374901329,3735127993685057,239048191595843649,956192766383374597,61196337048535974209
seq $0,40 ; The prime numbers.
sub $0,1
seq $0,72762 ; n coded as binary word of length=n with k-th bit set iff k is prime (1<=k<=n), decimal value.
| 53.125 | 191 | 0.778824 | [
"Apache-2.0"
] | ckrause/loda-programs | oeis/121/A121240.asm | 425 | Assembly |
.ktext 0x4180
_entry:
mfc0 $k0, $14
mfc0 $k1, $13
ori $k0, $0, 0x1000
sw $sp, -4($k0)
addiu $k0, $k0, -256
move $sp, $k0
j _save_context
nop
_main_handler:
mfc0 $k0, $13
ori $k1, $0, 0x007c
and $k0, $k1, $k0
beq $0, $k0, _restore_context
nop
mfc0 $k0, $14
addu $k0, $k0, 4
mtc0 $k0, $14
j _restore_context
nop
_restore:
eret
_save_context:
sw $1, 4($sp)
sw $2, 8($sp)
sw $3, 12($sp)
sw $4, 16($sp)
sw $5, 20($sp)
sw $6, 24($sp)
sw $7, 28($sp)
sw $8, 32($sp)
sw $9, 36($sp)
sw $10, 40($sp)
sw $11, 44($sp)
sw $12, 48($sp)
sw $13, 52($sp)
sw $14, 56($sp)
sw $15, 60($sp)
sw $16, 64($sp)
sw $17, 68($sp)
sw $18, 72($sp)
sw $19, 76($sp)
sw $20, 80($sp)
sw $21, 84($sp)
sw $22, 88($sp)
sw $23, 92($sp)
sw $24, 96($sp)
sw $25, 100($sp)
sw $26, 104($sp)
sw $27, 108($sp)
sw $28, 112($sp)
sw $29, 116($sp)
sw $30, 120($sp)
sw $31, 124($sp)
mfhi $k0
sw $k0, 128($sp)
mflo $k0
sw $k0, 132($sp)
j _main_handler
nop
_restore_context:
lw $1, 4($sp)
lw $2, 8($sp)
lw $3, 12($sp)
lw $4, 16($sp)
lw $5, 20($sp)
lw $6, 24($sp)
lw $7, 28($sp)
lw $8, 32($sp)
lw $9, 36($sp)
lw $10, 40($sp)
lw $11, 44($sp)
lw $12, 48($sp)
lw $13, 52($sp)
lw $14, 56($sp)
lw $15, 60($sp)
lw $16, 64($sp)
lw $17, 68($sp)
lw $18, 72($sp)
lw $19, 76($sp)
lw $20, 80($sp)
lw $21, 84($sp)
lw $22, 88($sp)
lw $23, 92($sp)
lw $24, 96($sp)
lw $25, 100($sp)
lw $26, 104($sp)
lw $27, 108($sp)
lw $28, 112($sp)
lw $29, 116($sp)
lw $30, 120($sp)
lw $31, 124($sp)
lw $k0, 128($sp)
mthi $k0
lw $k0, 132($sp)
mtlo $k0
j _restore
nop
.text
ori $2, $0, 0x1001
mtc0 $2, $12
ori $28, $0, 0x0000
ori $29, $0, 0x0000
lui $8, 0x7fff
lui $9, 0x7fff
add $10, $8, $9
or $10, $8, $9
end:
beq $0, $0, end
nop
| 19.152 | 31 | 0.380952 | [
"MIT"
] | JJLeo/BUAA-CO-2020 | Verilog/P7/P7_L0_weak/P7_L0_exception/P7_L0_weak_exception.asm | 2,394 | Assembly |
map_header CopycatsHouse2F, COPYCATS_HOUSE_2F, REDS_HOUSE_2, 0
end_map_header
| 20.25 | 63 | 0.851852 | [
"CC0-1.0"
] | opiter09/ASM-Machina | data/maps/headers/CopycatsHouse2F.asm | 81 | Assembly |
;++
;
; Copyright (c) Microsoft Corporation. All rights reserved.
;
; Licensed under the MIT License.
;
; Module Name:
;
; SconvKernelFma3.asm
;
; Abstract:
;
; This module implements the kernels for the single precision convolution
; operation.
;
; This implementation uses AVX fused multiply/add instructions.
;
;--
.xlist
INCLUDE mlasi.inc
INCLUDE SconvKernelAvxCommon.inc
.list
;
; Share the post process functions with the AVX implementation.
;
IRP FilterCount, <1, 2, 3, 4>
IRP OutputCount, <1, 2, 3>
EXTERN MlasConvPostProcessFloatFma3Filter&FilterCount&Output&OutputCount:NEAR
ENDM
ENDM
;
; Macro Description:
;
; This macro multiplies and accumulates for FilterCount by OutputCount block
; of the output buffer.
;
; Arguments:
;
; KernelType - Supplies the type of kernel to be generated.
;
; FilterCount - Supplies the number of rows from the filter to process.
;
; OutputCount - Supplies the number of output blocks to produce.
;
; VectorOffset - Supplies the byte offset from the filter buffer to fetch
; elements.
;
; BroadcastOffset - Supplies the byte offset from the input buffer to fetch
; elements.
;
; Implicit Arguments:
;
; rcx - Supplies the address of the input buffer.
;
; rdx - Supplies the address of the filter buffer.
;
; rsi - Supplies the FilterStride parameter (see function description).
;
; rbx - Supplies the address of the filter buffer plus 2 * FilterStride.
;
; r9 - Supplies the StrideWidth parameter (see function description).
;
; ymm0-ymm11 - Supplies the block accumulators.
;
ComputeBlock MACRO KernelType, FilterCount, OutputCount, VectorOffset, BroadcastOffset
IFIDNI <KernelType>, <Depthwise>
vmovups ymm12,YMMWORD PTR [rdx]
EmitIfCountGE OutputCount, 1, <vfmadd231ps ymm0,ymm12,DWORD PTR [rcx]>
EmitIfCountGE OutputCount, 2, <vfmadd231ps ymm4,ymm12,DWORD PTR [rcx+r9]>
EmitIfCountGE OutputCount, 3, <vfmadd231ps ymm8,ymm12,DWORD PTR [rcx+r9*2]>
ELSE
EmitIfCountGE OutputCount, 1, <vbroadcastss ymm13,DWORD PTR [rcx+BroadcastOffset]>
EmitIfCountGE OutputCount, 2, <vbroadcastss ymm14,DWORD PTR [rcx+r9+BroadcastOffset]>
EmitIfCountGE OutputCount, 3, <vbroadcastss ymm15,DWORD PTR [rcx+r9*2+BroadcastOffset]>
IF OutputCount EQ 1
EmitIfCountGE FilterCount, 1, <vfmadd231ps ymm0,ymm13,YMMWORD PTR [rdx+VectorOffset]>
EmitIfCountGE FilterCount, 2, <vfmadd231ps ymm1,ymm13,YMMWORD PTR [rdx+rsi+VectorOffset]>
EmitIfCountGE FilterCount, 3, <vfmadd231ps ymm2,ymm13,YMMWORD PTR [rbx+VectorOffset]>
EmitIfCountGE FilterCount, 4, <vfmadd231ps ymm3,ymm13,YMMWORD PTR [rbx+rsi+VectorOffset]>
ELSE
EmitIfCountGE FilterCount, 1, <vmovups ymm12,YMMWORD PTR [rdx+VectorOffset]>
EmitIfCount2GE FilterCount, 1, OutputCount, 1, <vfmadd231ps ymm0,ymm13,ymm12>
EmitIfCount2GE FilterCount, 1, OutputCount, 2, <vfmadd231ps ymm4,ymm14,ymm12>
EmitIfCount2GE FilterCount, 1, OutputCount, 3, <vfmadd231ps ymm8,ymm15,ymm12>
EmitIfCountGE FilterCount, 2, <vmovups ymm12,YMMWORD PTR [rdx+rsi+VectorOffset]>
EmitIfCount2GE FilterCount, 2, OutputCount, 1, <vfmadd231ps ymm1,ymm13,ymm12>
EmitIfCount2GE FilterCount, 2, OutputCount, 2, <vfmadd231ps ymm5,ymm14,ymm12>
EmitIfCount2GE FilterCount, 2, OutputCount, 3, <vfmadd231ps ymm9,ymm15,ymm12>
EmitIfCountGE FilterCount, 3, <vmovups ymm12,YMMWORD PTR [rbx+VectorOffset]>
EmitIfCount2GE FilterCount, 3, OutputCount, 1, <vfmadd231ps ymm2,ymm13,ymm12>
EmitIfCount2GE FilterCount, 3, OutputCount, 2, <vfmadd231ps ymm6,ymm14,ymm12>
EmitIfCount2GE FilterCount, 3, OutputCount, 3, <vfmadd231ps ymm10,ymm15,ymm12>
EmitIfCountGE FilterCount, 4, <vmovups ymm12,YMMWORD PTR [rbx+rsi+VectorOffset]>
EmitIfCount2GE FilterCount, 4, OutputCount, 1, <vfmadd231ps ymm3,ymm13,ymm12>
EmitIfCount2GE FilterCount, 4, OutputCount, 2, <vfmadd231ps ymm7,ymm14,ymm12>
EmitIfCount2GE FilterCount, 4, OutputCount, 3, <vfmadd231ps ymm11,ymm15,ymm12>
ENDIF
ENDIF
ENDM
;
; Macro Description:
;
; This macro generates code to compute the convolution for a specified number
; of filter rows.
;
; Arguments:
;
; KernelFrame - Supplies the symbol name to access the convolution kernel
; stack.
;
; KernelType - Supplies the type of kernel to be generated.
;
; FilterCount - Supplies the number of rows from the filter to process.
;
; Implicit Arguments:
;
; rdi - Supplies the address of the input buffer.
;
; rsi - Supplies the FilterStride parameter (see function description) when
; KernelType!=Depthwise. Supplies the address of the filter buffer when
; KernelType=Depthwise.
;
; rbp - Supplies the DilationWidth parameter (see function description).
;
; r8 - Supplies the address of the output buffer.
;
; r9 - Supplies the StrideWidth parameter (see function description).
;
; r15 - Supplies the InputStride parameter (see function description).
;
ProcessFilterCountN MACRO KernelFrame, KernelType, FilterCount
LOCAL ProcessOutputCountLeftPad
LOCAL ProcessOutputCount
LOCAL ProcessNextOutputCountBy3
LOCAL ProcessRemainingOutputCount
LOCAL ProcessRemainingOutputCount1
LOCAL ProcessOutputCountRightPadAndRemaining
;
; Process the output blocks that include left padding.
;
mov r10,KernelFrame.OutputCountLeftPad[rsp]
test r10,r10
jz ProcessOutputCount
call MlasConv&KernelType&FloatSingleFma3Filter&FilterCount
;
; Process the output blocks that do not include any padding.
;
ProcessOutputCount:
mov r10,KernelFrame.OutputCount[rsp]
sub r10,3
jb ProcessRemainingOutputCount
ProcessNextOutputCountBy3:
ProcessOutputCountN Fma3, KernelFrame, KernelType, 8, FilterCount, 3
lea rax,[r9*2+r9]
add rdi,rax ; advance input by 3 elements
sub r10,3
jae ProcessNextOutputCountBy3
ProcessRemainingOutputCount:
add r10,3 ; correct for over-subtract above
jz ProcessOutputCountRightPadAndRemaining
cmp r10,2
jb ProcessOutputCountRightPadAndRemaining
ProcessOutputCountN Fma3, KernelFrame, KernelType, 8, FilterCount, 2
lea rdi,[rdi+r9*2] ; advance input by 2 elements
sub r10,2
;
; Process the output blocks that include right padding plus any remaining output
; blocks from above.
;
ProcessOutputCountRightPadAndRemaining:
add r10,KernelFrame.OutputCountRightPad[rsp]
jz ExitKernel
call MlasConv&KernelType&FloatSingleFma3Filter&FilterCount
ENDM
;
; Macro Description:
;
; This macro generates code to compute the convolution for a specified number
; of filter rows for a pointwise convolution.
;
; Arguments:
;
; FilterCount - Supplies the number of rows from the filter to process.
;
; Implicit Arguments:
;
; rdi - Supplies the address of the input buffer.
;
; rsi - Supplies the FilterStride parameter (see function description).
;
; rbp - Supplies the InputStride parameter (see function description).
;
; r8 - Supplies the address of the output buffer.
;
; r9 - Supplies the StrideWidth parameter (see function description).
;
; r10 - Supplies the OutputCount parameter (see function description).
;
; r12 - Supplies the address of the filter buffer.
;
ProcessPointwiseFilterCountN MACRO FilterCount
LOCAL ProcessNextOutputCountBy3
LOCAL ProcessRemainingOutputCount
LOCAL ProcessRemainingOutputCount1
sub r10,3
jb ProcessRemainingOutputCount
ProcessNextOutputCountBy3:
ProcessPointwiseOutputCountN Fma3, 8, FilterCount, 3
lea rax,[r9*2+r9]
add rdi,rax ; advance input by 3 elements
sub r10,3
jae ProcessNextOutputCountBy3
ProcessRemainingOutputCount:
add r10,3 ; correct for over-subtract above
jz ExitKernel
cmp r10,2
jb ProcessRemainingOutputCount1
ProcessPointwiseOutputCountN Fma3, 8, FilterCount, 2
jmp ExitKernel
ProcessRemainingOutputCount1:
ProcessPointwiseOutputCountN Fma3, 8, FilterCount, 1
ENDM
;
; Generate the convolution kernels.
;
SconvKernelFunction Nchw, 8, Fma3
SconvKernelFunction Nchwc, 8, Fma3, BiasFilter
SconvKernelDepthwiseFunction 8, Fma3
SconvKernelPointwiseFunction Fma3, BiasFilter
END
| 33.076046 | 97 | 0.702839 | [
"MIT"
] | 00mjk/nnfusion | thirdparty/mlas/lib/amd64/SconvKernelFma3.asm | 8,699 | Assembly |
; A006522: 4-dimensional analog of centered polygonal numbers. Also number of regions created by sides and diagonals of a convex n-gon in general position.
; 1,0,0,1,4,11,25,50,91,154,246,375,550,781,1079,1456,1925,2500,3196,4029,5016,6175,7525,9086,10879,12926,15250,17875,20826,24129,27811,31900,36425,41416,46904,52921,59500,66675,74481,82954,92131,102050,112750,124271,136654,149941,164175,179400,195661,213004,231476,251125,272000,294151,317629,342486,368775,396550,425866,456779,489346,523625,559675,597556,637329,679056,722800,768625,816596,866779,919241,974050,1031275,1090986,1153254,1218151,1285750,1356125,1429351,1505504,1584661,1666900,1752300
mov $2,$0
mov $3,$0
bin $0,2
sub $2,1
bin $3,4
sub $3,$2
add $0,$3
| 65.909091 | 500 | 0.795862 | [
"Apache-2.0"
] | ckrause/loda-programs | oeis/006/A006522.asm | 725 | Assembly |
SFX_Triangle3_2_Ch7:
unknownnoise0x20 2, 145, 40
unknownnoise0x20 0, 113, 24
endchannel
| 18.2 | 28 | 0.802198 | [
"MIT"
] | ETDV-TheVoid/pokemon-rgb-enhanced | audio/sfx/triangle3_2.asm | 91 | Assembly |
; A343949: Shortest distance from curve start to end along the segments of dragon curve expansion level n, and which is the diameter of the curve as a graph.
; Submitted by Jon Maiga
; 1,2,4,8,12,18,26,36,52,70,102,136,200,266,394,524,780,1038,1550,2064,3088,4114,6162,8212,12308,16406,24598,32792,49176,65562,98330,131100,196636,262174,393246,524320,786464,1048610,1572898,2097188,3145764,4194342,6291494,8388648,12582952,16777258,25165866,33554476,50331692,67108910,100663342,134217776,201326640,268435506,402653234,536870964,805306420,1073741878,1610612790,2147483704,3221225528,4294967354,6442451002,8589934652,12884901948,17179869246,25769803838,34359738432,51539607616
mov $6,$0
add $6,1
mov $8,$0
lpb $6
mov $0,$8
sub $6,1
sub $0,$6
mov $2,8
mov $5,1
lpb $0
sub $0,2
mov $3,$0
lpb $3
mov $4,$0
cmp $4,0
cmp $4,0
sub $3,$4
mul $3,2
add $5,$0
lpe
div $0,$2
bin $0,98090
add $0,$3
mul $5,2
lpe
add $7,$5
lpe
mov $0,$7
| 30.515152 | 491 | 0.695134 | [
"Apache-2.0"
] | ckrause/loda-programs | oeis/343/A343949.asm | 1,007 | Assembly |
; $Id: VMMAllA.asm $
;; @file
; VMM - All Contexts Assembly Routines.
;
;
; Copyright (C) 2009-2015 Oracle Corporation
;
; This file is part of VirtualBox Open Source Edition (OSE), as
; available from http://www.virtualbox.org. This file is free software;
; you can redistribute it and/or modify it under the terms of the GNU
; General Public License (GPL) as published by the Free Software
; Foundation, in version 2 as it comes in the "COPYING" file of the
; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
;
;*******************************************************************************
;* Header Files *
;*******************************************************************************
%include "VBox/asmdefs.mac"
;*******************************************************************************
;* Defined Constants And Macros *
;*******************************************************************************
%ifdef IN_RING3
%ifdef RT_ARCH_AMD64
%define VMM_TRASH_XMM_REGS
%endif
%endif
%ifdef IN_RING0
%ifdef RT_ARCH_AMD64
%ifdef RT_OS_WINDOWS
%define VMM_TRASH_XMM_REGS
%endif
%endif
%endif
%ifndef VMM_TRASH_XMM_REGS
%ifdef VBOX_WITH_KERNEL_USING_XMM
%define VMM_TRASH_XMM_REGS
%endif
%endif
BEGINCODE
;;
; Trashes the volatile XMM registers in the current ABI.
;
BEGINPROC VMMTrashVolatileXMMRegs
%ifdef VMM_TRASH_XMM_REGS
push xBP
mov xBP, xSP
; take whatever is on the stack.
and xSP, ~15
sub xSP, 80h
movdqa xmm0, [xSP + 0]
movdqa xmm1, [xSP + 010h]
movdqa xmm2, [xSP + 020h]
movdqa xmm3, [xSP + 030h]
movdqa xmm4, [xSP + 040h]
movdqa xmm5, [xSP + 050h]
%ifdef ASM_CALL64_GCC
movdqa xmm6, [xSP + 060h]
movdqa xmm7, [xSP + 070h]
movdqa xmm8, [xSP + 000h]
movdqa xmm9, [xSP + 010h]
movdqa xmm10,[xSP + 020h]
movdqa xmm11,[xSP + 030h]
movdqa xmm12,[xSP + 040h]
movdqa xmm13,[xSP + 050h]
movdqa xmm14,[xSP + 060h]
movdqa xmm15,[xSP + 070h]
%endif
leave
%endif ; VMM_TRASH_XMM_REGS
xor eax, eax ; for good measure.
ret
ENDPROC VMMTrashVolatileXMMRegs
| 28.928571 | 80 | 0.532922 | [
"MIT"
] | egraba/vbox_openbsd | VirtualBox-5.0.0/src/VBox/VMM/VMMAll/VMMAllA.asm | 2,430 | Assembly |
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r14
push %r15
push %r9
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_UC_ht+0xa08b, %rsi
lea addresses_WC_ht+0x1bb8b, %rdi
clflush (%rdi)
nop
nop
nop
nop
nop
and $60932, %r14
mov $28, %rcx
rep movsb
and $57821, %rbp
lea addresses_UC_ht+0x14287, %r15
nop
inc %r14
vmovups (%r15), %ymm2
vextracti128 $1, %ymm2, %xmm2
vpextrq $1, %xmm2, %rbp
nop
add %rcx, %rcx
lea addresses_WC_ht+0x608b, %rdi
nop
nop
nop
add %r9, %r9
mov (%rdi), %cx
nop
nop
nop
nop
nop
add %rcx, %rcx
lea addresses_UC_ht+0x1538b, %rdi
nop
nop
add %rcx, %rcx
mov $0x6162636465666768, %rbp
movq %rbp, %xmm6
vmovups %ymm6, (%rdi)
dec %rbp
lea addresses_UC_ht+0x16a8b, %r15
clflush (%r15)
nop
nop
nop
nop
nop
sub $49793, %rdi
movl $0x61626364, (%r15)
sub $45041, %r9
lea addresses_D_ht+0x52cb, %rcx
clflush (%rcx)
nop
nop
xor %rsi, %rsi
movups (%rcx), %xmm6
vpextrq $1, %xmm6, %r15
add $11204, %r15
lea addresses_WC_ht+0x1400b, %r15
nop
nop
nop
nop
nop
sub $13439, %rdi
mov $0x6162636465666768, %r14
movq %r14, %xmm6
vmovups %ymm6, (%r15)
nop
nop
nop
nop
and %rsi, %rsi
lea addresses_A_ht+0x18f0b, %rsi
lea addresses_D_ht+0x1ddf1, %rdi
nop
nop
xor $10944, %r10
mov $90, %rcx
rep movsw
xor $57191, %rsi
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r15
pop %r14
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r14
push %r15
push %r8
push %rax
push %rbp
// Store
lea addresses_D+0xcccb, %rax
nop
nop
nop
nop
nop
cmp $19626, %r15
mov $0x5152535455565758, %rbp
movq %rbp, %xmm0
vmovaps %ymm0, (%rax)
add %r14, %r14
// Faulty Load
lea addresses_WT+0x19f8b, %r15
and %r11, %r11
movups (%r15), %xmm6
vpextrq $1, %xmm6, %r10
lea oracles, %rax
and $0xff, %r10
shlq $12, %r10
mov (%rax,%r10,1), %r10
pop %rbp
pop %rax
pop %r8
pop %r15
pop %r14
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_WT', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 6, 'NT': True, 'type': 'addresses_D', 'size': 32, 'AVXalign': True}}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_WT', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 7, 'same': False}}
{'src': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_UC_ht', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_WC_ht', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 8, 'NT': False, 'type': 'addresses_UC_ht', 'size': 32, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_UC_ht', 'size': 4, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_D_ht', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_WC_ht', 'size': 32, 'AVXalign': False}}
{'src': {'type': 'addresses_A_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 1, 'same': False}}
{'39': 1299}
39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39
*/
| 38.993827 | 2,999 | 0.658224 | [
"MIT"
] | danielmgmi/medusa | Transynther/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_1299_961.asm | 6,317 | Assembly |
; A194142: Sum{floor(j*(3-sqrt(3)) : 1<=j<=n}; n-th partial sum of Beatty sequence for 3-sqrt(3).
; 1,3,6,11,17,24,32,42,53,65,78,93,109,126,145,165,186,208,232,257,283,310,339,369,400,432,466,501,537,575,614,654,695,738,782,827,873,921,970,1020,1071,1124,1178,1233,1290,1348,1407,1467,1529,1592,1656
mov $16,$0
mov $18,$0
add $18,1
lpb $18
clr $0,16
mov $0,$16
sub $18,1
sub $0,$18
mov $13,$0
mov $15,$0
add $15,1
lpb $15
mov $0,$13
sub $15,1
sub $0,$15
mov $9,$0
mov $11,2
lpb $11
sub $11,1
add $0,$11
sub $0,1
mov $1,$0
mul $1,4
add $1,4
div $1,15
mov $12,$11
lpb $12
mov $10,$1
sub $12,1
lpe
lpe
lpb $9
mov $9,0
sub $10,$1
lpe
mov $1,$10
add $1,1
add $14,$1
lpe
add $17,$14
lpe
mov $1,$17
| 18.478261 | 202 | 0.516471 | [
"Apache-2.0"
] | jmorken/loda | programs/oeis/194/A194142.asm | 850 | Assembly |
section .data
section .text
global _start
_start:
nop
; Put your experiments between the two nops...
; Put your experiments between the two nops...
nop | 17.222222 | 46 | 0.748387 | [
"MIT"
] | ash1247/DocumentsWindows | assembly/asmsbs3e/chapter11/movsbdemo/newsandbox.asm | 155 | Assembly |
[XCX_QTE_SPEED_ALL] #################################################################################################
moduleMatches = 0xF882D5CF, 0x30B6E091, 0xAB97DE6B ; 1.0.1E, 1.0.2U, 1.0.1U
; ----------------------------------------------------------------------------
; WHO : SoulVoice::CSoulVoice::getDifficulty((void))
; WHAT : QTE speed does not increase
0x022078D4 = li r3, 1
| 48.625 | 117 | 0.393316 | [
"CC0-1.0"
] | ActualMandM/cemu_graphic_packs | src/XenobladeChroniclesX/Mods/BattleQteSpeed/patch_qte_speed.asm | 389 | Assembly |
; A107857: a(n) = floor[(phi + n mod 2)*a(n-1)], a(1)=1.
; Submitted by Jamie Morken(s1)
; 1,1,2,3,7,11,28,45,117,189,494,799,2091,3383,8856,14329,37513,60697,158906,257115,673135,1089155,2851444,4613733,12078909,19544085,51167078,82790071,216747219,350704367,918155952,1485607537,3889371025
mul $0,3
div $0,2
mov $2,1
lpb $0
sub $0,2
add $1,$2
add $2,$1
lpe
lpb $0
div $0,8
add $2,$1
lpe
mov $0,$2
div $0,2
add $0,1
| 21.4 | 202 | 0.675234 | [
"Apache-2.0"
] | ckrause/loda-programs | oeis/107/A107857.asm | 428 | 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.
;
EXPORT |vp8_sub_pixel_variance8x8_neon|
ARM
REQUIRE8
PRESERVE8
AREA ||.text||, CODE, READONLY, ALIGN=2
; r0 unsigned char *src_ptr,
; r1 int src_pixels_per_line,
; r2 int xoffset,
; r3 int yoffset,
; stack(r4) unsigned char *dst_ptr,
; stack(r5) int dst_pixels_per_line,
; stack(r6) unsigned int *sse
;note: most of the code is copied from bilinear_predict8x8_neon and vp8_variance8x8_neon.
|vp8_sub_pixel_variance8x8_neon| PROC
push {r4-r5, lr}
ldr r12, _BilinearTaps_coeff_
ldr r4, [sp, #12] ;load *dst_ptr from stack
ldr r5, [sp, #16] ;load dst_pixels_per_line from stack
ldr lr, [sp, #20] ;load *sse from stack
cmp r2, #0 ;skip first_pass filter if xoffset=0
beq skip_firstpass_filter
;First pass: output_height lines x output_width columns (9x8)
add r2, r12, r2, lsl #3 ;calculate filter location
vld1.u8 {q1}, [r0], r1 ;load src data
vld1.u32 {d31}, [r2] ;load first_pass filter
vld1.u8 {q2}, [r0], r1
vdup.8 d0, d31[0] ;first_pass filter (d0 d1)
vld1.u8 {q3}, [r0], r1
vdup.8 d1, d31[4]
vld1.u8 {q4}, [r0], r1
vmull.u8 q6, d2, d0 ;(src_ptr[0] * Filter[0])
vmull.u8 q7, d4, d0
vmull.u8 q8, d6, d0
vmull.u8 q9, d8, d0
vext.8 d3, d2, d3, #1 ;construct src_ptr[-1]
vext.8 d5, d4, d5, #1
vext.8 d7, d6, d7, #1
vext.8 d9, d8, d9, #1
vmlal.u8 q6, d3, d1 ;(src_ptr[1] * Filter[1])
vmlal.u8 q7, d5, d1
vmlal.u8 q8, d7, d1
vmlal.u8 q9, d9, d1
vld1.u8 {q1}, [r0], r1 ;load src data
vqrshrn.u16 d22, q6, #7 ;shift/round/saturate to u8
vld1.u8 {q2}, [r0], r1
vqrshrn.u16 d23, q7, #7
vld1.u8 {q3}, [r0], r1
vqrshrn.u16 d24, q8, #7
vld1.u8 {q4}, [r0], r1
vqrshrn.u16 d25, q9, #7
;first_pass filtering on the rest 5-line data
vld1.u8 {q5}, [r0], r1
vmull.u8 q6, d2, d0 ;(src_ptr[0] * Filter[0])
vmull.u8 q7, d4, d0
vmull.u8 q8, d6, d0
vmull.u8 q9, d8, d0
vmull.u8 q10, d10, d0
vext.8 d3, d2, d3, #1 ;construct src_ptr[-1]
vext.8 d5, d4, d5, #1
vext.8 d7, d6, d7, #1
vext.8 d9, d8, d9, #1
vext.8 d11, d10, d11, #1
vmlal.u8 q6, d3, d1 ;(src_ptr[1] * Filter[1])
vmlal.u8 q7, d5, d1
vmlal.u8 q8, d7, d1
vmlal.u8 q9, d9, d1
vmlal.u8 q10, d11, d1
vqrshrn.u16 d26, q6, #7 ;shift/round/saturate to u8
vqrshrn.u16 d27, q7, #7
vqrshrn.u16 d28, q8, #7
vqrshrn.u16 d29, q9, #7
vqrshrn.u16 d30, q10, #7
;Second pass: 8x8
secondpass_filter
cmp r3, #0 ;skip second_pass filter if yoffset=0
;skip_secondpass_filter
beq sub_pixel_variance8x8_neon
add r3, r12, r3, lsl #3
vld1.u32 {d31}, [r3] ;load second_pass filter
vdup.8 d0, d31[0] ;second_pass filter parameters (d0 d1)
vdup.8 d1, d31[4]
vmull.u8 q1, d22, d0 ;(src_ptr[0] * Filter[0])
vmull.u8 q2, d23, d0
vmull.u8 q3, d24, d0
vmull.u8 q4, d25, d0
vmull.u8 q5, d26, d0
vmull.u8 q6, d27, d0
vmull.u8 q7, d28, d0
vmull.u8 q8, d29, d0
vmlal.u8 q1, d23, d1 ;(src_ptr[pixel_step] * Filter[1])
vmlal.u8 q2, d24, d1
vmlal.u8 q3, d25, d1
vmlal.u8 q4, d26, d1
vmlal.u8 q5, d27, d1
vmlal.u8 q6, d28, d1
vmlal.u8 q7, d29, d1
vmlal.u8 q8, d30, d1
vqrshrn.u16 d22, q1, #7 ;shift/round/saturate to u8
vqrshrn.u16 d23, q2, #7
vqrshrn.u16 d24, q3, #7
vqrshrn.u16 d25, q4, #7
vqrshrn.u16 d26, q5, #7
vqrshrn.u16 d27, q6, #7
vqrshrn.u16 d28, q7, #7
vqrshrn.u16 d29, q8, #7
b sub_pixel_variance8x8_neon
;--------------------
skip_firstpass_filter
vld1.u8 {d22}, [r0], r1 ;load src data
vld1.u8 {d23}, [r0], r1
vld1.u8 {d24}, [r0], r1
vld1.u8 {d25}, [r0], r1
vld1.u8 {d26}, [r0], r1
vld1.u8 {d27}, [r0], r1
vld1.u8 {d28}, [r0], r1
vld1.u8 {d29}, [r0], r1
vld1.u8 {d30}, [r0], r1
b secondpass_filter
;----------------------
;vp8_variance8x8_neon
sub_pixel_variance8x8_neon
vmov.i8 q8, #0 ;q8 - sum
vmov.i8 q9, #0 ;q9, q10 - sse
vmov.i8 q10, #0
mov r12, #2
sub_pixel_variance8x8_neon_loop
vld1.8 {d0}, [r4], r5 ;load dst data
subs r12, r12, #1
vld1.8 {d1}, [r4], r5
vld1.8 {d2}, [r4], r5
vsubl.u8 q4, d22, d0 ;calculate diff
vld1.8 {d3}, [r4], r5
vsubl.u8 q5, d23, d1
vsubl.u8 q6, d24, d2
vpadal.s16 q8, q4 ;sum
vmlal.s16 q9, d8, d8 ;sse
vmlal.s16 q10, d9, d9
vsubl.u8 q7, d25, d3
vpadal.s16 q8, q5
vmlal.s16 q9, d10, d10
vmlal.s16 q10, d11, d11
vmov q11, q13
vpadal.s16 q8, q6
vmlal.s16 q9, d12, d12
vmlal.s16 q10, d13, d13
vmov q12, q14
vpadal.s16 q8, q7
vmlal.s16 q9, d14, d14
vmlal.s16 q10, d15, d15
bne sub_pixel_variance8x8_neon_loop
vadd.u32 q10, q9, q10 ;accumulate sse
vpaddl.s32 q0, q8 ;accumulate sum
vpaddl.u32 q1, q10
vadd.s64 d0, d0, d1
vadd.u64 d1, d2, d3
vmull.s32 q5, d0, d0
vst1.32 {d1[0]}, [lr] ;store sse
vshr.s32 d10, d10, #6
vsub.s32 d0, d1, d10
vmov.32 r0, d0[0] ;return
pop {r4-r5, pc}
ENDP
;-----------------
_BilinearTaps_coeff_
DCD bilinear_taps_coeff
bilinear_taps_coeff
DCD 128, 0, 112, 16, 96, 32, 80, 48, 64, 64, 48, 80, 32, 96, 16, 112
END
| 31.591111 | 89 | 0.478334 | [
"BSD-3-Clause"
] | awatry/libvpx.opencl | vp8/encoder/arm/neon/vp8_subpixelvariance8x8_neon.asm | 7,108 | Assembly |
* Sprite f4
*
* Mode 4
* +|-------+
* -ggg g -
* |g g g |
* |g g g |
* |gg gggg|
* |g g |
* |g g |
* |g g |
* +|-------+
*
section sprite
xdef sp_f4
xref sp_zero
sp_f4
dc.w $0100,$0000
dc.w 8,7,0,0
dc.l sc4_f4-*
dc.l sp_zero-*
dc.l 0
sc4_f4
dc.w $E800,$0000
dc.w $8A00,$0000
dc.w $8A00,$0000
dc.w $CF00,$0000
dc.w $8200,$0000
dc.w $8200,$0000
dc.w $8200,$0000
*
end
| 12.121212 | 17 | 0.5 | [
"BSD-2-Clause"
] | olifink/smsqe | iod/con2/sprite/f4.asm | 400 | Assembly |
user/_mkdir: file format elf64-littleriscv
Disassembly of section .text:
0000000000000000 <main>:
#include "kernel/stat.h"
#include "user/user.h"
int
main(int argc, char *argv[])
{
0: 7179 addi sp,sp,-48
2: f406 sd ra,40(sp)
4: f022 sd s0,32(sp)
6: ec26 sd s1,24(sp)
8: e84a sd s2,16(sp)
a: e44e sd s3,8(sp)
c: 1800 addi s0,sp,48
int i;
if(argc < 2){
e: 4785 li a5,1
10: 02a7d763 bge a5,a0,3e <main+0x3e>
14: 00858493 addi s1,a1,8
18: ffe5091b addiw s2,a0,-2
1c: 1902 slli s2,s2,0x20
1e: 02095913 srli s2,s2,0x20
22: 090e slli s2,s2,0x3
24: 05c1 addi a1,a1,16
26: 992e add s2,s2,a1
fprintf(2, "Usage: mkdir files...\n");
exit(1);
}
for(i = 1; i < argc; i++){
if(mkdir(argv[i]) < 0){
28: 6088 ld a0,0(s1)
2a: 00000097 auipc ra,0x0
2e: 32c080e7 jalr 812(ra) # 356 <mkdir>
32: 02054463 bltz a0,5a <main+0x5a>
for(i = 1; i < argc; i++){
36: 04a1 addi s1,s1,8
38: ff2498e3 bne s1,s2,28 <main+0x28>
3c: a80d j 6e <main+0x6e>
fprintf(2, "Usage: mkdir files...\n");
3e: 00000597 auipc a1,0x0
42: 7da58593 addi a1,a1,2010 # 818 <malloc+0xe4>
46: 4509 li a0,2
48: 00000097 auipc ra,0x0
4c: 600080e7 jalr 1536(ra) # 648 <fprintf>
exit(1);
50: 4505 li a0,1
52: 00000097 auipc ra,0x0
56: 29c080e7 jalr 668(ra) # 2ee <exit>
fprintf(2, "mkdir: %s failed to create\n", argv[i]);
5a: 6090 ld a2,0(s1)
5c: 00000597 auipc a1,0x0
60: 7d458593 addi a1,a1,2004 # 830 <malloc+0xfc>
64: 4509 li a0,2
66: 00000097 auipc ra,0x0
6a: 5e2080e7 jalr 1506(ra) # 648 <fprintf>
break;
}
}
exit(0);
6e: 4501 li a0,0
70: 00000097 auipc ra,0x0
74: 27e080e7 jalr 638(ra) # 2ee <exit>
0000000000000078 <strcpy>:
#include "kernel/fcntl.h"
#include "user/user.h"
char*
strcpy(char *s, const char *t)
{
78: 1141 addi sp,sp,-16
7a: e422 sd s0,8(sp)
7c: 0800 addi s0,sp,16
char *os;
os = s;
while((*s++ = *t++) != 0)
7e: 87aa mv a5,a0
80: 0585 addi a1,a1,1
82: 0785 addi a5,a5,1
84: fff5c703 lbu a4,-1(a1)
88: fee78fa3 sb a4,-1(a5)
8c: fb75 bnez a4,80 <strcpy+0x8>
;
return os;
}
8e: 6422 ld s0,8(sp)
90: 0141 addi sp,sp,16
92: 8082 ret
0000000000000094 <strcmp>:
int
strcmp(const char *p, const char *q)
{
94: 1141 addi sp,sp,-16
96: e422 sd s0,8(sp)
98: 0800 addi s0,sp,16
while(*p && *p == *q)
9a: 00054783 lbu a5,0(a0)
9e: cb91 beqz a5,b2 <strcmp+0x1e>
a0: 0005c703 lbu a4,0(a1)
a4: 00f71763 bne a4,a5,b2 <strcmp+0x1e>
p++, q++;
a8: 0505 addi a0,a0,1
aa: 0585 addi a1,a1,1
while(*p && *p == *q)
ac: 00054783 lbu a5,0(a0)
b0: fbe5 bnez a5,a0 <strcmp+0xc>
return (uchar)*p - (uchar)*q;
b2: 0005c503 lbu a0,0(a1)
}
b6: 40a7853b subw a0,a5,a0
ba: 6422 ld s0,8(sp)
bc: 0141 addi sp,sp,16
be: 8082 ret
00000000000000c0 <strlen>:
uint
strlen(const char *s)
{
c0: 1141 addi sp,sp,-16
c2: e422 sd s0,8(sp)
c4: 0800 addi s0,sp,16
int n;
for(n = 0; s[n]; n++)
c6: 00054783 lbu a5,0(a0)
ca: cf91 beqz a5,e6 <strlen+0x26>
cc: 0505 addi a0,a0,1
ce: 87aa mv a5,a0
d0: 4685 li a3,1
d2: 9e89 subw a3,a3,a0
d4: 00f6853b addw a0,a3,a5
d8: 0785 addi a5,a5,1
da: fff7c703 lbu a4,-1(a5)
de: fb7d bnez a4,d4 <strlen+0x14>
;
return n;
}
e0: 6422 ld s0,8(sp)
e2: 0141 addi sp,sp,16
e4: 8082 ret
for(n = 0; s[n]; n++)
e6: 4501 li a0,0
e8: bfe5 j e0 <strlen+0x20>
00000000000000ea <memset>:
void*
memset(void *dst, int c, uint n)
{
ea: 1141 addi sp,sp,-16
ec: e422 sd s0,8(sp)
ee: 0800 addi s0,sp,16
char *cdst = (char *) dst;
int i;
for(i = 0; i < n; i++){
f0: ce09 beqz a2,10a <memset+0x20>
f2: 87aa mv a5,a0
f4: fff6071b addiw a4,a2,-1
f8: 1702 slli a4,a4,0x20
fa: 9301 srli a4,a4,0x20
fc: 0705 addi a4,a4,1
fe: 972a add a4,a4,a0
cdst[i] = c;
100: 00b78023 sb a1,0(a5)
for(i = 0; i < n; i++){
104: 0785 addi a5,a5,1
106: fee79de3 bne a5,a4,100 <memset+0x16>
}
return dst;
}
10a: 6422 ld s0,8(sp)
10c: 0141 addi sp,sp,16
10e: 8082 ret
0000000000000110 <strchr>:
char*
strchr(const char *s, char c)
{
110: 1141 addi sp,sp,-16
112: e422 sd s0,8(sp)
114: 0800 addi s0,sp,16
for(; *s; s++)
116: 00054783 lbu a5,0(a0)
11a: cb99 beqz a5,130 <strchr+0x20>
if(*s == c)
11c: 00f58763 beq a1,a5,12a <strchr+0x1a>
for(; *s; s++)
120: 0505 addi a0,a0,1
122: 00054783 lbu a5,0(a0)
126: fbfd bnez a5,11c <strchr+0xc>
return (char*)s;
return 0;
128: 4501 li a0,0
}
12a: 6422 ld s0,8(sp)
12c: 0141 addi sp,sp,16
12e: 8082 ret
return 0;
130: 4501 li a0,0
132: bfe5 j 12a <strchr+0x1a>
0000000000000134 <gets>:
char*
gets(char *buf, int max)
{
134: 711d addi sp,sp,-96
136: ec86 sd ra,88(sp)
138: e8a2 sd s0,80(sp)
13a: e4a6 sd s1,72(sp)
13c: e0ca sd s2,64(sp)
13e: fc4e sd s3,56(sp)
140: f852 sd s4,48(sp)
142: f456 sd s5,40(sp)
144: f05a sd s6,32(sp)
146: ec5e sd s7,24(sp)
148: 1080 addi s0,sp,96
14a: 8baa mv s7,a0
14c: 8a2e mv s4,a1
int i, cc;
char c;
for(i=0; i+1 < max; ){
14e: 892a mv s2,a0
150: 4481 li s1,0
cc = read(0, &c, 1);
if(cc < 1)
break;
buf[i++] = c;
if(c == '\n' || c == '\r')
152: 4aa9 li s5,10
154: 4b35 li s6,13
for(i=0; i+1 < max; ){
156: 89a6 mv s3,s1
158: 2485 addiw s1,s1,1
15a: 0344d863 bge s1,s4,18a <gets+0x56>
cc = read(0, &c, 1);
15e: 4605 li a2,1
160: faf40593 addi a1,s0,-81
164: 4501 li a0,0
166: 00000097 auipc ra,0x0
16a: 1a0080e7 jalr 416(ra) # 306 <read>
if(cc < 1)
16e: 00a05e63 blez a0,18a <gets+0x56>
buf[i++] = c;
172: faf44783 lbu a5,-81(s0)
176: 00f90023 sb a5,0(s2)
if(c == '\n' || c == '\r')
17a: 01578763 beq a5,s5,188 <gets+0x54>
17e: 0905 addi s2,s2,1
180: fd679be3 bne a5,s6,156 <gets+0x22>
for(i=0; i+1 < max; ){
184: 89a6 mv s3,s1
186: a011 j 18a <gets+0x56>
188: 89a6 mv s3,s1
break;
}
buf[i] = '\0';
18a: 99de add s3,s3,s7
18c: 00098023 sb zero,0(s3)
return buf;
}
190: 855e mv a0,s7
192: 60e6 ld ra,88(sp)
194: 6446 ld s0,80(sp)
196: 64a6 ld s1,72(sp)
198: 6906 ld s2,64(sp)
19a: 79e2 ld s3,56(sp)
19c: 7a42 ld s4,48(sp)
19e: 7aa2 ld s5,40(sp)
1a0: 7b02 ld s6,32(sp)
1a2: 6be2 ld s7,24(sp)
1a4: 6125 addi sp,sp,96
1a6: 8082 ret
00000000000001a8 <stat>:
int
stat(const char *n, struct stat *st)
{
1a8: 1101 addi sp,sp,-32
1aa: ec06 sd ra,24(sp)
1ac: e822 sd s0,16(sp)
1ae: e426 sd s1,8(sp)
1b0: e04a sd s2,0(sp)
1b2: 1000 addi s0,sp,32
1b4: 892e mv s2,a1
int fd;
int r;
fd = open(n, O_RDONLY);
1b6: 4581 li a1,0
1b8: 00000097 auipc ra,0x0
1bc: 176080e7 jalr 374(ra) # 32e <open>
if(fd < 0)
1c0: 02054563 bltz a0,1ea <stat+0x42>
1c4: 84aa mv s1,a0
return -1;
r = fstat(fd, st);
1c6: 85ca mv a1,s2
1c8: 00000097 auipc ra,0x0
1cc: 17e080e7 jalr 382(ra) # 346 <fstat>
1d0: 892a mv s2,a0
close(fd);
1d2: 8526 mv a0,s1
1d4: 00000097 auipc ra,0x0
1d8: 142080e7 jalr 322(ra) # 316 <close>
return r;
}
1dc: 854a mv a0,s2
1de: 60e2 ld ra,24(sp)
1e0: 6442 ld s0,16(sp)
1e2: 64a2 ld s1,8(sp)
1e4: 6902 ld s2,0(sp)
1e6: 6105 addi sp,sp,32
1e8: 8082 ret
return -1;
1ea: 597d li s2,-1
1ec: bfc5 j 1dc <stat+0x34>
00000000000001ee <atoi>:
int
atoi(const char *s)
{
1ee: 1141 addi sp,sp,-16
1f0: e422 sd s0,8(sp)
1f2: 0800 addi s0,sp,16
int n;
n = 0;
while('0' <= *s && *s <= '9')
1f4: 00054603 lbu a2,0(a0)
1f8: fd06079b addiw a5,a2,-48
1fc: 0ff7f793 andi a5,a5,255
200: 4725 li a4,9
202: 02f76963 bltu a4,a5,234 <atoi+0x46>
206: 86aa mv a3,a0
n = 0;
208: 4501 li a0,0
while('0' <= *s && *s <= '9')
20a: 45a5 li a1,9
n = n*10 + *s++ - '0';
20c: 0685 addi a3,a3,1
20e: 0025179b slliw a5,a0,0x2
212: 9fa9 addw a5,a5,a0
214: 0017979b slliw a5,a5,0x1
218: 9fb1 addw a5,a5,a2
21a: fd07851b addiw a0,a5,-48
while('0' <= *s && *s <= '9')
21e: 0006c603 lbu a2,0(a3)
222: fd06071b addiw a4,a2,-48
226: 0ff77713 andi a4,a4,255
22a: fee5f1e3 bgeu a1,a4,20c <atoi+0x1e>
return n;
}
22e: 6422 ld s0,8(sp)
230: 0141 addi sp,sp,16
232: 8082 ret
n = 0;
234: 4501 li a0,0
236: bfe5 j 22e <atoi+0x40>
0000000000000238 <memmove>:
void*
memmove(void *vdst, const void *vsrc, int n)
{
238: 1141 addi sp,sp,-16
23a: e422 sd s0,8(sp)
23c: 0800 addi s0,sp,16
char *dst;
const char *src;
dst = vdst;
src = vsrc;
if (src > dst) {
23e: 02b57663 bgeu a0,a1,26a <memmove+0x32>
while(n-- > 0)
242: 02c05163 blez a2,264 <memmove+0x2c>
246: fff6079b addiw a5,a2,-1
24a: 1782 slli a5,a5,0x20
24c: 9381 srli a5,a5,0x20
24e: 0785 addi a5,a5,1
250: 97aa add a5,a5,a0
dst = vdst;
252: 872a mv a4,a0
*dst++ = *src++;
254: 0585 addi a1,a1,1
256: 0705 addi a4,a4,1
258: fff5c683 lbu a3,-1(a1)
25c: fed70fa3 sb a3,-1(a4)
while(n-- > 0)
260: fee79ae3 bne a5,a4,254 <memmove+0x1c>
src += n;
while(n-- > 0)
*--dst = *--src;
}
return vdst;
}
264: 6422 ld s0,8(sp)
266: 0141 addi sp,sp,16
268: 8082 ret
dst += n;
26a: 00c50733 add a4,a0,a2
src += n;
26e: 95b2 add a1,a1,a2
while(n-- > 0)
270: fec05ae3 blez a2,264 <memmove+0x2c>
274: fff6079b addiw a5,a2,-1
278: 1782 slli a5,a5,0x20
27a: 9381 srli a5,a5,0x20
27c: fff7c793 not a5,a5
280: 97ba add a5,a5,a4
*--dst = *--src;
282: 15fd addi a1,a1,-1
284: 177d addi a4,a4,-1
286: 0005c683 lbu a3,0(a1)
28a: 00d70023 sb a3,0(a4)
while(n-- > 0)
28e: fee79ae3 bne a5,a4,282 <memmove+0x4a>
292: bfc9 j 264 <memmove+0x2c>
0000000000000294 <memcmp>:
int
memcmp(const void *s1, const void *s2, uint n)
{
294: 1141 addi sp,sp,-16
296: e422 sd s0,8(sp)
298: 0800 addi s0,sp,16
const char *p1 = s1, *p2 = s2;
while (n-- > 0) {
29a: ca05 beqz a2,2ca <memcmp+0x36>
29c: fff6069b addiw a3,a2,-1
2a0: 1682 slli a3,a3,0x20
2a2: 9281 srli a3,a3,0x20
2a4: 0685 addi a3,a3,1
2a6: 96aa add a3,a3,a0
if (*p1 != *p2) {
2a8: 00054783 lbu a5,0(a0)
2ac: 0005c703 lbu a4,0(a1)
2b0: 00e79863 bne a5,a4,2c0 <memcmp+0x2c>
return *p1 - *p2;
}
p1++;
2b4: 0505 addi a0,a0,1
p2++;
2b6: 0585 addi a1,a1,1
while (n-- > 0) {
2b8: fed518e3 bne a0,a3,2a8 <memcmp+0x14>
}
return 0;
2bc: 4501 li a0,0
2be: a019 j 2c4 <memcmp+0x30>
return *p1 - *p2;
2c0: 40e7853b subw a0,a5,a4
}
2c4: 6422 ld s0,8(sp)
2c6: 0141 addi sp,sp,16
2c8: 8082 ret
return 0;
2ca: 4501 li a0,0
2cc: bfe5 j 2c4 <memcmp+0x30>
00000000000002ce <memcpy>:
void *
memcpy(void *dst, const void *src, uint n)
{
2ce: 1141 addi sp,sp,-16
2d0: e406 sd ra,8(sp)
2d2: e022 sd s0,0(sp)
2d4: 0800 addi s0,sp,16
return memmove(dst, src, n);
2d6: 00000097 auipc ra,0x0
2da: f62080e7 jalr -158(ra) # 238 <memmove>
}
2de: 60a2 ld ra,8(sp)
2e0: 6402 ld s0,0(sp)
2e2: 0141 addi sp,sp,16
2e4: 8082 ret
00000000000002e6 <fork>:
# generated by usys.pl - do not edit
#include "kernel/syscall.h"
.global fork
fork:
li a7, SYS_fork
2e6: 4885 li a7,1
ecall
2e8: 00000073 ecall
ret
2ec: 8082 ret
00000000000002ee <exit>:
.global exit
exit:
li a7, SYS_exit
2ee: 4889 li a7,2
ecall
2f0: 00000073 ecall
ret
2f4: 8082 ret
00000000000002f6 <wait>:
.global wait
wait:
li a7, SYS_wait
2f6: 488d li a7,3
ecall
2f8: 00000073 ecall
ret
2fc: 8082 ret
00000000000002fe <pipe>:
.global pipe
pipe:
li a7, SYS_pipe
2fe: 4891 li a7,4
ecall
300: 00000073 ecall
ret
304: 8082 ret
0000000000000306 <read>:
.global read
read:
li a7, SYS_read
306: 4895 li a7,5
ecall
308: 00000073 ecall
ret
30c: 8082 ret
000000000000030e <write>:
.global write
write:
li a7, SYS_write
30e: 48c1 li a7,16
ecall
310: 00000073 ecall
ret
314: 8082 ret
0000000000000316 <close>:
.global close
close:
li a7, SYS_close
316: 48d5 li a7,21
ecall
318: 00000073 ecall
ret
31c: 8082 ret
000000000000031e <kill>:
.global kill
kill:
li a7, SYS_kill
31e: 4899 li a7,6
ecall
320: 00000073 ecall
ret
324: 8082 ret
0000000000000326 <exec>:
.global exec
exec:
li a7, SYS_exec
326: 489d li a7,7
ecall
328: 00000073 ecall
ret
32c: 8082 ret
000000000000032e <open>:
.global open
open:
li a7, SYS_open
32e: 48bd li a7,15
ecall
330: 00000073 ecall
ret
334: 8082 ret
0000000000000336 <mknod>:
.global mknod
mknod:
li a7, SYS_mknod
336: 48c5 li a7,17
ecall
338: 00000073 ecall
ret
33c: 8082 ret
000000000000033e <unlink>:
.global unlink
unlink:
li a7, SYS_unlink
33e: 48c9 li a7,18
ecall
340: 00000073 ecall
ret
344: 8082 ret
0000000000000346 <fstat>:
.global fstat
fstat:
li a7, SYS_fstat
346: 48a1 li a7,8
ecall
348: 00000073 ecall
ret
34c: 8082 ret
000000000000034e <link>:
.global link
link:
li a7, SYS_link
34e: 48cd li a7,19
ecall
350: 00000073 ecall
ret
354: 8082 ret
0000000000000356 <mkdir>:
.global mkdir
mkdir:
li a7, SYS_mkdir
356: 48d1 li a7,20
ecall
358: 00000073 ecall
ret
35c: 8082 ret
000000000000035e <chdir>:
.global chdir
chdir:
li a7, SYS_chdir
35e: 48a5 li a7,9
ecall
360: 00000073 ecall
ret
364: 8082 ret
0000000000000366 <dup>:
.global dup
dup:
li a7, SYS_dup
366: 48a9 li a7,10
ecall
368: 00000073 ecall
ret
36c: 8082 ret
000000000000036e <getpid>:
.global getpid
getpid:
li a7, SYS_getpid
36e: 48ad li a7,11
ecall
370: 00000073 ecall
ret
374: 8082 ret
0000000000000376 <sbrk>:
.global sbrk
sbrk:
li a7, SYS_sbrk
376: 48b1 li a7,12
ecall
378: 00000073 ecall
ret
37c: 8082 ret
000000000000037e <sleep>:
.global sleep
sleep:
li a7, SYS_sleep
37e: 48b5 li a7,13
ecall
380: 00000073 ecall
ret
384: 8082 ret
0000000000000386 <uptime>:
.global uptime
uptime:
li a7, SYS_uptime
386: 48b9 li a7,14
ecall
388: 00000073 ecall
ret
38c: 8082 ret
000000000000038e <connect>:
.global connect
connect:
li a7, SYS_connect
38e: 48d9 li a7,22
ecall
390: 00000073 ecall
ret
394: 8082 ret
0000000000000396 <ntas>:
.global ntas
ntas:
li a7, SYS_ntas
396: 48dd li a7,23
ecall
398: 00000073 ecall
ret
39c: 8082 ret
000000000000039e <putc>:
static char digits[] = "0123456789ABCDEF";
static void
putc(int fd, char c)
{
39e: 1101 addi sp,sp,-32
3a0: ec06 sd ra,24(sp)
3a2: e822 sd s0,16(sp)
3a4: 1000 addi s0,sp,32
3a6: feb407a3 sb a1,-17(s0)
write(fd, &c, 1);
3aa: 4605 li a2,1
3ac: fef40593 addi a1,s0,-17
3b0: 00000097 auipc ra,0x0
3b4: f5e080e7 jalr -162(ra) # 30e <write>
}
3b8: 60e2 ld ra,24(sp)
3ba: 6442 ld s0,16(sp)
3bc: 6105 addi sp,sp,32
3be: 8082 ret
00000000000003c0 <printint>:
static void
printint(int fd, int xx, int base, int sgn)
{
3c0: 7139 addi sp,sp,-64
3c2: fc06 sd ra,56(sp)
3c4: f822 sd s0,48(sp)
3c6: f426 sd s1,40(sp)
3c8: f04a sd s2,32(sp)
3ca: ec4e sd s3,24(sp)
3cc: 0080 addi s0,sp,64
3ce: 84aa mv s1,a0
char buf[16];
int i, neg;
uint x;
neg = 0;
if(sgn && xx < 0){
3d0: c299 beqz a3,3d6 <printint+0x16>
3d2: 0805c863 bltz a1,462 <printint+0xa2>
neg = 1;
x = -xx;
} else {
x = xx;
3d6: 2581 sext.w a1,a1
neg = 0;
3d8: 4881 li a7,0
3da: fc040693 addi a3,s0,-64
}
i = 0;
3de: 4701 li a4,0
do{
buf[i++] = digits[x % base];
3e0: 2601 sext.w a2,a2
3e2: 00000517 auipc a0,0x0
3e6: 47650513 addi a0,a0,1142 # 858 <digits>
3ea: 883a mv a6,a4
3ec: 2705 addiw a4,a4,1
3ee: 02c5f7bb remuw a5,a1,a2
3f2: 1782 slli a5,a5,0x20
3f4: 9381 srli a5,a5,0x20
3f6: 97aa add a5,a5,a0
3f8: 0007c783 lbu a5,0(a5)
3fc: 00f68023 sb a5,0(a3)
}while((x /= base) != 0);
400: 0005879b sext.w a5,a1
404: 02c5d5bb divuw a1,a1,a2
408: 0685 addi a3,a3,1
40a: fec7f0e3 bgeu a5,a2,3ea <printint+0x2a>
if(neg)
40e: 00088b63 beqz a7,424 <printint+0x64>
buf[i++] = '-';
412: fd040793 addi a5,s0,-48
416: 973e add a4,a4,a5
418: 02d00793 li a5,45
41c: fef70823 sb a5,-16(a4)
420: 0028071b addiw a4,a6,2
while(--i >= 0)
424: 02e05863 blez a4,454 <printint+0x94>
428: fc040793 addi a5,s0,-64
42c: 00e78933 add s2,a5,a4
430: fff78993 addi s3,a5,-1
434: 99ba add s3,s3,a4
436: 377d addiw a4,a4,-1
438: 1702 slli a4,a4,0x20
43a: 9301 srli a4,a4,0x20
43c: 40e989b3 sub s3,s3,a4
putc(fd, buf[i]);
440: fff94583 lbu a1,-1(s2)
444: 8526 mv a0,s1
446: 00000097 auipc ra,0x0
44a: f58080e7 jalr -168(ra) # 39e <putc>
while(--i >= 0)
44e: 197d addi s2,s2,-1
450: ff3918e3 bne s2,s3,440 <printint+0x80>
}
454: 70e2 ld ra,56(sp)
456: 7442 ld s0,48(sp)
458: 74a2 ld s1,40(sp)
45a: 7902 ld s2,32(sp)
45c: 69e2 ld s3,24(sp)
45e: 6121 addi sp,sp,64
460: 8082 ret
x = -xx;
462: 40b005bb negw a1,a1
neg = 1;
466: 4885 li a7,1
x = -xx;
468: bf8d j 3da <printint+0x1a>
000000000000046a <vprintf>:
}
// Print to the given fd. Only understands %d, %x, %p, %s.
void
vprintf(int fd, const char *fmt, va_list ap)
{
46a: 7119 addi sp,sp,-128
46c: fc86 sd ra,120(sp)
46e: f8a2 sd s0,112(sp)
470: f4a6 sd s1,104(sp)
472: f0ca sd s2,96(sp)
474: ecce sd s3,88(sp)
476: e8d2 sd s4,80(sp)
478: e4d6 sd s5,72(sp)
47a: e0da sd s6,64(sp)
47c: fc5e sd s7,56(sp)
47e: f862 sd s8,48(sp)
480: f466 sd s9,40(sp)
482: f06a sd s10,32(sp)
484: ec6e sd s11,24(sp)
486: 0100 addi s0,sp,128
char *s;
int c, i, state;
state = 0;
for(i = 0; fmt[i]; i++){
488: 0005c903 lbu s2,0(a1)
48c: 18090f63 beqz s2,62a <vprintf+0x1c0>
490: 8aaa mv s5,a0
492: 8b32 mv s6,a2
494: 00158493 addi s1,a1,1
state = 0;
498: 4981 li s3,0
if(c == '%'){
state = '%';
} else {
putc(fd, c);
}
} else if(state == '%'){
49a: 02500a13 li s4,37
if(c == 'd'){
49e: 06400c13 li s8,100
printint(fd, va_arg(ap, int), 10, 1);
} else if(c == 'l') {
4a2: 06c00c93 li s9,108
printint(fd, va_arg(ap, uint64), 10, 0);
} else if(c == 'x') {
4a6: 07800d13 li s10,120
printint(fd, va_arg(ap, int), 16, 0);
} else if(c == 'p') {
4aa: 07000d93 li s11,112
putc(fd, digits[x >> (sizeof(uint64) * 8 - 4)]);
4ae: 00000b97 auipc s7,0x0
4b2: 3aab8b93 addi s7,s7,938 # 858 <digits>
4b6: a839 j 4d4 <vprintf+0x6a>
putc(fd, c);
4b8: 85ca mv a1,s2
4ba: 8556 mv a0,s5
4bc: 00000097 auipc ra,0x0
4c0: ee2080e7 jalr -286(ra) # 39e <putc>
4c4: a019 j 4ca <vprintf+0x60>
} else if(state == '%'){
4c6: 01498f63 beq s3,s4,4e4 <vprintf+0x7a>
for(i = 0; fmt[i]; i++){
4ca: 0485 addi s1,s1,1
4cc: fff4c903 lbu s2,-1(s1)
4d0: 14090d63 beqz s2,62a <vprintf+0x1c0>
c = fmt[i] & 0xff;
4d4: 0009079b sext.w a5,s2
if(state == 0){
4d8: fe0997e3 bnez s3,4c6 <vprintf+0x5c>
if(c == '%'){
4dc: fd479ee3 bne a5,s4,4b8 <vprintf+0x4e>
state = '%';
4e0: 89be mv s3,a5
4e2: b7e5 j 4ca <vprintf+0x60>
if(c == 'd'){
4e4: 05878063 beq a5,s8,524 <vprintf+0xba>
} else if(c == 'l') {
4e8: 05978c63 beq a5,s9,540 <vprintf+0xd6>
} else if(c == 'x') {
4ec: 07a78863 beq a5,s10,55c <vprintf+0xf2>
} else if(c == 'p') {
4f0: 09b78463 beq a5,s11,578 <vprintf+0x10e>
printptr(fd, va_arg(ap, uint64));
} else if(c == 's'){
4f4: 07300713 li a4,115
4f8: 0ce78663 beq a5,a4,5c4 <vprintf+0x15a>
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
4fc: 06300713 li a4,99
500: 0ee78e63 beq a5,a4,5fc <vprintf+0x192>
putc(fd, va_arg(ap, uint));
} else if(c == '%'){
504: 11478863 beq a5,s4,614 <vprintf+0x1aa>
putc(fd, c);
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
508: 85d2 mv a1,s4
50a: 8556 mv a0,s5
50c: 00000097 auipc ra,0x0
510: e92080e7 jalr -366(ra) # 39e <putc>
putc(fd, c);
514: 85ca mv a1,s2
516: 8556 mv a0,s5
518: 00000097 auipc ra,0x0
51c: e86080e7 jalr -378(ra) # 39e <putc>
}
state = 0;
520: 4981 li s3,0
522: b765 j 4ca <vprintf+0x60>
printint(fd, va_arg(ap, int), 10, 1);
524: 008b0913 addi s2,s6,8
528: 4685 li a3,1
52a: 4629 li a2,10
52c: 000b2583 lw a1,0(s6)
530: 8556 mv a0,s5
532: 00000097 auipc ra,0x0
536: e8e080e7 jalr -370(ra) # 3c0 <printint>
53a: 8b4a mv s6,s2
state = 0;
53c: 4981 li s3,0
53e: b771 j 4ca <vprintf+0x60>
printint(fd, va_arg(ap, uint64), 10, 0);
540: 008b0913 addi s2,s6,8
544: 4681 li a3,0
546: 4629 li a2,10
548: 000b2583 lw a1,0(s6)
54c: 8556 mv a0,s5
54e: 00000097 auipc ra,0x0
552: e72080e7 jalr -398(ra) # 3c0 <printint>
556: 8b4a mv s6,s2
state = 0;
558: 4981 li s3,0
55a: bf85 j 4ca <vprintf+0x60>
printint(fd, va_arg(ap, int), 16, 0);
55c: 008b0913 addi s2,s6,8
560: 4681 li a3,0
562: 4641 li a2,16
564: 000b2583 lw a1,0(s6)
568: 8556 mv a0,s5
56a: 00000097 auipc ra,0x0
56e: e56080e7 jalr -426(ra) # 3c0 <printint>
572: 8b4a mv s6,s2
state = 0;
574: 4981 li s3,0
576: bf91 j 4ca <vprintf+0x60>
printptr(fd, va_arg(ap, uint64));
578: 008b0793 addi a5,s6,8
57c: f8f43423 sd a5,-120(s0)
580: 000b3983 ld s3,0(s6)
putc(fd, '0');
584: 03000593 li a1,48
588: 8556 mv a0,s5
58a: 00000097 auipc ra,0x0
58e: e14080e7 jalr -492(ra) # 39e <putc>
putc(fd, 'x');
592: 85ea mv a1,s10
594: 8556 mv a0,s5
596: 00000097 auipc ra,0x0
59a: e08080e7 jalr -504(ra) # 39e <putc>
59e: 4941 li s2,16
putc(fd, digits[x >> (sizeof(uint64) * 8 - 4)]);
5a0: 03c9d793 srli a5,s3,0x3c
5a4: 97de add a5,a5,s7
5a6: 0007c583 lbu a1,0(a5)
5aa: 8556 mv a0,s5
5ac: 00000097 auipc ra,0x0
5b0: df2080e7 jalr -526(ra) # 39e <putc>
for (i = 0; i < (sizeof(uint64) * 2); i++, x <<= 4)
5b4: 0992 slli s3,s3,0x4
5b6: 397d addiw s2,s2,-1
5b8: fe0914e3 bnez s2,5a0 <vprintf+0x136>
printptr(fd, va_arg(ap, uint64));
5bc: f8843b03 ld s6,-120(s0)
state = 0;
5c0: 4981 li s3,0
5c2: b721 j 4ca <vprintf+0x60>
s = va_arg(ap, char*);
5c4: 008b0993 addi s3,s6,8
5c8: 000b3903 ld s2,0(s6)
if(s == 0)
5cc: 02090163 beqz s2,5ee <vprintf+0x184>
while(*s != 0){
5d0: 00094583 lbu a1,0(s2)
5d4: c9a1 beqz a1,624 <vprintf+0x1ba>
putc(fd, *s);
5d6: 8556 mv a0,s5
5d8: 00000097 auipc ra,0x0
5dc: dc6080e7 jalr -570(ra) # 39e <putc>
s++;
5e0: 0905 addi s2,s2,1
while(*s != 0){
5e2: 00094583 lbu a1,0(s2)
5e6: f9e5 bnez a1,5d6 <vprintf+0x16c>
s = va_arg(ap, char*);
5e8: 8b4e mv s6,s3
state = 0;
5ea: 4981 li s3,0
5ec: bdf9 j 4ca <vprintf+0x60>
s = "(null)";
5ee: 00000917 auipc s2,0x0
5f2: 26290913 addi s2,s2,610 # 850 <malloc+0x11c>
while(*s != 0){
5f6: 02800593 li a1,40
5fa: bff1 j 5d6 <vprintf+0x16c>
putc(fd, va_arg(ap, uint));
5fc: 008b0913 addi s2,s6,8
600: 000b4583 lbu a1,0(s6)
604: 8556 mv a0,s5
606: 00000097 auipc ra,0x0
60a: d98080e7 jalr -616(ra) # 39e <putc>
60e: 8b4a mv s6,s2
state = 0;
610: 4981 li s3,0
612: bd65 j 4ca <vprintf+0x60>
putc(fd, c);
614: 85d2 mv a1,s4
616: 8556 mv a0,s5
618: 00000097 auipc ra,0x0
61c: d86080e7 jalr -634(ra) # 39e <putc>
state = 0;
620: 4981 li s3,0
622: b565 j 4ca <vprintf+0x60>
s = va_arg(ap, char*);
624: 8b4e mv s6,s3
state = 0;
626: 4981 li s3,0
628: b54d j 4ca <vprintf+0x60>
}
}
}
62a: 70e6 ld ra,120(sp)
62c: 7446 ld s0,112(sp)
62e: 74a6 ld s1,104(sp)
630: 7906 ld s2,96(sp)
632: 69e6 ld s3,88(sp)
634: 6a46 ld s4,80(sp)
636: 6aa6 ld s5,72(sp)
638: 6b06 ld s6,64(sp)
63a: 7be2 ld s7,56(sp)
63c: 7c42 ld s8,48(sp)
63e: 7ca2 ld s9,40(sp)
640: 7d02 ld s10,32(sp)
642: 6de2 ld s11,24(sp)
644: 6109 addi sp,sp,128
646: 8082 ret
0000000000000648 <fprintf>:
void
fprintf(int fd, const char *fmt, ...)
{
648: 715d addi sp,sp,-80
64a: ec06 sd ra,24(sp)
64c: e822 sd s0,16(sp)
64e: 1000 addi s0,sp,32
650: e010 sd a2,0(s0)
652: e414 sd a3,8(s0)
654: e818 sd a4,16(s0)
656: ec1c sd a5,24(s0)
658: 03043023 sd a6,32(s0)
65c: 03143423 sd a7,40(s0)
va_list ap;
va_start(ap, fmt);
660: fe843423 sd s0,-24(s0)
vprintf(fd, fmt, ap);
664: 8622 mv a2,s0
666: 00000097 auipc ra,0x0
66a: e04080e7 jalr -508(ra) # 46a <vprintf>
}
66e: 60e2 ld ra,24(sp)
670: 6442 ld s0,16(sp)
672: 6161 addi sp,sp,80
674: 8082 ret
0000000000000676 <printf>:
void
printf(const char *fmt, ...)
{
676: 711d addi sp,sp,-96
678: ec06 sd ra,24(sp)
67a: e822 sd s0,16(sp)
67c: 1000 addi s0,sp,32
67e: e40c sd a1,8(s0)
680: e810 sd a2,16(s0)
682: ec14 sd a3,24(s0)
684: f018 sd a4,32(s0)
686: f41c sd a5,40(s0)
688: 03043823 sd a6,48(s0)
68c: 03143c23 sd a7,56(s0)
va_list ap;
va_start(ap, fmt);
690: 00840613 addi a2,s0,8
694: fec43423 sd a2,-24(s0)
vprintf(1, fmt, ap);
698: 85aa mv a1,a0
69a: 4505 li a0,1
69c: 00000097 auipc ra,0x0
6a0: dce080e7 jalr -562(ra) # 46a <vprintf>
}
6a4: 60e2 ld ra,24(sp)
6a6: 6442 ld s0,16(sp)
6a8: 6125 addi sp,sp,96
6aa: 8082 ret
00000000000006ac <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
6ac: 1141 addi sp,sp,-16
6ae: e422 sd s0,8(sp)
6b0: 0800 addi s0,sp,16
Header *bp, *p;
bp = (Header*)ap - 1;
6b2: ff050693 addi a3,a0,-16
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
6b6: 00000797 auipc a5,0x0
6ba: 1ba7b783 ld a5,442(a5) # 870 <freep>
6be: a805 j 6ee <free+0x42>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
break;
if(bp + bp->s.size == p->s.ptr){
bp->s.size += p->s.ptr->s.size;
6c0: 4618 lw a4,8(a2)
6c2: 9db9 addw a1,a1,a4
6c4: feb52c23 sw a1,-8(a0)
bp->s.ptr = p->s.ptr->s.ptr;
6c8: 6398 ld a4,0(a5)
6ca: 6318 ld a4,0(a4)
6cc: fee53823 sd a4,-16(a0)
6d0: a091 j 714 <free+0x68>
} else
bp->s.ptr = p->s.ptr;
if(p + p->s.size == bp){
p->s.size += bp->s.size;
6d2: ff852703 lw a4,-8(a0)
6d6: 9e39 addw a2,a2,a4
6d8: c790 sw a2,8(a5)
p->s.ptr = bp->s.ptr;
6da: ff053703 ld a4,-16(a0)
6de: e398 sd a4,0(a5)
6e0: a099 j 726 <free+0x7a>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
6e2: 6398 ld a4,0(a5)
6e4: 00e7e463 bltu a5,a4,6ec <free+0x40>
6e8: 00e6ea63 bltu a3,a4,6fc <free+0x50>
{
6ec: 87ba mv a5,a4
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
6ee: fed7fae3 bgeu a5,a3,6e2 <free+0x36>
6f2: 6398 ld a4,0(a5)
6f4: 00e6e463 bltu a3,a4,6fc <free+0x50>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
6f8: fee7eae3 bltu a5,a4,6ec <free+0x40>
if(bp + bp->s.size == p->s.ptr){
6fc: ff852583 lw a1,-8(a0)
700: 6390 ld a2,0(a5)
702: 02059713 slli a4,a1,0x20
706: 9301 srli a4,a4,0x20
708: 0712 slli a4,a4,0x4
70a: 9736 add a4,a4,a3
70c: fae60ae3 beq a2,a4,6c0 <free+0x14>
bp->s.ptr = p->s.ptr;
710: fec53823 sd a2,-16(a0)
if(p + p->s.size == bp){
714: 4790 lw a2,8(a5)
716: 02061713 slli a4,a2,0x20
71a: 9301 srli a4,a4,0x20
71c: 0712 slli a4,a4,0x4
71e: 973e add a4,a4,a5
720: fae689e3 beq a3,a4,6d2 <free+0x26>
} else
p->s.ptr = bp;
724: e394 sd a3,0(a5)
freep = p;
726: 00000717 auipc a4,0x0
72a: 14f73523 sd a5,330(a4) # 870 <freep>
}
72e: 6422 ld s0,8(sp)
730: 0141 addi sp,sp,16
732: 8082 ret
0000000000000734 <malloc>:
return freep;
}
void*
malloc(uint nbytes)
{
734: 7139 addi sp,sp,-64
736: fc06 sd ra,56(sp)
738: f822 sd s0,48(sp)
73a: f426 sd s1,40(sp)
73c: f04a sd s2,32(sp)
73e: ec4e sd s3,24(sp)
740: e852 sd s4,16(sp)
742: e456 sd s5,8(sp)
744: e05a sd s6,0(sp)
746: 0080 addi s0,sp,64
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
748: 02051493 slli s1,a0,0x20
74c: 9081 srli s1,s1,0x20
74e: 04bd addi s1,s1,15
750: 8091 srli s1,s1,0x4
752: 0014899b addiw s3,s1,1
756: 0485 addi s1,s1,1
if((prevp = freep) == 0){
758: 00000517 auipc a0,0x0
75c: 11853503 ld a0,280(a0) # 870 <freep>
760: c515 beqz a0,78c <malloc+0x58>
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
762: 611c ld a5,0(a0)
if(p->s.size >= nunits){
764: 4798 lw a4,8(a5)
766: 02977f63 bgeu a4,s1,7a4 <malloc+0x70>
76a: 8a4e mv s4,s3
76c: 0009871b sext.w a4,s3
770: 6685 lui a3,0x1
772: 00d77363 bgeu a4,a3,778 <malloc+0x44>
776: 6a05 lui s4,0x1
778: 000a0b1b sext.w s6,s4
p = sbrk(nu * sizeof(Header));
77c: 004a1a1b slliw s4,s4,0x4
p->s.size = nunits;
}
freep = prevp;
return (void*)(p + 1);
}
if(p == freep)
780: 00000917 auipc s2,0x0
784: 0f090913 addi s2,s2,240 # 870 <freep>
if(p == (char*)-1)
788: 5afd li s5,-1
78a: a88d j 7fc <malloc+0xc8>
base.s.ptr = freep = prevp = &base;
78c: 00000797 auipc a5,0x0
790: 0ec78793 addi a5,a5,236 # 878 <base>
794: 00000717 auipc a4,0x0
798: 0cf73e23 sd a5,220(a4) # 870 <freep>
79c: e39c sd a5,0(a5)
base.s.size = 0;
79e: 0007a423 sw zero,8(a5)
if(p->s.size >= nunits){
7a2: b7e1 j 76a <malloc+0x36>
if(p->s.size == nunits)
7a4: 02e48b63 beq s1,a4,7da <malloc+0xa6>
p->s.size -= nunits;
7a8: 4137073b subw a4,a4,s3
7ac: c798 sw a4,8(a5)
p += p->s.size;
7ae: 1702 slli a4,a4,0x20
7b0: 9301 srli a4,a4,0x20
7b2: 0712 slli a4,a4,0x4
7b4: 97ba add a5,a5,a4
p->s.size = nunits;
7b6: 0137a423 sw s3,8(a5)
freep = prevp;
7ba: 00000717 auipc a4,0x0
7be: 0aa73b23 sd a0,182(a4) # 870 <freep>
return (void*)(p + 1);
7c2: 01078513 addi a0,a5,16
if((p = morecore(nunits)) == 0)
return 0;
}
}
7c6: 70e2 ld ra,56(sp)
7c8: 7442 ld s0,48(sp)
7ca: 74a2 ld s1,40(sp)
7cc: 7902 ld s2,32(sp)
7ce: 69e2 ld s3,24(sp)
7d0: 6a42 ld s4,16(sp)
7d2: 6aa2 ld s5,8(sp)
7d4: 6b02 ld s6,0(sp)
7d6: 6121 addi sp,sp,64
7d8: 8082 ret
prevp->s.ptr = p->s.ptr;
7da: 6398 ld a4,0(a5)
7dc: e118 sd a4,0(a0)
7de: bff1 j 7ba <malloc+0x86>
hp->s.size = nu;
7e0: 01652423 sw s6,8(a0)
free((void*)(hp + 1));
7e4: 0541 addi a0,a0,16
7e6: 00000097 auipc ra,0x0
7ea: ec6080e7 jalr -314(ra) # 6ac <free>
return freep;
7ee: 00093503 ld a0,0(s2)
if((p = morecore(nunits)) == 0)
7f2: d971 beqz a0,7c6 <malloc+0x92>
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
7f4: 611c ld a5,0(a0)
if(p->s.size >= nunits){
7f6: 4798 lw a4,8(a5)
7f8: fa9776e3 bgeu a4,s1,7a4 <malloc+0x70>
if(p == freep)
7fc: 00093703 ld a4,0(s2)
800: 853e mv a0,a5
802: fef719e3 bne a4,a5,7f4 <malloc+0xc0>
p = sbrk(nu * sizeof(Header));
806: 8552 mv a0,s4
808: 00000097 auipc ra,0x0
80c: b6e080e7 jalr -1170(ra) # 376 <sbrk>
if(p == (char*)-1)
810: fd5518e3 bne a0,s5,7e0 <malloc+0xac>
return 0;
814: 4501 li a0,0
816: bf45 j 7c6 <malloc+0x92>
| 29.498908 | 60 | 0.459903 | [
"MIT-0"
] | eric-qian-d/TCP | user/mkdir.asm | 40,502 | Assembly |
; Listing generated by Microsoft (R) Optimizing Compiler Version 19.16.27026.1
TITLE Z:\Sources\Lunor\Repos\rougemeilland\Palmtree.Math.Core.Implements\Palmtree.Math.Core.Implements\TEST_op_BitwiseAnd.c
.686P
.XMM
include listing.inc
.model flat
INCLUDELIB MSVCRT
INCLUDELIB OLDNAMES
END
| 22.846154 | 124 | 0.808081 | [
"MIT"
] | rougemeilland/Palmtree.Math.Core.Implements | Palmtree.Math.Core.Implements/vs_build/x86_Release/TEST_op_BitwiseAnd.asm | 297 | Assembly |
###############################################################################
# Copyright 2019 Intel Corporation
# All Rights Reserved.
#
# If this software was obtained under the Intel Simplified Software License,
# the following terms apply:
#
# The source code, information and material ("Material") contained herein is
# owned by Intel Corporation or its suppliers or licensors, and title to such
# Material remains with Intel Corporation or its suppliers or licensors. The
# Material contains proprietary information of Intel or its suppliers and
# licensors. The Material is protected by worldwide copyright laws and treaty
# provisions. No part of the Material may be used, copied, reproduced,
# modified, published, uploaded, posted, transmitted, distributed or disclosed
# in any way without Intel's prior express written permission. No license under
# any patent, copyright or other intellectual property rights in the Material
# is granted to or conferred upon you, either expressly, by implication,
# inducement, estoppel or otherwise. Any license under such intellectual
# property rights must be express and approved by Intel in writing.
#
# Unless otherwise agreed by Intel in writing, you may not remove or alter this
# notice or any other notice embedded in Materials by Intel or Intel's
# suppliers or licensors in any way.
#
#
# If this software was obtained under the Apache License, Version 2.0 (the
# "License"), the following terms apply:
#
# You may not use this file except in compliance with the License. You may
# obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################
.text
.p2align 4, 0x90
ENCODE_DATA:
u128_str:
.byte 15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0
increment:
.quad 1,0
.p2align 4, 0x90
.globl _AuthEncrypt_RIJ128_AES_NI
_AuthEncrypt_RIJ128_AES_NI:
push %ebp
mov %esp, %ebp
push %ebx
push %esi
push %edi
movl (28)(%ebp), %eax
movdqa (%eax), %xmm0
movdqa (16)(%eax), %xmm2
movdqa (32)(%eax), %xmm1
call .L__0000gas_1
.L__0000gas_1:
pop %eax
sub $(.L__0000gas_1-ENCODE_DATA), %eax
movdqa ((u128_str-ENCODE_DATA))(%eax), %xmm7
pshufb %xmm7, %xmm2
pshufb %xmm7, %xmm1
movdqa %xmm1, %xmm3
pandn %xmm2, %xmm3
pand %xmm1, %xmm2
movl (16)(%ebp), %edx
movl (20)(%ebp), %ecx
lea (,%edx,4), %edx
lea (,%edx,4), %edx
lea (%edx,%ecx), %ecx
neg %edx
mov %edx, %ebx
movl (8)(%ebp), %esi
movl (12)(%ebp), %edi
.p2align 4, 0x90
.Lblk_loopgas_1:
movdqu (%esi), %xmm4
pxor %xmm4, %xmm0
movdqa %xmm3, %xmm5
paddq ((increment-ENCODE_DATA))(%eax), %xmm2
pand %xmm1, %xmm2
por %xmm2, %xmm5
pshufb %xmm7, %xmm5
movdqa (%edx,%ecx), %xmm6
add $(16), %edx
pxor %xmm6, %xmm5
pxor %xmm6, %xmm0
movdqa (%edx,%ecx), %xmm6
.p2align 4, 0x90
.Lcipher_loopgas_1:
aesenc %xmm6, %xmm5
aesenc %xmm6, %xmm0
movdqa (16)(%edx,%ecx), %xmm6
add $(16), %edx
jnz .Lcipher_loopgas_1
aesenclast %xmm6, %xmm5
aesenclast %xmm6, %xmm0
pxor %xmm5, %xmm4
movdqu %xmm4, (%edi)
mov %ebx, %edx
add $(16), %esi
add $(16), %edi
subl $(16), (24)(%ebp)
jnz .Lblk_loopgas_1
movl (28)(%ebp), %eax
movdqu %xmm0, (%eax)
movdqu %xmm5, (16)(%eax)
pop %edi
pop %esi
pop %ebx
pop %ebp
ret
.p2align 4, 0x90
.globl _DecryptAuth_RIJ128_AES_NI
_DecryptAuth_RIJ128_AES_NI:
push %ebp
mov %esp, %ebp
push %ebx
push %esi
push %edi
movl (28)(%ebp), %eax
movdqa (%eax), %xmm0
movdqa (16)(%eax), %xmm2
movdqa (32)(%eax), %xmm1
call .L__0001gas_2
.L__0001gas_2:
pop %eax
sub $(.L__0001gas_2-ENCODE_DATA), %eax
movdqa ((u128_str-ENCODE_DATA))(%eax), %xmm7
pshufb %xmm7, %xmm2
pshufb %xmm7, %xmm1
movdqa %xmm1, %xmm3
pandn %xmm2, %xmm3
pand %xmm1, %xmm2
movl (16)(%ebp), %edx
movl (20)(%ebp), %ecx
lea (,%edx,4), %edx
lea (,%edx,4), %edx
lea (%edx,%ecx), %ecx
neg %edx
mov %edx, %ebx
movl (8)(%ebp), %esi
movl (12)(%ebp), %edi
.p2align 4, 0x90
.Lblk_loopgas_2:
movdqu (%esi), %xmm4
movdqa %xmm3, %xmm5
paddq ((increment-ENCODE_DATA))(%eax), %xmm2
pand %xmm1, %xmm2
por %xmm2, %xmm5
pshufb %xmm7, %xmm5
movdqa (%edx,%ecx), %xmm6
add $(16), %edx
pxor %xmm6, %xmm5
movdqa (%edx,%ecx), %xmm6
.p2align 4, 0x90
.Lcipher_loopgas_2:
aesenc %xmm6, %xmm5
movdqa (16)(%edx,%ecx), %xmm6
add $(16), %edx
jnz .Lcipher_loopgas_2
aesenclast %xmm6, %xmm5
pxor %xmm5, %xmm4
movdqu %xmm4, (%edi)
mov %ebx, %edx
movdqa (%edx,%ecx), %xmm6
add $(16), %edx
pxor %xmm4, %xmm0
pxor %xmm6, %xmm0
movdqa (%edx,%ecx), %xmm6
.p2align 4, 0x90
.Lauth_loopgas_2:
aesenc %xmm6, %xmm0
movdqa (16)(%edx,%ecx), %xmm6
add $(16), %edx
jnz .Lauth_loopgas_2
aesenclast %xmm6, %xmm0
mov %ebx, %edx
add $(16), %esi
add $(16), %edi
subl $(16), (24)(%ebp)
jnz .Lblk_loopgas_2
movl (28)(%ebp), %eax
movdqu %xmm0, (%eax)
movdqu %xmm6, (16)(%eax)
pop %edi
pop %esi
pop %ebx
pop %ebp
ret
| 31.884615 | 80 | 0.520959 | [
"Apache-2.0"
] | ymarkovitch/ipp-crypto | sources/ippcp/asm_ia32_gas_converted/macosx/p8/singlecpu/pcprij128ccmg9as.asm | 6,632 | Assembly |
sty $ff
cpx $ff
bcc {la1} | 8.333333 | 9 | 0.64 | [
"MIT"
] | jbrandwood/kickc | src/main/fragment/mos6502-common/vbuxx_lt_vbuyy_then_la1.asm | 25 | Assembly |
; A266956: Numbers m such that 9*m+7 is a square.
; 1,2,18,21,53,58,106,113,177,186,266,277,373,386,498,513,641,658,802,821,981,1002,1178,1201,1393,1418,1626,1653,1877,1906,2146,2177,2433,2466,2738,2773,3061,3098,3402,3441,3761,3802,4138,4181,4533,4578,4946,4993,5377,5426
seq $0,156638 ; Numbers n such that n^2 + 2 == 0 (mod 9).
pow $0,2
div $0,9
| 50 | 222 | 0.714286 | [
"Apache-2.0"
] | ckrause/cm | programs/oeis/266/A266956.asm | 350 | Assembly |
;/*!
; @file
;
; @ingroup fapi
;
; @brief DosDelete DOS wrapper
;
; (c) osFree Project 2018, <http://www.osFree.org>
; for licence see licence.txt in root directory, or project website
;
; This is Family API implementation for DOS, used with BIND tools
; to link required API
;
; @author Yuri Prokushev ([email protected])
;
; @todo add filename check
;
;--------D-2141-------------------------------
;INT 21 - DOS 2+ - "UNLINK" - DELETE FILE
; AH = 41h
; DS:DX -> ASCIZ filename (no wildcards, but see notes)
; CL = attribute mask for deletion (server call only, see notes)
;Return: CF clear if successful
; AX destroyed (DOS 3.3) AL seems to be drive of deleted file
; CF set on error
; AX = error code (02h,03h,05h) (see #01680 at AH=59h/BX=0000h)
;Notes: (DOS 3.1+) wildcards are allowed if invoked via AX=5D00h, in which case
; the filespec must be canonical (as returned by AH=60h), and only
; files matching the attribute mask in CL are deleted
; DR DOS 5.0-6.0 returns error code 03h if invoked via AX=5D00h; DR DOS
; 3.41 crashes if called via AX=5D00h with wildcards
; DOS does not erase the file's data; it merely becomes inaccessible
; because the FAT chain for the file is cleared
; deleting a file which is currently open may lead to filesystem
; corruption. Unless SHARE is loaded, DOS does not close the handles
; referencing the deleted file, thus allowing writes to a nonexistant
; file.
; under DR DOS and DR Multiuser DOS, this function will fail if the file
; is currently open
; under the FlashTek X-32 DOS extender, the pointer is in DS:EDX
;BUG: DR DOS 3.41 crashes if called via AX=5D00h
;SeeAlso: AH=13h,AX=4301h,AX=4380h,AX=5D00h,AH=60h,AX=7141h,AX=F244h
;SeeAlso: INT 2F/AX=1113h
;
;INT 21 - Windows95 - LONG FILENAME - DELETE FILE
;
; AX = 7141h
; DS:DX -> ASCIZ long name of file to delete
; SI = wildcard and attributes flag
; 0000h wildcards are not allowed, and search attributes are
; ignored
; 0001h wildcards are allowed, and only files with matching
; names and attributes are deleted
; CL = search attributes
; CH = must-match attributes
;Return: CF clear if successful
; CF set on error
; AX = error code (see #01680)
; 7100h if function not supported
;Note: for compatibility with DOS versions prior to v7.00, the carry flag
; should be set on call to ensure that it is set on exit
;SeeAlso: AH=41h
;
;*/
.8086
; Helpers
INCLUDE helpers.inc
INCLUDE dos.inc
INCLUDE bseerr.inc
INCLUDE GlobalVars.inc
_TEXT SEGMENT BYTE PUBLIC 'CODE' USE16
@PROLOG DOSDELETE
FILENAME DD ?
RESERVED DD ?
@START DOSDELETE
MOV AX,ERROR_INVALID_PARAMETER
XOR BX, BX
CMP BX, WORD PTR [DS:BP].ARGS.RESERVED
JNZ EXIT
CMP BX, WORD PTR [DS:BP].ARGS.RESERVED+2
JNZ EXIT
CMP LFNAPI, 0FFFFH
JZ LFN
DELETE_ENTRY [DS:BP].ARGS.FILENAME
JMP ERRCHECK
LFN:
LFN_DELETE_ENTRY [DS:BP].ARGS.FILENAME
ERRCHECK:
JC EXIT
XOR AX, AX
EXIT:
@EPILOG DOSDELETE
_TEXT ENDS
END
| 30.291262 | 80 | 0.675641 | [
"BSD-3-Clause"
] | osfree-project/FamilyAPI | fm/DosDelete.asm | 3,120 | Assembly |
; void heap_info_unlocked_callee(void *heap, void *callback)
SECTION code_clib
SECTION code_alloc_malloc
PUBLIC _heap_info_unlocked_callee, l0_heap_info_unlocked_callee
EXTERN asm_heap_info_unlocked
_heap_info_unlocked_callee:
pop af
pop de
pop bc
push af
l0_heap_info_unlocked_callee:
push bc
ex (sp),ix
call asm_heap_info_unlocked
pop ix
ret
| 14.333333 | 63 | 0.770026 | [
"BSD-2-Clause"
] | ByteProject/Puddle-BuildTools | FictionTools/z88dk/libsrc/_DEVELOPMENT/alloc/malloc/c/sdcc_ix/heap_info_unlocked_callee.asm | 387 | Assembly |
dnl IBM POWER mpn_mul_1 -- Multiply a limb vector with a limb and store the
dnl result in a second limb vector.
dnl Copyright 1992, 1994, 1999-2001 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/.
dnl INPUT PARAMETERS
dnl res_ptr r3
dnl s1_ptr r4
dnl size r5
dnl s2_limb r6
dnl The POWER architecture has no unsigned 32x32->64 bit multiplication
dnl instruction. To obtain that operation, we have to use the 32x32->64
dnl signed multiplication instruction, and add the appropriate compensation to
dnl the high limb of the result. We add the multiplicand if the multiplier
dnl has its most significant bit set, and we add the multiplier if the
dnl multiplicand has its most significant bit set. We need to preserve the
dnl carry flag between each iteration, so we have to compute the compensation
dnl carefully (the natural, srai+and doesn't work). Since all POWER can
dnl branch in zero cycles, we use conditional branches for the compensation.
include(`../config.m4')
ASM_START()
PROLOGUE(mpn_mul_1)
cal 3,-4(3)
l 0,0(4)
cmpi 0,6,0
mtctr 5
mul 9,0,6
srai 7,0,31
and 7,7,6
mfmq 8
ai 0,0,0 C reset carry
cax 9,9,7
blt Lneg
Lpos: bdz Lend
Lploop: lu 0,4(4)
stu 8,4(3)
cmpi 0,0,0
mul 10,0,6
mfmq 0
ae 8,0,9
bge Lp0
cax 10,10,6 C adjust high limb for negative limb from s1
Lp0: bdz Lend0
lu 0,4(4)
stu 8,4(3)
cmpi 0,0,0
mul 9,0,6
mfmq 0
ae 8,0,10
bge Lp1
cax 9,9,6 C adjust high limb for negative limb from s1
Lp1: bdn Lploop
b Lend
Lneg: cax 9,9,0
bdz Lend
Lnloop: lu 0,4(4)
stu 8,4(3)
cmpi 0,0,0
mul 10,0,6
cax 10,10,0 C adjust high limb for negative s2_limb
mfmq 0
ae 8,0,9
bge Ln0
cax 10,10,6 C adjust high limb for negative limb from s1
Ln0: bdz Lend0
lu 0,4(4)
stu 8,4(3)
cmpi 0,0,0
mul 9,0,6
cax 9,9,0 C adjust high limb for negative s2_limb
mfmq 0
ae 8,0,10
bge Ln1
cax 9,9,6 C adjust high limb for negative limb from s1
Ln1: bdn Lnloop
b Lend
Lend0: cal 9,0(10)
Lend: st 8,4(3)
aze 3,9
br
EPILOGUE(mpn_mul_1)
| 26.578947 | 79 | 0.731353 | [
"ECL-2.0",
"Apache-2.0"
] | 12mohaned/chapel | third-party/gmp/gmp-src/mpn/power/mul_1.asm | 3,030 | Assembly |
; A258376: Number of edges connecting the subgraph on {1, ..., n} with the complement in the minimal graph on positive natural numbers where degree(n) equals n.
; 1,1,2,4,5,7,8,10,13,15,18,22,25,29,32,36,41,45,50,54,59,65,70,76,83,89,96,102,109,117,124,132,141,149,158,166,175,185,194,204,213,223,234,244,255,267,278,290,301,313,326,338,351,363,376,390,403,417,432,446,461,475,490,506,521,537,554,570,587,603,620,638,655,673,690,708,727,745,764,784,803,823,842,862,883,903,924,946,967,989,1010,1032,1055,1077,1100,1122,1145,1169,1192,1216,1241,1265,1290,1314,1339,1365,1390,1416,1441,1467,1494,1520,1547,1575,1602,1630,1657,1685,1714,1742,1771,1801,1830,1860,1889,1919,1950,1980,2011,2041,2072,2104,2135,2167,2200,2232,2265,2297,2330,2364,2397,2431,2464,2498,2533,2567,2602,2638,2673,2709,2744,2780,2817,2853,2890,2928,2965,3003,3040,3078,3117,3155,3194,3232,3271,3311,3350,3390,3431,3471,3512,3552,3593,3635,3676,3718,3761,3803,3846,3888,3931,3975,4018,4062,4105,4149,4194,4238,4283,4329,4374,4420,4465,4511,4558,4604,4651,4697,4744,4792,4839,4887,4936,4984,5033,5081,5130,5180,5229,5279,5330,5380,5431,5481,5532,5584,5635,5687,5738,5790,5843,5895,5948,6002,6055,6109,6162,6216,6271,6325,6380,6436,6491,6547,6602,6658,6715,6771,6828,6884,6941,6999,7056,7114,7173,7231,7290,7348,7407,7467
mov $5,$0
mov $7,$0
add $7,1
lpb $7
clr $0,5
mov $0,$5
sub $7,1
sub $0,$7
add $0,1
mov $3,1
add $3,$0
sub $3,1
mov $4,$0
add $4,$3
cal $0,286751 ; Positions of 1 in A286749; complement of A286750.
sub $2,1
add $0,$2
mov $2,$4
sub $2,$0
add $6,$2
lpe
mov $1,$6
| 60.846154 | 1,127 | 0.726928 | [
"Apache-2.0"
] | jmorken/loda | programs/oeis/258/A258376.asm | 1,582 | Assembly |
;/*!
; @file
;
; @brief BvsSetCurType DOS wrapper
;
; (c) osFree Project 2008-2022, <http://www.osFree.org>
; for licence see licence.txt in root directory, or project website
;
; This is Family API implementation for DOS, used with BIND tools
; to link required API
;
; @author Yuri Prokushev ([email protected])
;
; * 0 NO_ERROR
; * 355 ERROR_VIO_MODE
; * 356 ERROR_VIO_WIDTH
; * 421 ERROR_VIO_INVALID_PARMS
; * 436 ERROR_VIO_INVALID_HANDLE
; * 465 ERROR_VIO_DETACHED
;
; @todo add params checks
;
;*/
.8086
; Helpers
INCLUDE helpers.inc
INCLUDE bios.inc
INCL_SUB EQU 1
INCLUDE bseerr.inc
INCLUDE bsesub.inc
_TEXT SEGMENT BYTE PUBLIC 'CODE' USE16
@BVSPROLOG BVSSETCURTYPE
VIOHANDLE DW ? ;VIDEO HANDLE
CURINFO DD ? ;
@BVSSTART BVSSETCURTYPE
EXTERN VIOCHECKHANDLE: PROC
MOV BX,[DS:BP].ARGS.VIOHANDLE ; GET HANDLE
CALL VIOCHECKHANDLE
JNZ EXIT
LDS SI,[DS:BP].ARGS.CURINFO
MOV AX,[DS:SI].VIOCURSORINFO.VIOCI_YSTART
AND AL,01FH
MOV CH,AL
MOV AX,[DS:SI].VIOCURSORINFO.VIOCI_CEND
AND AL,01FH
@SetCurSz CH, AL
XOR AX,AX
EXIT:
@BVSEPILOG BVSSETCURTYPE
_TEXT ENDS
END
| 21 | 69 | 0.675856 | [
"BSD-3-Clause"
] | osfree-project/FamilyAPI | bvs/BvsSetCurType.asm | 1,197 | Assembly |
; A152897: Partial sums of A152896.
; 0,3,18,73,256,844,2709,8596,27146,85560,269464,848400,2670859,8407805,26467163,83316232,262271397,825604226,2598919135,8181135469,25753388928,81069068693,255197243733,803335158081,2528817970143
lpb $0
mov $2,$0
cal $2,152896 ; a=b=c=0;c(n)=c+n+a;b(n)=b+n+c;a(n)=a+n+b.
sub $0,1
add $1,$2
lpe
| 33.9 | 195 | 0.728614 | [
"Apache-2.0"
] | jmorken/loda | programs/oeis/152/A152897.asm | 339 | Assembly |
; A228705: Expansion of (1-2*x+4*x^2-2*x^3+x^4)/((1-x)^4*(1+x^2)^2).
; 1,2,4,10,19,28,40,60,85,110,140,182,231,280,336,408,489,570,660,770,891,1012,1144,1300,1469,1638,1820,2030,2255,2480,2720,2992,3281,3570,3876,4218,4579,4940,5320,5740,6181,6622,7084,7590,8119,8648,9200,9800,10425,11050,11700,12402,13131,13860,14616,15428,16269,17110,17980,18910,19871,20832,21824,22880,23969,25058,26180,27370,28595,29820,31080,32412,33781,35150,36556,38038,39559,41080,42640,44280,45961,47642,49364,51170,53019,54868,56760,58740,60765,62790,64860,67022,69231,71440,73696,76048,78449,80850,83300,85850
lpb $0
mov $2,$0
sub $0,1
seq $2,282079 ; Number of n-element subsets of [n+2] having an even sum.
add $1,$2
lpe
add $1,1
mov $0,$1
| 60.916667 | 520 | 0.737346 | [
"Apache-2.0"
] | ckrause/cm | programs/oeis/228/A228705.asm | 731 | Assembly |
; A235933: Numbers coprime to 35.
; Submitted by Jon Maiga
; 1,2,3,4,6,8,9,11,12,13,16,17,18,19,22,23,24,26,27,29,31,32,33,34,36,37,38,39,41,43,44,46,47,48,51,52,53,54,57,58,59,61,62,64,66,67,68,69,71,72,73,74,76,78,79,81,82,83,86,87,88,89,92,93,94,96,97,99,101,102,103,104,106,107,108,109,111,113,114,116,117,118,121,122,123,124,127,128,129,131,132,134,136,137,138,139,141,142,143,144
mov $2,1
lpb $0
mov $3,$2
lpb $3
add $2,1
mov $4,235795
gcd $4,$2
cmp $4,1
cmp $4,0
sub $3,$4
lpe
sub $0,1
add $2,1
lpe
mov $0,$2
| 27.55 | 326 | 0.622505 | [
"Apache-2.0"
] | ckrause/loda-programs | oeis/235/A235933.asm | 551 | Assembly |
mov ax, 0xb800 ; load into ax to be able to load into ds
mov ds, ax ; set ds (destination address segment) as the begining of video memory
xor di, di ; zero destination index
mov si, MESSAGE ; set source index to MESSAGE address
move: ; get next character
xor dx, dx ; zero dx
mov dl, [cs:si] ; load value in current si into dl
cmp dl, 0 ; check if it's 0 byte terminating string
idle:
jz idle ; if it's end of string loop "eternally"
mov [di], dl ; load value in dl (current character)
inc di ; increment destination address index
mov [di], BYTE 0x1e ; load Blue background, Intensified Yellow foreground
inc di ; increment destination address index
inc si ; increment source address index
jmp move ; return to getting next character
MESSAGE:
db 'Hello, Bigsby!', 0 ; zero terminated string message
| 46.958333 | 102 | 0.533274 | [
"MIT"
] | Bigsby/x86_64 | tests/nasm-intel-template/start.asm | 1,127 | Assembly |
; A153797: 7 times octagonal numbers: a(n) = 7*n*(3*n-2).
; 0,7,56,147,280,455,672,931,1232,1575,1960,2387,2856,3367,3920,4515,5152,5831,6552,7315,8120,8967,9856,10787,11760,12775,13832,14931,16072,17255,18480,19747,21056,22407,23800,25235,26712,28231,29792,31395,33040,34727,36456,38227,40040,41895,43792,45731,47712,49735,51800,53907,56056,58247,60480,62755,65072,67431,69832,72275,74760,77287,79856,82467,85120,87815,90552,93331,96152,99015,101920,104867,107856,110887,113960,117075,120232,123431,126672,129955,133280,136647,140056,143507,147000,150535,154112,157731,161392,165095,168840,172627,176456,180327,184240,188195,192192,196231,200312,204435
mov $1,$0
mul $1,21
sub $1,14
mul $0,$1
| 86.875 | 595 | 0.794245 | [
"Apache-2.0"
] | ckrause/cm | programs/oeis/153/A153797.asm | 695 | Assembly |
; A137344: a(n)=4a(n-2). Also 3*A084221.
; 3,9,12,36,48,144,192,576,768,2304,3072,9216,12288,36864,49152,147456,196608,589824,786432,2359296,3145728,9437184,12582912,37748736,50331648,150994944,201326592,603979776,805306368,2415919104
mov $2,$0
lpb $2
add $3,$1
mul $1,2
add $1,7
mov $4,$1
add $4,$2
lpb $4
gcd $4,2
sub $4,$3
lpe
sub $2,1
cal $4,142
mul $1,$4
lpe
div $1,7
mul $1,3
add $1,3
| 19.090909 | 193 | 0.65 | [
"Apache-2.0"
] | jmorken/loda | programs/oeis/137/A137344.asm | 420 | Assembly |
;================================================================================
; Utility Functions
;================================================================================
!PROGRESSIVE_SHIELD = "$7EF416" ; ss-- ----
!BEE_TRAP_DISGUISE = "$7F5404"
;--------------------------------------------------------------------------------
; GetSpriteTile
; in: A - Loot ID
; out: A - Sprite GFX ID
;--------------------------------------------------------------------------------
GetSpriteID:
;JSR AttemptItemSubstitution
CMP.b #$16 : BEQ .bottle ; Bottle
CMP.b #$2B : BEQ .bottle ; Red Potion w/bottle
CMP.b #$2C : BEQ .bottle ; Green Potion w/bottle
CMP.b #$2D : BEQ .bottle ; Blue Potion w/bottle
CMP.b #$3C : BEQ .bottle ; Bee w/bottle
CMP.b #$3D : BEQ .bottle ; Fairy w/bottle
CMP.b #$48 : BEQ .bottle ; Gold Bee w/bottle
CMP.b #$6D : BEQ .server_F0 ; Server Request F0
CMP.b #$6E : BEQ .server_F1 ; Server Request F1
CMP.b #$6F : BEQ .server_F2 ; Server Request F2
CMP.b #$5A : BEQ .bee_trap
CMP.b #$B0 : BEQ .bee_trap
BRA .normal
.bee_trap
LDA !BEE_TRAP_DISGUISE
JSL.l GetSpriteID
RTL
.bottle
PHA : JSR.w CountBottles : CMP.l BottleLimit : !BLT +
LDA !MULTIWORLD_SPRITEITEM_PLAYER_ID : BNE +
PLA : LDA.l BottleLimitReplacement
JSL.l GetSpriteID
RTL
+
PLA : BRA .normal
.server_F0
JSL.l ItemVisualServiceRequest_F0
BRA .normal
.server_F1
JSL.l ItemVisualServiceRequest_F1
BRA .normal
.server_F2
JSL.l ItemVisualServiceRequest_F2
BRA .normal
.normal
PHX
PHB : PHK : PLB
;--------
TAX : LDA.l .gfxSlots, X ; look up item gfx
PLB : PLX
CMP.b #$F8 : !BGE .specialHandling
RTL
.specialHandling
CMP.b #$F9 : BNE ++ ; Progressive Magic
LDA.l $7EF37B : BNE +++
LDA.b #$3B : RTL ; Half Magic
+++
LDA.b #$3C : RTL ; Quarter Magic
++ CMP.b #$FA : BNE ++ ; RNG Item (Single)
JSL.l GetRNGItemSingle : JMP GetSpriteID
++ CMP.b #$FB : BNE ++ ; RNG Item (Multi)
JSL.l GetRNGItemMulti : JMP GetSpriteID
++ CMP.b #$FD : BNE ++ ; Progressive Armor
LDA !MULTIWORLD_SPRITEITEM_PLAYER_ID : BNE +
LDA $7EF35B : CMP.l ProgressiveArmorLimit : !BLT + ; Progressive Armor Limit
LDA.l ProgressiveArmorReplacement
JSL.l GetSpriteID
RTL
+
LDA.b #$04 : RTL
++ CMP.b #$FE : BNE ++ ; Progressive Sword
LDA !MULTIWORLD_SPRITEITEM_PLAYER_ID : BNE .skipswordlimit
LDA $7EF359
CMP.l ProgressiveSwordLimit : !BLT + ; Progressive Sword Limit
LDA.l ProgressiveSwordReplacement
JSL.l GetSpriteID
RTL
.skipswordlimit : LDA $7EF359
+ : CMP.b #$FF : BNE + ; Swordless
LDA.b #$43 : RTL
+ : CMP.b #$00 : BNE + ; No Sword
LDA.b #$43 : RTL
+ : CMP.b #$01 : BNE + ; Fighter Sword
LDA.b #$44 : RTL
+ : CMP.b #$02 : BNE + ; Master Sword
LDA.b #$45 : RTL
+ ; CMP.b #$03 : BNE + ; Tempered Sword
LDA.b #$46 : RTL
+
++ : CMP.b #$FF : BNE ++ ; Progressive Shield
LDA !MULTIWORLD_SPRITEITEM_PLAYER_ID : BNE .skipshieldlimit
LDA !PROGRESSIVE_SHIELD : AND #$C0 : LSR #6
CMP.l ProgressiveShieldLimit : !BLT + ; Progressive Shield Limit
LDA.l ProgressiveShieldReplacement
JSL.l GetSpriteID
RTL
.skipshieldlimit : LDA !PROGRESSIVE_SHIELD : AND #$C0 : LSR #6
+ : CMP.b #$00 : BNE + ; No Shield
LDA.b #$2D : RTL
+ : CMP.b #$01 : BNE + ; Fighter Shield
LDA.b #$20 : RTL
+ ; Everything Else
LDA.b #$2E : RTL
++ : CMP.b #$F8 : BNE ++ ; Progressive Bow
LDA !MULTIWORLD_SPRITEITEM_PLAYER_ID : BNE .skipbowlimit
LDA $7EF340 : INC : LSR
CMP.l ProgressiveBowLimit : !BLT +
LDA.l ProgressiveBowReplacement
JSL.l GetSpriteID
RTL
.skipbowlimit : LDA $7EF340 : INC : LSR
+ : CMP.b #$00 : BNE + ; No Bow
LDA.b #$29 : RTL
+ ; Any Bow
LDA.b #$2A : RTL
++
RTL
;DATA - Loot Identifier to Sprite ID
{
.gfxSlots
db $06, $44, $45, $46, $2D, $20, $2E, $09
db $09, $0A, $08, $05, $10, $0B, $2C, $1B
db $1A, $1C, $14, $19, $0C, $07, $1D, $2F
db $07, $15, $12, $0D, $0D, $0E, $11, $17
db $28, $27, $04, $04, $0F, $16, $03, $13
db $01, $1E, $10, $00, $00, $00, $00, $00
db $00, $30, $22, $21, $24, $24, $24, $23
db $23, $23, $29, $2A, $2C, $2B, $03, $03
db $34, $35, $31, $33, $02, $32, $36, $37
db $2C, $43, $0C, $38, $39, $3A, $F9, $3C
; db $2C, $06, $0C, $38, $FF, $FF, $FF, $FF
;5x
db $44 ; Safe Master Sword
db $3D, $3E, $3F, $40 ; Bomb & Arrow +5/+10
db $2C, $00, $00 ; 3x Programmable Item
db $41 ; Upgrade-Only Silver Arrows
db $24 ; 1 Rupoor
db $47 ; Null Item
db $48, $48, $48 ; Red, Blue & Green Clocks
db $FE, $FF ; Progressive Sword & Shield
;6x
db $FD, $0D ; Progressive Armor & Gloves
db $FA, $FB ; RNG Single & Multi
db $F8, $F8 ; Progressive Bow x2
db $FF, $FF, $FF, $FF ; Unused
db $49, $4A, $49 ; Goal Item Single, Multi & Alt Multi
db $39, $39, $39 ; Server Request F0, F1, F2
;7x
db $21, $21, $21, $21, $21, $21, $21, $21, $21, $21, $21, $21, $21, $21, $21, $21 ; Free Map
;8x
db $16, $16, $16, $16, $16, $16, $16, $16, $16, $16, $16, $16, $16, $16, $16, $16 ; Free Compass
;9x
db $22, $22, $22, $22, $22, $22, $22, $22, $22, $22, $22, $22, $22, $22, $22, $22 ; Free Big Key
;Ax
db $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F ; Free Small Key
db $2C ; Bee Trap
db $2B, $2C, $3B, $42, $42; Fae, Bee, Magic Refill, Apple, Apple (fake)
db $49, $49, $49, $49, $49, $49, $49, $49, $49, $49 ; Unused
db $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49 ; Unused
db $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49 ; Unused
db $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49 ; Unused
db $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49 ; Reserved
}
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
; GetSpritePalette
; in: A - Loot ID
; out: A - Palette
;--------------------------------------------------------------------------------
GetSpritePalette:
;JSR AttemptItemSubstitution
CMP.b #$16 : BEQ .bottle ; Bottle
CMP.b #$2B : BEQ .bottle ; Red Potion w/bottle
CMP.b #$2C : BEQ .bottle ; Green Potion w/bottle
CMP.b #$2D : BEQ .bottle ; Blue Potion w/bottle
CMP.b #$3C : BEQ .bottle ; Bee w/bottle
CMP.b #$3D : BEQ .bottle ; Fairy w/bottle
CMP.b #$48 : BEQ .bottle ; Gold Bee w/bottle
CMP.b #$5A : BEQ .bee_trap
CMP.b #$B0 : BEQ .bee_trap
BRA .notBottle
.bee_trap
;JSL.l GetRandomInt : AND.b #$3F ; select random value
LDA !BEE_TRAP_DISGUISE
JSL.l GetSpritePalette
RTL
.bottle
PHA : JSR.w CountBottles : CMP.l BottleLimit : !BLT +
PLA : LDA.l BottleLimitReplacement
JSL.l GetSpritePalette
RTL
+
PLA : .notBottle
PHX
PHB : PHK : PLB
;--------
TAX : LDA.l .gfxPalettes, X ; look up item gfx
PLB : PLX
CMP.b #$F8 : !BGE .specialHandling
RTL
.specialHandling
CMP.b #$FD : BNE ++ ; Progressive Sword
LDA $7EF359
CMP.l ProgressiveSwordLimit : !BLT + ; Progressive Sword Limit
LDA.l ProgressiveSwordReplacement
JSL.l GetSpritePalette
RTL
+ : CMP.b #$00 : BNE + ; No Sword
LDA.b #$04 : RTL
+ : CMP.b #$01 : BNE + ; Fighter Sword
LDA.b #$04 : RTL
+ : CMP.b #$02 : BNE + ; Master Sword
LDA.b #$02 : RTL
+ ; Everything Else
LDA.b #$08 : RTL
++ : CMP.b #$FE : BNE ++ ; Progressive Shield
LDA !PROGRESSIVE_SHIELD : AND #$C0 : LSR #6
CMP.l ProgressiveShieldLimit : !BLT + ; Progressive Shield Limit
LDA.l ProgressiveShieldReplacement
JSL.l GetSpritePalette
RTL
+ : CMP.b #$00 : BNE + ; No Shield
LDA.b #$04 : RTL
+ : CMP.b #$01 : BNE + ; Fighter Shield
LDA.b #$02 : RTL
+ ; Everything Else
LDA.b #$08 : RTL
++ : CMP.b #$FF : BNE ++ ; Progressive Armor
LDA $7EF35B : CMP.l ProgressiveArmorLimit : !BLT + ; Progressive Armor Limit
LDA.l ProgressiveArmorReplacement
JSL.l GetSpritePalette
RTL
+ : CMP.b #$00 : BNE + ; Green Tunic
LDA.b #$04 : RTL
+ ; Everything Else
LDA.b #$02 : RTL
++ : CMP.b #$FC : BNE ++ ; Progressive Gloves
LDA $7EF354 : BNE + ; No Gloves
LDA.b #$02 : RTL
+ ; Everything Else
LDA.b #$08 : RTL
++ : CMP.b #$F8 : BNE ++ ; Progressive Bow
LDA $7EF354 : BNE + ; No Bow
LDA.b #$08 : RTL
+ ; Any Bow
LDA.b #$02 : RTL
++ : CMP.b #$FA : BNE ++ ; RNG Item (Single)
JSL.l GetRNGItemSingle : JMP GetSpritePalette
++ : CMP.b #$FB : BNE ++ ; RNG Item (Multi)
JSL.l GetRNGItemMulti : JMP GetSpritePalette
++
RTL
;DATA - Loot Identifier to Sprite Palette
{
.gfxPalettes
db $00, $04, $02, $08, $04, $02, $08, $02
db $04, $02, $02, $02, $04, $04, $04, $08
db $08, $08, $02, $02, $04, $02, $02, $02
db $04, $02, $04, $02, $08, $08, $04, $02
db $0A, $02, $04, $02, $04, $04, $00, $04
db $04, $08, $02, $02, $08, $04, $02, $08
db $04, $04, $08, $08, $08, $04, $02, $08
db $02, $04, $08, $02, $04, $04, $02, $02
db $08, $08, $02, $04, $04, $08, $08, $08
db $04, $04, $04, $02, $08, $08, $08, $08
; db $04, $0A, $04, $02, $FF, $FF, $FF, $FF
db $04 ; Safe Master Sword
db $08, $08, $08, $08 ; Bomb & Arrow +5/+10
db $04, $00, $00 ; Programmable Items 1-3
db $02 ; Upgrade-Only Silver Arrows
db $06 ; 1 Rupoor
db $02 ; Null Item
db $02, $04, $08 ; Red, Blue & Green Clocks
db $FD, $FE, $FF, $FC ; Progressive Sword, Shield, Armor & Gloves
db $FA, $FB ; RNG Single & Multi
db $F8, $F8 ; Progressive Bow
db $00, $00, $00, $00 ; Unused
db $08, $08, $08 ; Goal Item Single, Multi & Alt Multi
db $04, $04, $04 ; Server Request F0, F1, F2
db $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 ; Free Map
db $04, $04, $04, $04, $04, $04, $04, $04, $04, $04, $04, $04, $04, $04, $04, $04 ; Free Compass
;db $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 ; *EVENT*
db $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 ; Free Big Key
db $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 ; Free Small Key
db $04 ; Bee Trap
db $08, $02, $08, $08, $08; Fae, Bee, Jar, Apple, Apple (fake)
db $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 ; Unused
db $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 ; Unused
db $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 ; Unused
db $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 ; Unused
db $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 ; Unused
}
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
; IsNarrowSprite
; in: A - Loot ID
; out: Carry - 0 = Full, 1 = Narrow
;--------------------------------------------------------------------------------
IsNarrowSprite:
PHA : PHX
PHB : PHK : PLB
;JSR AttemptItemSubstitution
;--------
CMP.b #$B3 : BNE + : SEC : BRL .done : + ; Magic Refill -- todo do this less hackily
CMP.b #$16 : BEQ .bottle ; Bottle
CMP.b #$2B : BEQ .bottle ; Red Potion w/bottle
CMP.b #$2C : BEQ .bottle ; Green Potion w/bottle
CMP.b #$2D : BEQ .bottle ; Blue Potion w/bottle
CMP.b #$3C : BEQ .bottle ; Bee w/bottle
CMP.b #$3D : BEQ .bottle ; Fairy w/bottle
CMP.b #$48 : BEQ .bottle ; Gold Bee w/bottle
CMP.b #$5A : BEQ .bee_trap
CMP.b #$B0 : BEQ .bee_trap
BRA .notBottle
.bee_trap
LDA !BEE_TRAP_DISGUISE
JSL.l IsNarrowSprite
BRL .done
.bottle
JSR.w CountBottles : CMP.l BottleLimit : !BLT +
LDA.l BottleLimitReplacement
JSL.l IsNarrowSprite
BRL .done
+ : BRA .continue
.notBottle
CMP.b #$5E : BNE ++ ; Progressive Sword
LDA $7EF359 : CMP.l ProgressiveSwordLimit : !BLT + ; Progressive Sword Limit
LDA.l ProgressiveSwordReplacement
JSL.l IsNarrowSprite
BRA .done
+ : BRA .continue
++ : CMP.b #$5F : BNE ++ ; Progressive Shield
LDA !PROGRESSIVE_SHIELD : AND #$C0 : BNE + : SEC : BRA .done ; No Shield
LSR #6 : CMP.l ProgressiveShieldLimit : !BLT + ; Progressive Shield Limit
LDA.l ProgressiveShieldReplacement
JSL.l IsNarrowSprite
BRA .done
+
;LDA $7EF35A : BNE + : SEC : BRA .done : +; No Shield
BRA .false ; Everything Else
++ CMP.b #$60 : BNE ++ ; Progressive Armor
LDA $7EF35B : CMP.l ProgressiveArmorLimit : !BLT + ; Progressive Armor Limit
LDA.l ProgressiveArmorReplacement
JSL.l IsNarrowSprite
BRA .done
+
++ CMP.b #$62 : BNE ++ ; RNG Item (Single)
JSL.l GetRNGItemSingle : BRA .continue
++ CMP.b #$63 : BNE ++ ; RNG Item (Multi)
JSL.l GetRNGItemMulti
++
.continue
;--------
LDX.b #$00 ; set index counter to 0
;----
-
CPX.b #$24 : !BGE .false ; finish if we've done the whole list
CMP.l .smallSprites, X : BNE + ; skip to next if we don't match
;--
SEC ; set true state
BRA .done ; we're done
;--
+
INX ; increment index
BRA - ; go back to beginning of loop
;----
.false
CLC
.done
PLB : PLX : PLA
RTL
;DATA - Half-Size Sprite Markers
{
.smallSprites
db $04, $07, $08, $09, $0A, $0B, $0C, $13
db $15, $18, $24, $2A, $34, $35, $36, $42
db $43, $45, $59, $A0, $A1, $A2, $A3, $A4
db $A5, $A6, $A7, $A8, $A9, $AA, $AB, $AC
db $AD, $AE, $AF, $B3, $FF, $FF, $FF, $FF
}
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
; PrepDynamicTile
; in: A - Loot ID
;-------------------------------------------------------------------------------- 20/8477
PrepDynamicTile:
PHA : PHX : PHY
TAX : LDA RemoteItems : BEQ +
TXA
CMP !MULTIWORLD_SCOUTREPLY_LOCATION : BNE ++
LDA !MULTIWORLD_SCOUTREPLY_PLAYER : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
LDA !MULTIWORLD_SCOUTREPLY_ITEM
TAX
BRA +
++
STA !MULTIWORLD_SCOUT_LOCATION
LDA #$00 : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
LDX #$6B
+
JSL GetRandomInt : AND #$3F ; pick random int every time we prep a tile, just in case it's a bee thing
BNE + : LDA #$49 : + : CMP #$26 : BNE + : LDA #$6A : + ; if 0 (fighter's sword + shield), set to just sword, if filled container (bugged palette), switch to triforce piece
STA !BEE_TRAP_DISGUISE
TXA
JSR.w LoadDynamicTileOAMTable
JSL.l GetSpriteID ; convert loot id to sprite id
JSL.l GetAnimatedSpriteTile_variable
LDA.b #$00 : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
PLY : PLX : PLA
RTL
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
; LoadDynamicTileOAMTable
; in: A - Loot ID
;-------------------------------------------------------------------------------- 20/847B
!SPRITE_OAM = "$7EC025"
;--------------------------------------------------------------------------------
LoadDynamicTileOAMTable:
PHA : PHP
PHA
REP #$20 ; set 16-bit accumulator
LDA.w #$0000 : STA.l !SPRITE_OAM
STA.l !SPRITE_OAM+2
LDA.w #$0200 : STA.l !SPRITE_OAM+6
SEP #$20 ; set 8-bit accumulator
LDA.b #$24 : STA.l !SPRITE_OAM+4
LDA $01,s
JSL.l GetSpritePalette
STA !SPRITE_OAM+5 : STA !SPRITE_OAM+13
PLA
JSL.l IsNarrowSprite : BCS .narrow
BRA .done
.narrow
REP #$20 ; set 16-bit accumulator
LDA.w #$0000 : STA.l !SPRITE_OAM+7
STA.l !SPRITE_OAM+14
LDA.w #$0800 : STA.l !SPRITE_OAM+9
LDA.w #$3400 : STA.l !SPRITE_OAM+11
.done
PLP : PLA
RTS
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
; DrawDynamicTile
; in: A - Loot ID
; out: A - OAM Slots Taken
;--------------------------------------------------------------------------------
; This wastes two OAM slots if you don't want a shadow - fix later - I wrote "fix later" over a year ago and it's still not fixed (Aug 6, 2017) - lol (May 25th, 2019)
;-------------------------------------------------------------------------------- 2084B8
!SPRITE_OAM = "$7EC025"
!SKIP_EOR = "$7F5008"
;--------------------------------------------------------------------------------
DrawDynamicTile:
JSR PrepDrawRemoteItemSprite
JSL.l IsNarrowSprite : BCS .narrow
.full
LDA.b #$01 : STA $06
LDA #$0C : JSL.l OAM_AllocateFromRegionC
LDA #$02 : PHA
BRA .draw
.narrow
LDA.b #$02 : STA $06
LDA #$10 : JSL.l OAM_AllocateFromRegionC
LDA #$03 : PHA
.draw
LDA.b #!SPRITE_OAM>>0 : STA $08
LDA.b #!SPRITE_OAM>>8 : STA $09
STZ $07
LDA #$7E : PHB : PHA : PLB
LDA.b #$01 : STA.l !SKIP_EOR
JSL Sprite_DrawMultiple_quantity_preset
LDA.b #$00 : STA.l !SKIP_EOR
PLB
LDA $90 : !ADD.b #$08 : STA $90 ; leave the pointer in the right spot to draw the shadow, if desired
LDA $92 : INC #2 : STA $92
PLA
RTL
;--------------------------------------------------------------------------------
DrawDynamicTileNoShadow:
JSR PrepDrawRemoteItemSprite
JSL.l IsNarrowSprite : BCS .narrow
.full
LDA.b #$01 : STA $06
LDA #$04 : JSL.l OAM_AllocateFromRegionC
BRA .draw
.narrow
LDA.b #$02 : STA $06
LDA #$08 : JSL.l OAM_AllocateFromRegionC
.draw
LDA.b #!SPRITE_OAM>>0 : STA $08
LDA.b #!SPRITE_OAM>>8 : STA $09
STZ $07
LDA #$7E : PHB : PHA : PLB
LDA.b #$01 : STA.l !SKIP_EOR
JSL Sprite_DrawMultiple_quantity_preset
LDA Bob : BNE + : LDA.b #$00 : STA.l !SKIP_EOR : + ; Bob fix is conditional
PLB
LDA $90 : !ADD.b #$08 : STA $90
LDA $92 : INC #2 : STA $92
RTL
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
PrepDrawRemoteItemSprite:
PHA
LDA RemoteItems : BEQ +
PLA
CMP !MULTIWORLD_SCOUTREPLY_LOCATION : BNE ++
LDA !MULTIWORLD_SCOUT_LOCATION : BEQ +++
LDA !MULTIWORLD_SCOUTREPLY_LOCATION
JSL PrepDynamicTile
LDA #$00
BRA ++
+++
LDA !MULTIWORLD_SCOUTREPLY_PLAYER : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
LDA !MULTIWORLD_SCOUTREPLY_ITEM
RTS
++
STA !MULTIWORLD_SCOUT_LOCATION
LDA #$00 : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
LDA #$6B
RTS
+
PLA
RTS
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
!TILE_UPLOAD_OFFSET_OVERRIDE = "$7F5042"
LoadModifiedTileBufferAddress:
PHA
LDA !TILE_UPLOAD_OFFSET_OVERRIDE : BEQ +
TAX
LDA.w #$0000 : STA !TILE_UPLOAD_OFFSET_OVERRIDE
BRA .done
+
LDX.w #$2D40
.done
LDY.w #$0002
PLA
RTL
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
; Sprite_IsOnscreen
; in: X - Sprite Slot
; out: Carry - 1 = On Screen, 0 = Off Screen
;--------------------------------------------------------------------------------
Sprite_IsOnscreen:
JSR _Sprite_IsOnscreen_DoWork
BCS +
REP #$20
LDA $E2 : PHA : !SUB.w #$0F : STA $E2
LDA $E8 : PHA : !SUB.w #$0F : STA $E8
SEP #$20
JSR _Sprite_IsOnscreen_DoWork
REP #$20
PLA : STA $E8
PLA : STA $E2
SEP #$20
+
RTL
_Sprite_IsOnscreen_DoWork:
LDA $0D10, X : CMP $E2
LDA $0D30, X : SBC $E3 : BNE .offscreen
LDA $0D00, X : CMP $E8
LDA $0D20, X : SBC $E9 : BNE .offscreen
SEC
RTS
.offscreen
CLC
RTS
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
; Sprite_GetScreenRelativeCoords:
; out: $00.w Sprite Y
; out: $02.w Sprite X
; out: $06.b Sprite Y Relative
; out: $07.b Sprite X Relative
;--------------------------------------------------------------------------------
; Copied from bank $06
;--------------------------------------------------------------------------------
!spr_y_lo = $00
!spr_y_hi = $01
!spr_x_lo = $02
!spr_x_hi = $03
!spr_y_screen_rel = $06
!spr_x_screen_rel = $07
;--------------------------------------------------------------------------------
Sprite_GetScreenRelativeCoords:
STY $0B
STA $08
LDA $0D00, X : STA $00
!SUB $E8 : STA $06
LDA $0D20, X : STA $01
LDA $0D10, X : STA $02
!SUB $E2 : STA $07
LDA $0D30, X : STA $03
RTL
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
; SkipDrawEOR - Shims in Bank05.asm : 2499
;--------------------------------------------------------------------------------
!SKIP_EOR = "$7F5008"
;--------------------------------------------------------------------------------
SkipDrawEOR:
LDA.l !SKIP_EOR : BEQ .normal
LDA.w #$0000 : STA.l !SKIP_EOR
LDA $04 : AND.w #$F0FF : STA $04
.normal
LDA ($08), Y : EOR $04 ; thing we wrote over
RTL
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
; HexToDec
; in: A(w) - Word to Convert
; out: $7F5003 - $7F5007 (high - low)
;--------------------------------------------------------------------------------
HexToDec:
PHA
PHA
LDA.w #$9090
STA $04 : STA $06 ; temporarily store our decimal values here for speed
PLA
; as far as i can tell we never convert a value larger than 9999, no point in wasting time on this?
; -
; CMP.w #10000 : !BLT +
; INC $03
; !SUB.w #10000 : BRA -
; +
-
CMP.w #1000 : !BLT +
INC $04
!SUB.w #1000 : BRA -
+ -
CMP.w #100 : !BLT +
INC $05
!SUB.w #100 : BRA -
+ -
CMP.w #10 : !BLT +
INC $06
!SUB.w #10 : BRA -
+ -
CMP.w #1 : !BLT +
INC $07
!SUB.w #1 : BRA -
+
LDA.b $04 : STA $7F5004 ; move to digit storage
LDA.b $06 : STA $7F5006
PLA
RTL
;--------------------------------------------------------------------------------
; CountBits
; in: A(b) - Byte to count bits in
; out: A(b) - sum of bits
; caller is responsible for setting 8-bit mode and preserving X and Y
;--------------------------------------------------------------------------------
CountBits:
PHB : PHK : PLB
TAX ; Save a copy of value
LSR #4 ; Shift down hi nybble, Leave <3> in C
TAY ; And save <7:4> in Y
TXA ; Recover value
AND.b #$07 ; Put out <2:0> in X
TAX ; And save in X
LDA NybbleBitCounts, Y; Fetch count for Y
ADC.l NybbleBitCounts, X; Add count for X & C
PLB
RTL
; Look up table of bit counts in the values $00-$0F
NybbleBitCounts:
db #00, #01, #01, #02, #01, #02, #02, #03, #01, #02, #02, #03, #02, #03, #03, #04
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
; HexToDec
; in: A(w) - Word to Convert
; out: $7F5003 - $7F5007 (high - low)
;--------------------------------------------------------------------------------
;HexToDec:
; PHA
; PHA
; LDA.w #$9090
; STA $7F5003 : STA $7F5005 : STA $7F5006 ; clear digit storage
; PLA
; -
; CMP.w #10000 : !BLT +
; PHA : SEP #$20 : LDA $7F5003 : INC : STA $7F5003 : REP #$20 : PLA
; !SUB.w #10000 : BRA -
; + -
; CMP.w #1000 : !BLT +
; PHA : SEP #$20 : LDA $7F5004 : INC : STA $7F5004 : REP #$20 : PLA
; !SUB.w #1000 : BRA -
; + -
; CMP.w #100 : !BLT +
; PHA : SEP #$20 : LDA $7F5005 : INC : STA $7F5005 : REP #$20 : PLA
; !SUB.w #100 : BRA -
; + -
; CMP.w #10 : !BLT +
; PHA : SEP #$20 : LDA $7F5006 : INC : STA $7F5006 : REP #$20 : PLA
; !SUB.w #10 : BRA -
; + -
; CMP.w #1 : !BLT +
; PHA : SEP #$20 : LDA $7F5007 : INC : STA $7F5007 : REP #$20 : PLA
; !SUB.w #1 : BRA -
; +
; PLA
;RTL
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
; WriteVRAMStripe
; in: A(w) - VRAM Destination
; in: X(w) - Length in Tiles
; in: Y(w) - Word to Write
;--------------------------------------------------------------------------------
WriteVRAMStripe:
PHX
LDX $1000 ; get pointer
AND.w #$7F : STA $1002, X : INX #2 ; set destination
PLA : ASL : AND.w #$7FFF : ORA.w #$7000 : STA $1002, X : INX #2 ; set length and enable RLE
TYA : STA $1002, X : INX #2 ; set tile
SEP #$20 ; set 8-bit accumulator
LDA.b #$FF : STA $1002, X
STX $1000
LDA.b #01 : STA $14
REP #$20 ; set 16-bit accumulator
RTL
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
; WriteVRAMBlock
; in: A(w) - VRAM Destination
; in: X(w) - Length in Tiles
; in: Y(w) - Address of Data to Copy
;--------------------------------------------------------------------------------
WriteVRAMBlock:
PHX
LDX $1000 ; get pointer
AND.w #$7F : STA $1002, X : INX #2 ; set destination
PLA : ASL : AND.w #$3FFF : STA $1002, X : INX #2 ; set length
PHX
TYX ; set X to source
PHA
TXA : !ADD #$1002 : TAY ; set Y to dest
PLA
;A is already the value we need for mvn
MVN $7F7E ; currently we transfer from our buffers in 7F to the vram buffer in 7E
!ADD 1, s ; add the length in A to the stack pointer on the top of the stack
PLX : TAX ; pull and promptly ignore, copying the value we just got over it
SEP #$20 ; set 8-bit accumulator
LDA.b #$FF : STA $1002, X
STX $1000
LDA.b #01 : STA $14
REP #$20 ; set 16-bit accumulator
RTL
;--------------------------------------------------------------------------------
;Byte 1 byte 2 Byte 3 byte 4
;Evvvvvvv vvvvvvv DRllllll llllllll
;
;E if set indicates that this is not a header, but instead is the terminator byte. Only the topmost bit matters in that case.
;The v's form a vram address.
;if D is set, the dma will increment the vram address by a row per word, instead of incrementing by a column (1).
;R if set enables a run length encoding feature
;the l's are the number of bytes to upload minus 1 (don't forget this -1, it is important)
;
;This is then followed by the bytes to upload, in normal format.
;RLE feature:
;This feature makes it easy to draw the same tile repeatedly. If this bit is set, the length bits should be set to 2 times the number of copies of the tile to upload. (Without subtracting 1!)
;It is followed by a single tile (word). Combining this this with the D bit makes it easy to draw large horizontal or vertical runs of a tile without using much space. Geat for erasing or drawing horizontal or verical box edges.
;================================================================================
| 31.661871 | 229 | 0.504696 | [
"MIT"
] | KScl/z3rasm | utilities.asm | 26,406 | Assembly |
; A298375: Partial sums of A230584.
; 2,5,11,18,29,43,61,84,111,145,183,230,281,343,409,488,571,669,771,890,1013,1155,1301,1468,1639,1833,2031,2254,2481,2735,2993,3280,3571,3893,4219,4578,4941,5339,5741,6180,6623,7105,7591,8118,8649,9223,9801,10424,11051,11725,12403,13130,13861,14643,15429,16268,17111,18009,18911,19870,20833,21855,22881,23968,25059,26213,27371,28594,29821,31115,32413,33780,35151,36593,38039,39558,41081,42679,44281,45960,47643,49405,51171,53018,54869,56803,58741,60764,62791,64905,67023,69230,71441,73743,76049,78448,80851,83349,85851,88450,91053,93755,96461,99268,102079,104993,107911,110934,113961,117095,120233,123480,126731,130093,133459,136938,140421,144019,147621,151340,155063,158905,162751,166718,170689,174783,178881,183104,187331,191685,196043,200530,205021,209643,214269,219028,223791,228689,233591,238630,243673,248855,254041,259368,264699,270173,275651,281274,286901,292675,298453,304380,310311,316393,322479,328718,334961,341359,347761,354320,360883,367605,374331,381218,388109,395163,402221,409444,416671,424065,431463,439030,446601,454343,462089,470008,477931,486029,494131,502410,510693,519155,527621,536268,544919,553753,562591,571614,580641,589855,599073,608480,617891,627493,637099,646898,656701,666699,676701,686900,697103,707505,717911,728518,739129,749943,760761,771784,782811,794045,805283,816730,828181,839843,851509,863388,875271,887369,899471,911790,924113,936655,949201,961968,974739,987733,1000731,1013954,1027181,1040635,1054093,1067780,1081471,1095393,1109319,1123478,1137641,1152039,1166441,1181080,1195723,1210605,1225491,1240618,1255749,1271123,1286501,1302124,1317751,1333625
mov $2,$0
add $2,1
mov $3,$0
lpb $2
mov $0,$3
sub $2,1
sub $0,$2
cal $0,230584 ; Either two less than a square or two more than a square.
add $1,$0
lpe
| 128.142857 | 1,594 | 0.817168 | [
"Apache-2.0"
] | jmorken/loda | programs/oeis/298/A298375.asm | 1,794 | Assembly |
; A054888: Layer counting sequence for hyperbolic tessellation by regular pentagons of angle Pi/2.
; 1,5,15,40,105,275,720,1885,4935,12920,33825,88555,231840,606965,1589055,4160200,10891545,28514435,74651760,195440845,511670775,1339571480,3507043665,9181559515,24037634880,62931345125,164756400495,431337856360,1129257168585,2956433649395,7740043779600,20263697689405,53051049288615,138889450176440,363617301240705,951962453545675,2492270059396320,6524847724643285
mov $1,1
trn $1,$0
mov $2,5
lpb $0
sub $0,1
add $2,$1
add $1,$2
lpe
| 45 | 365 | 0.822222 | [
"Apache-2.0"
] | jmorken/loda | programs/oeis/054/A054888.asm | 540 | Assembly |
;===============================================================================
; Copyright 2014-2021 Intel Corporation
;
; Licensed under the Apache 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.apache.org/licenses/LICENSE-2.0
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; See the License for the specific language governing permissions and
; limitations under the License.
;===============================================================================
;
;
; Purpose: Cryptography Primitive.
; Rijndael Inverse Cipher function
;
; Content:
; DecryptECB_RIJ128pipe_AES_NI()
;
;
%include "asmdefs.inc"
%include "ia_emm.inc"
;***************************************************************
;* Purpose: pipelined RIJ128 ECB decryption
;*
;* void DecryptECB_RIJ128pipe_AES_NI(const Ipp32u* inpBlk,
;* Ipp32u* outBlk,
;* int nr,
;* const Ipp32u* pRKey,
;* int len)
;***************************************************************
;%if (_IPP >= _IPP_P8) && (_IPP < _IPP_G9)
%if (_IPP >= _IPP_P8)
;;
;; Lib = P8
;;
;; Caller = ippsRijndael128DecryptECB
;;
segment .text align=IPP_ALIGN_FACTOR
align IPP_ALIGN_FACTOR
IPPASM DecryptECB_RIJ128pipe_AES_NI,PUBLIC
USES_GPR esi,edi,ebx
%xdefine pInpBlk [esp + ARG_1 + 0*sizeof(dword)] ; input block address
%xdefine pOutBlk [esp + ARG_1 + 1*sizeof(dword)] ; output block address
%xdefine nr [esp + ARG_1 + 2*sizeof(dword)] ; number of rounds
%xdefine pKey [esp + ARG_1 + 3*sizeof(dword)] ; key material address
%xdefine len [esp + ARG_1 + 4*sizeof(dword)] ; length(byte)
%xdefine SC (4)
%assign BLKS_PER_LOOP (4)
%assign BYTES_PER_BLK (16)
%assign BYTES_PER_LOOP (BYTES_PER_BLK*BLKS_PER_LOOP)
mov esi,pInpBlk ; input data address
mov edi,pOutBlk ; output data address
mov ecx,pKey ; key material address
mov edx,len ; length
mov eax,nr ; number of rounds
sub edx, BYTES_PER_LOOP
jl .short_input
lea ebx,[eax*SC] ; keys offset
lea ecx,[ecx+ebx*4]
;;
;; pipelined processing
;;
.blks_loop:
movdqa xmm4, oword [ecx] ; keys for whitening
lea ebx, [ecx-16] ; set pointer to the round's key material
movdqu xmm0, oword [esi+0*BYTES_PER_BLK] ; get input blocks
movdqu xmm1, oword [esi+1*BYTES_PER_BLK]
movdqu xmm2, oword [esi+2*BYTES_PER_BLK]
movdqu xmm3, oword [esi+3*BYTES_PER_BLK]
add esi, BYTES_PER_LOOP
pxor xmm0, xmm4 ; whitening
pxor xmm1, xmm4
pxor xmm2, xmm4
pxor xmm3, xmm4
movdqa xmm4, oword [ebx] ; pre load round keys
sub ebx, 16
mov eax, nr ; counter depending on key length
sub eax, 1
.cipher_loop:
aesdec xmm0, xmm4 ; regular round
aesdec xmm1, xmm4
aesdec xmm2, xmm4
aesdec xmm3, xmm4
movdqa xmm4, oword [ebx] ; pre load operation's keys
sub ebx, 16
dec eax
jnz .cipher_loop
aesdeclast xmm0, xmm4 ; irregular round
movdqu oword [edi+0*BYTES_PER_BLK], xmm0 ; store output blocks
aesdeclast xmm1, xmm4
movdqu oword [edi+1*BYTES_PER_BLK], xmm1
aesdeclast xmm2, xmm4
movdqu oword [edi+2*BYTES_PER_BLK], xmm2
aesdeclast xmm3, xmm4
movdqu oword [edi+3*BYTES_PER_BLK], xmm3
add edi, BYTES_PER_LOOP
sub edx, BYTES_PER_LOOP
jge .blks_loop
;;
;; block-by-block processing
;;
.short_input:
add edx, BYTES_PER_LOOP
jz .quit
mov eax, nr
mov ecx, pKey
lea ebx,[eax*SC] ; set pointer to the key material
lea ebx,[ecx+ebx*4]
.single_blk_loop:
movdqu xmm0, oword [esi] ; get input block
add esi, BYTES_PER_BLK
pxor xmm0, oword [ebx] ; whitening
cmp eax,12 ; switch according to number of rounds
jl .key_128_s
jz .key_192_s
.key_256_s:
aesdec xmm0, oword [ecx+9*SC*4+4*SC*4]
aesdec xmm0, oword [ecx+9*SC*4+3*SC*4]
.key_192_s:
aesdec xmm0, oword [ecx+9*SC*4+2*SC*4]
aesdec xmm0, oword [ecx+9*SC*4+1*SC*4]
.key_128_s:
aesdec xmm0, oword [ecx+9*SC*4-0*SC*4]
aesdec xmm0, oword [ecx+9*SC*4-1*SC*4]
aesdec xmm0, oword [ecx+9*SC*4-2*SC*4]
aesdec xmm0, oword [ecx+9*SC*4-3*SC*4]
aesdec xmm0, oword [ecx+9*SC*4-4*SC*4]
aesdec xmm0, oword [ecx+9*SC*4-5*SC*4]
aesdec xmm0, oword [ecx+9*SC*4-6*SC*4]
aesdec xmm0, oword [ecx+9*SC*4-7*SC*4]
aesdec xmm0, oword [ecx+9*SC*4-8*SC*4]
aesdeclast xmm0, oword [ecx+9*SC*4-9*SC*4]
movdqu oword [edi], xmm0 ; save output block
add edi, BYTES_PER_BLK
sub edx, BYTES_PER_BLK
jnz .single_blk_loop
.quit:
REST_GPR
ret
ENDFUNC DecryptECB_RIJ128pipe_AES_NI
%endif
| 30.698864 | 80 | 0.565797 | [
"Apache-2.0"
] | dongbinghua/ipp-crypto | sources/ippcp/asm_ia32/pcprij128decryptecbpipeg9as.asm | 5,403 | Assembly |
; A168046: Characteristic function of zerofree numbers in decimal representation.
; 0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1
mov $2,$0
cal $0,98736 ; a(n) = product of n and all its digits.
lpb $2,1
mov $1,1
trn $2,$0
lpe
| 68.6 | 501 | 0.55102 | [
"Apache-2.0"
] | karttu/loda | programs/oeis/168/A168046.asm | 686 | Assembly |
; A007396: Add 2, then reverse digits!.
; 0,2,4,6,8,1,3,5,7,9,11,31,33,53,55,75,77,97,99,101,301,303,503,505,705,707,907,909,119,121,321,323,523,525,725,727,927,929,139,141,341,343,543,545,745,747,947,949,159,161,361,363,563,565,765,767,967,969,179,181,381,383,583,585,785,787,987,989,199,102,401,304,603,506,805,708,17,91,39,14,61,36,83,58,6,8,1,3,5,7,9,11,31,33,53,55,75,77,97,99
mov $2,$0
mov $0,2
lpb $2
seq $0,4086 ; Read n backwards (referred to as R(n) in many sequences).
add $0,2
sub $2,1
lpe
sub $0,2
| 43.166667 | 341 | 0.677606 | [
"Apache-2.0"
] | ckrause/cm | programs/oeis/007/A007396.asm | 518 | Assembly |
; A183897: Number of nondecreasing arrangements of n+3 numbers in 0..2 with each number being the sum mod 3 of three others.
; 1,7,17,25,34,44,55,67,80,94,109,125,142,160,179,199,220,242,265,289,314,340,367,395,424,454,485,517,550,584,619,655,692,730,769,809,850,892,935,979,1024,1070,1117,1165,1214,1264,1315,1367,1420,1474,1529,1585,1642,1700,1759,1819,1880,1942,2005,2069,2134,2200
add $0,2
mov $2,3
div $2,$0
add $0,2
mul $0,2
add $0,2
sub $2,1
sub $0,$2
pow $0,2
div $0,8
sub $0,11
| 32.533333 | 259 | 0.715164 | [
"Apache-2.0"
] | ckrause/cm | programs/oeis/183/A183897.asm | 488 | Assembly |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.