Files
GuideInfrared/编程资料/汇编/Assemble.TestCode/Assemble.TestCode.cpp
2026-02-01 21:55:55 +08:00

93 lines
1.2 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// Assemble.TestCode.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include <stdlib.h>
#include <stdio.h>
#include <windows.h>
void AsmFunc(int* pAddr);
void DoHist(int* pHist, short* pData, int nDataLen)
{
memset(pHist, 0, sizeof(int)*65536);
for(int i = 0; i < nDataLen; i++)
{
pHist[pData[i]+32768]++;
}
}
int _tmain(int argc, _TCHAR* argv[])
{
DWORD nData = 20, nData1 = 1;
int pHist[65536] = {0};
short* pshData = new short[1280*1024 + 4096];
for(int i = 0; i < 1280*1024; i++)
{
pshData[i] = i+1 % 32768;
}
//DoHist(pHist, pshData, 1280*1024);
//delete [] pshData;
//pshData = NULL;
char cData = 1;
_asm
{
inc nData1
;nData1
mov esi, pshData
movzx eax, DWORD PTR [esi]
add esi,2
movzx eax, DWORD PTR [esi]
mov eax, type nData1
mov eax, type nData1
movzx eax,DWORD PTR [nData1]
;xchg eax, ebx ;[nData1]
mov eax,10Q
add eax,10H
//mov nData, eax
}
//AsmFunc(&nData);
delete [] pshData;
pshData = NULL;
int jj = 0;
getchar();
return 0;
}
void AsmFunc(int* pAddr)
{
_asm
{
;
;
;
//push eax
//push ebx
//push ecx
tag1:
mov eax,0x0F
mov ebx,0x10
add eax,ebx
mov ecx,pAddr
mov [ecx],eax
//pop ecx
//pop ebx
//pop eax
}
}