Код:
#include <stdlib.h>
#include <stdio.h>
void encode (char* beg);//does not encoding with inline asm
int main()
{
char string[]="This is a test";
printf("Before any action: %s\n",string);
encode(string);
printf("Encoded: %s\n",string);
encode(string);
printf("Encoded again to produce original:%s\n",string);
system("pause");
return 0;
}
void encode (char* beg)
{
__asm mov ebx, beg
__asm keepgo: cmp [ebx],0
__asm je endit
__asm not [ebx]
__asm inc ebx
__asm jmp keepgo
__asm endit:
}