News:

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

HELP me im New

Started by bearhug, August 31, 2006, 01:30:41 PM

Previous topic - Next topic

bearhug

Hey everyone im completely new to MASM
i use an older version in college and for assembling and executing a program i use the following code:

masm <filename>.asm
link <filename>.obj
debug <filename>.exe

i have MASM32 ver 9 installed in system in the F drive n these commands don't work in command prompt

Please let me know what should i do to make it work
:dazzled:


mnemonic

That depends on what subsystem you are targeting.
Do you want to assemble 16bit programms, 32bit window application or 32bit console application?

For 16bit programs you need the 16bit linker, rename it to link16.exe after unpacking and put it in the \masm32\bin folder.
Then you can assemble and link as follows:

ml /c prog.asm
link16 prog.obj;


If you deal with the 32bit stuff you might have a look at \masm32\bin folder:

  • build.bat - builds a 32bit window application
  • buildc.bat - builds a 32bit console application

And make sure that the path to \masm32\bin is in your PATH system variable.
Be kind. Everyone you meet is fighting a hard battle.--Plato
-------
How To Ask Questions The Smart Way

bearhug

Thanks a lot for that
im still lost on how to do it..
i pasted the file in MASM\Bin folder and tried assembling it but it did not recognize the command
i basically use it to execute simple ALP's like moving blocks of data, identifying prime non-prime,bubble sort etc

can you please help me out with this?
and what is a path system variable n how do i do it?




w0lfshad3

A system path is a path that is included in the "search" for the file you are running by typing its name at a prompt for example.
Example: you have a file.asm in c:\ like this c:\file.asm and you want to asemble it but the assembler path is different.

In Windows you go My Computer > right click > properties > advanced > environment variables > system variables group > variable path > edit > add assembler path and use semicolon(";") do diferentiate between paths.

After wich you can type ml /c /coff /Cp file.asm from c:\> prompt or write the same in run edit control ( winkey + r )

You can set that variable in autoexec.bat with PATH=c:\assemblerpath for example however i don't know if autoexec runs at all with WinNT :)

And some stuff to get you started if you wish:

If absolutely new to assembly you could start from here:

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

The concept is called win32 assembly or protected mode assembly and its easy.

It requires win32 API knowledge, Charles Petzold "Programming windows 5th edtiotion" is a good book on win32 API but you can get along w/o it as those tutorials are pretty self explanatory.

I started with this:

http://www.drpaulcarter.com/pcasm/ it can propel you pretty fast into the world of assembly alltough you would want to work in masm not nasm.

A visual IDE: http://www.radasm.com/ works with a lot of assemblers and even HLLs

Intel reference books on arhitecture, assembly mnemonics(syntax) etc:

http://www.intel.com/design/pentium4/manuals/index_new.htm

Use flashget's site explorer for example on ftp://download.intel.com/design/pentium/prodchng/, feel free to look at previous directories in the link by deleting on folder at a time from path. Take all this path: ftp://download.intel.com/design/pentium/prodchng/ , for the rest look at teh .html file first because most of the rest of the books you don't need.

Use these links as a manual:

http://webster.cs.ucr.edu/Page_TechDocs/MASMDoc/ProgrammersGuide/

http://web.sau.edu/LillisKevinM/csci240/masmdocs/#MASM%20Reference%20Guide

http://www.ray.masmcode.com/tutorial/index.html

http://www.arl.wustl.edu/~lockwood/class/cs306/books/artofasm/toc.html

Don't forget to destroy the world with the "Hello World" of Death and grow and incompassable ego according to hutch & CO.mpany.

Assembly is easy it just takes a while to learn, and material to learn from.
Here is another forum as well: http://www.asmcommunity.net/board/index.php
Here is a portal: http://webster.cs.ucr.edu/
And the famous Art of Assembly: http://www.arl.wustl.edu/~lockwood/class/cs306/books/artofasm/toc.html
Dont' be afraid to ask questions, alltough there are a lot of jerks out there, there are people who will help you.
Don't feel overwhelmed by all of what you'll see: if you have the patience in 1 month or less i guarantee you will become pretty fluent in it and more self confident.

There are quite an assortment of debuggers out there, recomandable is OLLYDBG, SoftICE can be found out there, IDA is not free but its quite a piece of work.

Oh and don't worry about the "very basic" of assembly; most people when hearing of that will think historically, and real mode programming and DOS are pretty much dead on the PC world of windows and protected programming wich is all the more easy because memory is flat(well it will tell you all about that on every beginning of an protected mode programming tutorial. The very basic of protected mode assembly is learning about using mnemonics, the stack, the fpu, interlacing assembly  with your code by writing .dll s libraries inlining code or calling procedures from other languages and learning to debug of course wich will help you in HLLs debugging as well.

hutch--

hmmmmm,

> Don't forget to destroy the world with the "Hello World" of Death and grow and incompassable ego according to hutch & CO.mpany.

Tread carefully here komrade, there are limits to smartarse wisecracks and you are not all that far off finding it.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

James Ladd

w0lfshad3,
When I first saw your post I thought "wow, how helpful." then I saw the comment mentioned by hutch above.
Why ruin such a great post with crap like that?

bearhug

Thanks  :thumbu
Are all the instructions same for different processors like 8086 n 80386 etc??
or do they differ?

Im basically into 8086 presently




hutch--

bearhug,

The later processors have more instructions and less limitations. Unless you have good reason to work on 8086 instructions only for a 16 bit environment, I would be inclined to start on the easier later stuff. Another main difference is the 16 bit stuff uses WORD size addressing which is limited to 64k where the later 32 bit stuff used DWORD addressing which will address 4 gigabytes.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

bearhug

.model small
.data
x db 10h,20h,30h,40h
y db 4 dup(0)
count db 04h

.code
mov ax,@data
mov ds,ax
xor ax,ax
lea si,x
lea di,y
mov cl,04h

up: mov al,[si]
mov [di],al
inc si
inc di
dec cl
jnz up

mov ah,4ch
int 21h
end





Is there any fault in this program?
while executing it says:

dbm.asm<8> : error A2006: undefined symbol : DGROUP


hutch--

bearhug,

I have moved this to the 16 bit DOS subforum so you have a better chance of getting an answer.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

ninjarider

from what i see in your code your not giving it what processor your using.
.186, .286, etc

somthing i have noticed with my dos applications is that you dont have a different data decleration from the code

also you are missing Start: and end start

LouisStDubois

Whoa, Momma!  Some of these postings are a tutorial in themselves.  Thanks to W0lfshad (hope I got that right!) for the great links, especially the first one.  I been lookin for some instruction in MASM32.  I check on this forum everyday and everyday I learn something.  Thanks again.  EWW