#include<iostream>
using namespace std;
int searh(int tar,int a[],int n)
{
int i;
int flag;
_asm
{
mov DWORD PTR i, 0
jmp SHORT $L1
$L2:
mov eax, DWORD PTR i
add eax, 1
mov DWORD PTR i, eax
$L1:
mov ecx, DWORD PTR i
cmp ecx, DWORD PTR n
jge SHORT $L4
mov edx, DWORD PTR i
mov eax, DWORD PTR a
mov ecx, DWORD PTR tar
cmp ecx, DWORD PTR [eax+edx*4]
jne SHORT $L3
mov flag, 1
jmp SHORT $L5
$L3:
jmp SHORT $L2
$L4:
mov flag,0
$L5:
}
return flag;
}
int main()
{
int Array[20];
int newArray[20];
int i,k=0;
for (i=0;i<20;i++)
cin>>Array[i];
for (i=0;i<20;i++)
if (!searh(Array[i],newArray,i))
{
cout<<Array[i]<<" ";
newArray[k]=Array[i];
k++;
}
return 0;
}
呵呵!
怎么是汇编啊!!!牛人!!!