Can you recommend a good assembly tutorial that can help me understand how to use inline assembly.
Hi numpad1,
If you are looking for a Pelles C example :
#include <stdio.h>
#define a 97
#define z 122
char *szUpper(char *text)
{
__asm{
mov eax, text
dec eax
@repeat:
add eax, 1
cmp BYTE PTR [eax], 0
je @end
cmp BYTE PTR [eax], a
jb @repeat
cmp BYTE PTR [eax], z
ja @repeat
sub BYTE PTR [eax], 32
jmp @repeat
@end:
}
return text;
}
int main(int argc,char *argv[])
{
char message[]="string converted to uppercase";
printf("%s",szUpper(message));
return 0;
}
Quote from: numpad1 on September 11, 2011, 06:39:52 AM
Can you recommend a good assembly tutorial that can help me understand how to use inline assembly.
It's very much like MASM so you should be able to get a good start on it from MASM tutorials.
The Pelles C help file has a considerable amount of exact documentation as well.
Also take a look in the Assembler Discussions forum right here on this board....