News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Assembler beginner

Started by $nooc, January 31, 2008, 03:19:20 PM

Previous topic - Next topic

$nooc

hey guys!

well.. i am an absolute "assembler-beginner" and i am here to ask you, if someone knows a good tutorial for me?
i use the MASM32 8.0 under Visual C++ Express Edition!

it would be nice if some one had a tutorial that explains everything step by step.
i noticed that the syntax is different from Assembler to Assembler, so please dont give me a tutorial for TASM or anything else..

thank you guys for any comments!

ps: i am not an absolutely beginner relating to programming.. at home i write applications with C++ but i really would like to use inline assembler under C++. at the one side i'd like to write fast code if it's needed, and at the other side i'm interested in understanding how computers really work.  :U

ToutEnMasm

Hello,
To have a full answer at your question:
See the left upper corner of this page and type Tutorial in the search edit box.Many answers are here.

hutch--

$nooc,

Download the version 10 beta of the masm32 project in the masm32 sub forum. It is compatible with the ML.EXE version 8.0 you have available.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

$nooc

i'm afraid that i have to say:

i can't find something that really helps me!

first of all i don't really know if i set up my environment correctly..

i can't even execute stuff like


; [...]

include \masm32\include\user32.inc

; [...]


because it seems that MASM doesn't know where this .inc file is..
i don't even know what's the difference between user32.inc and user32.lib...

but before i want to link anything, i'd be glad if i could write an executable routine/function.

every tutorial i find starts with confusing stuff like:

    .486                                    ; create 32 bit code
    .model flat, stdcall                    ; 32 bit memory model

but doesn't explain why we create 32 bit code instead of 16 bit.. what effects it has..

i don't even know what the command 'mov' causes..

you see, i really have no plan about anything that relates to assembler..
would you mind posting me a good link for absolute noobs like me?

ragdog

hi

   
Here are a few tutorials to learn masm32

This is very helpful :U :U

http://win32assembly.online.fr/tutorials.html

greets and welcome
ragdog

$nooc

thank you, but..

Quote from: tutorial
This tutorial assumes that the reader knows how to use MASM.

all those tutorials say something like: "I assume that you posses at least basic knowledge of Assembly
language"

ragdog

http://win32assembly.online.fr/tut1.html

answered nevertheless yours ask


.386
.model flat, stdcall  ;32 bit memory model
option casemap :none  ;case sensitive

include    windows.inc

include    user32.inc
include    kernel32.inc
includelib user32.lib
includelib kernel32.lib

.data
szCaption db "information",0
szText db "masm32 example",0

.code
start:
   invoke MessageBox,NULL,addr szText,addr szCaption,MB_OK   
   invoke ExitProcess,0
end start


you can compile with this

make a bat and paste this

c:\masm32\bin\ml.exe /c /coff source.asm

c:\masm32\bin\link.exe /SUBSYSTEM:WINDOWS source.obj



$nooc

ragdog are you kidding me?

i said that i don't understand any line of the assembler language.. so what the hell should i do with this code?
i don't want to know how i use a messagebox, i want to learn the syntax of the assembler language..

why should i use WinAPI, if don't even know how to declare and define variables, functions and so on..

someone wants to build a car..
you would say: this is the gas pedal, this is the break, there is the gear change and here we got our tailgate..

MichaelW

Take a look at \masm32\help\asmintro.hlp, and in the MASM manuals available here:

http://webster.cs.ucr.edu/Page_TechDocs/index.html
eschew obfuscation

jj2007

Quote from: MichaelW on January 31, 2008, 08:26:51 PM
Take a look at \masm32\help\asmintro.hlp
That requires that he took Hutch's advice seriously, i.e. download and install MASM32...
$nooc, how much programming experience do you have, and in which languages? Assembler is not the ideal Beginner's All-purpose Symbolic Instruction Code  :wink

ragdog


$nooc

well... i have experiance with C++ ... i would say that i am away from the "C++ Beginner" - Status

errr...

i already know that the syntax is from assembler to assembler different (TASM, MASM)

what i've prepared:

i use the MASM under Visual C++ Express Edition.
i think i have configured everything right..

visual c++ uses the ml.exe (assembler) as "compiler"
visual c++ uses the console as subsytem..

i've linked my libraries from microsoft sdk, i've linked the headerfiles from miccrosoft sdk

my programm has dependencies from kernel32.lib and user32.lib


i only need to know the syntax of assembler under MASM32..

jj2007

Quote from: $nooc on January 31, 2008, 09:18:33 PM
i only need to know the syntax of assembler under MASM32..
Masm32 uses the standard Microsoft syntax. I assume you have installed Masm32 in the meantime? Then these folders are a must:
C:\masm32\icztutes
C:\masm32\help

Below is a complete Assembler program, for testing if your installation works. Have fun.

include \masm32\include\masm32rt.inc

.code
AppName db "Test",0
Mess db "This is Prog A",0

start: invoke MessageBox, 0, addr Mess, addr AppName, MB_OK
invoke ExitProcess,0
end start

$nooc

well.. it doesn't work..

probably the folders

C:\masm32\icztutes
C:\masm32\help

doesn't exist on my hdd.. but..

i loaded this installation for MASM 8.0

i don't own those ".inc" files,,
i don't even know for what they are needed, but i think they are required by the linker, right?


*EDIT:

i downloaded another masm32 setup, where i found the include files..
the "compiler" says:

Quote
Error   1   fatal error A1000: cannot open file : DirectX   MASM

when i try to execute your code..


MichaelW

Quote from: $nooc on January 31, 2008, 10:20:35 PM
well.. it doesn't work..

probably the folders

C:\masm32\icztutes
C:\masm32\help

doesn't exist on my hdd..

So you need someone to lead you by the hand to do whatever it is that you are trying to do, using only whatever already exists on your hdd?
eschew obfuscation