Something went wrong. Try again.
Reactos
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167////////////////////////////////////////////////////////////////////// Copyright (C) Alexander Telyatnikov, Ivan Keliukh, Yegor Anchishkin, SKIF Software, 1999-2013. Kiev, Ukraine// All rights reserved// This file was released under the GPLv2 on June 2015./////////////////////////////////////////////////////////////////////*Module Name:
tools.cpp
Abstract:
This module contains some useful functions for data manipulation.
Environment:
*////////////////////////////////////////////////////////////////////////////////
#ifdef __cplusplusextern "C" {#endif
//----------------
#include "tools.h"
//----------------
#ifdef _X86_
__declspec (naked)void__fastcall_MOV_DD_SWP( void* a, // ECX void* b // EDX ){ _asm { mov eax,[edx] bswap eax mov [ecx],eax ret }}
__declspec (naked)void__fastcall_MOV_DW_SWP( void* a, // ECX void* b // EDX ){ _asm { mov ax,[edx] rol ax,8 mov [ecx],ax ret }}
__declspec (naked)void__fastcall_REVERSE_DD( void* a // ECX ){ _asm { mov eax,[ecx] bswap eax mov [ecx],eax ret }}
__declspec (naked)void__fastcall_REVERSE_DW( void* a // ECX ){ _asm { mov ax,[ecx] rol ax,8 mov [ecx],ax ret }}
__declspec (naked)void__fastcall_MOV_DW2DD_SWP( void* a, // ECX void* b // EDX ){ _asm { mov ax,[edx] rol ax,8 mov [ecx+2],ax mov [ecx],0 ret }}
__declspec (naked)void__fastcall_MOV_MSF( void* a, // ECX void* b // EDX ){ _asm { mov eax,[edx] mov [ecx],ax shr eax,16 mov [ecx+2],al ret }}
__declspec (naked)void__fastcall_MOV_MSF_SWP( void* a, // ECX void* b // EDX ){ _asm { mov eax,[edx] mov [ecx+2],al bswap eax shr eax,8 mov [ecx],ax ret }}
__declspec (naked)void__fastcall_XCHG_DD( void* a, // ECX void* b // EDX ){ _asm { mov eax,[edx] xchg eax,[ecx] mov [edx],eax ret }}
#endif _X86_
#ifdef __cplusplus};#endif