NO

Author Topic: assembler tutorial  (Read 3162 times)

numpad1

  • Guest
assembler tutorial
« 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.

Online Vortex

  • Member
  • *
  • Posts: 867
    • http://www.vortex.masmcode.com
Re: assembler tutorial
« Reply #1 on: September 11, 2011, 09:43:11 PM »
Hi numpad1,

If you are looking for a Pelles C example :

Code: [Select]
#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;
}
Code it... That's all...

CommonTater

  • Guest
Re: assembler tutorial
« Reply #2 on: September 12, 2011, 12:00:50 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....