DOS编程 c+ & asm 示例

#include <stdio.h>
#include <string.h>
#include <conio.h>

int main(){
int i,len;

unsigned char name[100]; 

unsigned long check=128; 

printf("\Mp3 Explorer Keygen By : ACiD BuRN [Immortal descendants] \n "); 
printf("\                                                          "); 
printf("\nEnter name: "); 
gets(name); 
len=strlen(name); 

asm
{
xor ecx, ecx
xor edi, edi
mov edx, [len]

start1:
movsx eax, [name+ecx]
cmp eax, 97
jl temp1
cmp eax, 122
jg temp1
sub eax, 32

temp1:
add edi, eax
inc ecx
cmp ecx, edx
jne start1

  mov eax, 120000 
  sub eax, edi 
  mov [check], eax 

}

printf("=: %lu" ,check); /* %lu = decimal, check = serial */ 
printf("\nEnjoy!"); 

getch();
return 0;

}