Hi,

I have downloaed the masm assembler and just now downloaded the WinAsm IDE. Can someone help me to get started to learn assembly? Is there anywhere i can get sample code which i can run in winasm, so far i tried writing a program and when i tried assemble it i get errors. I am new to assembly programming can someone direct me to the right direction. thanks
Posted on 2003-12-20 06:55:54 by Programmer_to_be
Hi,

There is a lot of sample code around and you will have all the help you need.

1.Iczelion tutorials.
2.Too much source code in this forum.
3.Samples in the WinAsm zip.

Can you post the error message you get (although I have a suspicion what you are not doing properly)

Regards,

akyprian
Posted on 2003-12-20 07:15:13 by akyprian
Hello akyprian:)

I am really greatful for your reply, i have posted on numerous message boards but i think people dont have time to help. I have programmed a very little in C, java, basic before, so i am totally new to assembly, i have been taught by a friend about assembly however i dont feel like bothering him anymore.

My program i am writing is this (it is taken from some lecture notes someone gave me, so i thought i'd try it out),

TITLE anything (anything.asm);

.model flat, stdcall

.code
main PROC
mov eax, 10000h
add eax, 40000h
sub eax, 20000h
call DumRegs

INVOKE ExitProcess, 0

main ENDP
END main

And also can i ask what type of programs are made in assembly? Is it possible to make GUI programs and console based programs? for example in basic you can print something to a window, can you do that in assembly?

Thank you for your time
Posted on 2003-12-20 15:33:50 by Programmer_to_be
Hi, Sorry i forgot to add that when i open the sample code provided with Win Asm and when i try to run it, i get an error message saying - "Execution failed". Do you know why it fails to execute?

Thanks:)
Posted on 2003-12-20 15:52:44 by Programmer_to_be
Hi, Programmer_to_be. Nice nick ;)
The program you posted seems rather weird... it does really nothing :grin:
It seems like a fragment of a program, maybe you need to write the "DumpRegs" function, wich I presume writes the data from the registers to the console.
Perhaps you're better off reading Iczelion's tutorials, particularly if you're familiar with C or other programming languages. And it's much more gratifying to learn from sources that actually do something besides printing some text ;)
You might also want to get yourself a debugger at some point, it helps when tracking down errors, but also when learning ASM. What this programs do is "simulate" a step-by-step execution of a program, showing you all info from the processor. It's really great to see how opcodes work.
Have fun :)
Posted on 2003-12-20 16:36:29 by QvasiModo

And also can i ask what type of programs are made in assembly? Is it possible to make GUI programs and console based programs? for example in basic you can print something to a window, can you do that in assembly?

Yes, actually anything that can be done in other programming languages can be done in assembly. In fact, all programming languages have to resort to assembly at some point... by learning it you get to know how things really work. :cool:
Posted on 2003-12-20 16:38:47 by QvasiModo
Hi thanks for your reply:)

I was just reading a book about assembly and was surprised to see that every programs made in languages like java or c are compiled into assembly then machine code. Thats great, more reasons to learn assembly!

Can i ask you where i can get Iczelion's tutorials? Thanks
Posted on 2003-12-20 17:12:33 by Programmer_to_be

Hi thanks for your reply:)

I was just reading a book about assembly and was surprised to see that every programs made in languages like java or c are compiled into assembly then machine code. Thats great, more reasons to learn assembly!

Can i ask you where i can get Iczelion's tutorials? Thanks

Yeah, you'll soon become addicted to it, like all of us :grin:

Here's the link to the webpage

Here's the link to the forum

:alright:
Posted on 2003-12-20 17:22:32 by QvasiModo
Hi!

You could also try to compile the samples included in the WinAsm zip just to make sure that you have set up WinAsm properly. A good starting sample would be the SDI. Use Make-Go all to compile and run it. If you get any error messages please let us know!

Regards,

akyprian
Posted on 2003-12-21 15:27:59 by akyprian
Hi thanks for your help guys.

akyprian i ran the sample program called Console. and it worked great, thanks!

I was just wondering when i click on make - > Go all, does that make the executable file?

Do we first need to make - > assemble, or make - > link then we click on make -> go all? What are the differences of these features? Do they do the same thing?

And once i create an executable will it run on any machine?

(I'm sorry if im asking things which are already written somewhere, if my questions are answered somewhere else, please direct me there rather than having me wasting your time!)

Thanks!
Programmer_to_be
Posted on 2003-12-23 07:11:41 by Programmer_to_be
Q.I was just wondering when i click on make - > Go all, does that make the executable file?
A.YES

Q.Do we first need to make - > assemble, or make - > link then we click on make -> go all? What are the differences of these features? Do they do the same thing?
A.No. Go all assembles, compiles any resources you may have, links and runs if your project concerns an executable.

Q.And once i create an executable will it run on any machine?
A.If it is bug free!!


Regards,

akyprian
Posted on 2003-12-23 09:59:46 by akyprian
Hi!

Anyone know any links to tutorials for console based programs? I would like write a simple console based program, say for example the traditional "hello world" app in assembly using WinAsm, can anyone guide me to the right direction.

Thanks again.:)
Posted on 2003-12-23 11:20:58 by Programmer_to_be
Hi!

Anyone know any links to tutorials for console based programs? I would like write a simple console based program, say for example the traditional "hello world" app in assembly using WinAsm, can anyone guide me to the right direction.

Thanks again.:)
Posted on 2003-12-23 11:33:27 by Programmer_to_be
I don't remember any tutorials on this, but here's a list of APIs related to consoles:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/console_functions.asp

The most important ones (and the ones you should read about first) are:

GetStdHandles
WriteConsole
ReadConsole
WriteFile
ReadFile

The last two are actually file related, but you can treat the std handles as files and it works just the same. The first one is for obtaining the handles to read and write to the console.
:alright:
Posted on 2003-12-23 16:34:55 by QvasiModo
Hi,

Why don't you have a look at Easy Code?

Easy Code is a new assembler visual IDE looking like Visual basic. It includes two examples (one of them is a complete CD Player). Try it! You'll like it!

Available at:

http://www.elprogramari.com/English/Download/EasyCode.zip


Easy Code needs MASM32 (available at www.masm32.com) to build the projects.

Regards,

rsala
Posted on 2004-01-19 07:49:24 by rsala