Thursday, December 16, 2010

An introduction to Assembly language

These days i don't have much time to get involve in C/C++, assembly and my loving researches on Computer vision things because i have to complete projects and assignments and also prepare for the last examination of my bachelors degree. however today i did some experiments with assembly by writing a simple media player and a email sending(kind of a keylogger though ;) ) application and i found a new IDE(new for me but it is not a new IDE :) ) for assembly. so i will explain how to configure that IDE first. remember i am not going to start a tutorial series in assembly but i hope to tell how to write some few simple applications in assembly.(not today :) because i have to complete my part of the group project)
  1. first of all download this zip file and unzip it into a desired location. then you have to download MASM32 because it's not coming with WinAsm.
  2. install MASM32 (for an example to C:\masm32)
  3. go to unzipped WinAsm folder double click and run WinAsm.exe
  4. before writing any application for the first time you have to set some variables
  5. go to tools -> Options you will get something like this
      6. then select Files & Path tab
      7.  edit the path variables as you installed then and then press ok...

right now you are done. so if you have some sort of a knowledge in assembly you can start coding. or i will give you a simple assembly code to test the IDE

go to file -> New project and create a standard EXE project. then simply copy and paste the below code :
.386
.model flat,stdcall
option casemap:none
include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
includelib \masm32\lib\kernel32.lib
include \masm32\include\user32.inc
includelib \masm32\lib\user32.lib

.data
MsgBoxCaption    db "Keshan's Tech Gossipz",0
MsgBoxText     db "I love Win32 Assembly !",0

.code
start:
invoke MessageBox, NULL, addr MsgBoxText, addr MsgBoxCaption, MB_OK
invoke ExitProcess, NULL
end start

now go to Make -> Go All. this program will show a dialog box !!  

cheers !
Kesh