News:

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

In need of a Beginner's Guide

Started by Shooter, November 29, 2010, 06:01:53 PM

Previous topic - Next topic

Shooter

Hello,
I am making that ultimate leap of programming from way back when (nearly 20 years ago) from the DOS 6.22 days of assembly language programming (does anyone remember Interrupt 13??) to something more current, say like Windows XP and such. I grew tired of trying to teach myself OOP as I just couldn't seem to get past all the nuances and such, plus it seems most 'tutorials' just get you through the basics of OOP, but I've not found much that explained HOW they worked.

The problem is, things have progressed so much that I'm basically having to start over.

Is there anyone that can either point me in the right direction or have a handy-dandy guide I could peruse that could help me make that monumental leap? Back in my day we just had a command line text editor, a compiler, and DEBUG as our rudimentary set of tools, but it lacked a GUI.

I want to be able to put together apps such as rich-text editors, music apps such as a customized MP3 player (complete with a comprehensive 1/3 octave EQ, if possible), and perhaps create some wild and crazy graphics that move to the beat of the music.

Is there an editing / compiling program out there that would have a robust set of macros and subroutines, and perhaps a debugger, that exists in a Windows XP GUI format specifically built for assembly language?

Any guidance or help would be greatly appreciated.
Never use direct references to anything ever. Bury everything in
macros. Bury the macros in include files. Reference those include
files indirectly from other include files. Use macros to reference
those include files.

madhur_ahuja

Is there a reason you are directly making a leap to assembly language ? :)

You may want to start with Iczelion tutorials:
http://win32assembly.online.fr/tutorials.html

Note that times have changed. Earlier the target was real mode, now you will be programming for 32 bit protected mode Windows.

dedndave

i made a similar transition a while back
first step is to download and install the masm32 package
there are many examples, help files, and tutorials included, as well as libraries and macros
intel manuals are recommended for new instructions
Iczelions is also a good step to get you started with GUI apps
all the links are in the upper right corner of the page - just poke around a little

Shooter

madhur_ahuja,
I always felt more comfortable using assembly, but when Windows 95 came out it just made programming via assembly useless at the time. I have fiddled with C and C++, as well as the MS Visual Studio since, but can't seem to make any headway because they're OOP based, and I can't seem to wrap my head around it without asking a ton of questions to someone standing over my shoulders.

I'll check out that link now.

Thanks,
Shooter

dedndave,
Are the Intel manuals free to download? They include examples and explanations of the instruction set still, right?
Never use direct references to anything ever. Bury everything in
macros. Bury the macros in include files. Reference those include
files indirectly from other include files. Use macros to reference
those include files.

madhur_ahuja


Shooter

Wow! I forgot some of the simpler things like which register does what. It HAS been a while. Time for some serious review!

Thanks for the links. I'm sure I'll be asking some more questions later.
Never use direct references to anything ever. Bury everything in
macros. Bury the macros in include files. Reference those include
files indirectly from other include files. Use macros to reference
those include files.

GregL

Shooter,

I made the transition back to assembly language about 6 years ago.   I used MASM to write 16-bit DOS programs back in the late 80's and early 90's, when 32-bit Windows came along they told us it was way too hard to write 32-bit Windows programs with Assembly Language, so I didn't use MASM for many years.  When I found MASM32 I was really surprised how easy it was.  Like dedndave said, download the MASM32 package and take a look at the example programs in \masm32\examples.  Then take a look at the help files in \masm32\help.  Start with console mode programs then move on to GUI programs later.  Welcome to the forum.

Here is a "Hello World" console mode program.

INCLUDE \masm32\include\masm32rt.inc

WaitKeyExit PROTO

.DATA

    szHello  BYTE "Hello World from MASM!",13,10,0

.CODE

  start:
 
    INVOKE StdOut, ADDR szHello
   
    INVOKE WaitKeyExit
   
    xor eax, eax
    INVOKE ExitProcess, eax
   
;------------------------------------
WaitKeyExit PROC
    .DATA
        szPrompt BYTE 13,10,"Press any key to exit ... ",0
        szCrLf   BYTE 13,10,0
    .CODE
        INVOKE StdOut, ADDR szPrompt
        INVOKE crt__getch
        .IF (eax == 0) || (eax == 0E0h)
            INVOKE crt__getch
        .ENDIF
        INVOKE StdOut, ADDR szCrLf
        xor eax, eax
        ret
WaitKeyExit ENDP
;------------------------------------   
END start

Shooter

Thank you, GregL. I'm not quite to a point where I will compile anything today, but I'll keep the code handy. I'm still trying to get the softwares situated and get myself acquainted. Speaking of which...

Question... Before I found this forum, I found several different versions of MASM32 packages, with 10r2 being the latest. I noticed that Iczelions only goes to version 7, and another website said version 8. Are these all the same packages with updated libs, incs, and such, or are they completely different versions/programs dealing with MASM32??

MANY thanks,
-Shooter
Never use direct references to anything ever. Bury everything in
macros. Bury the macros in include files. Reference those include
files indirectly from other include files. Use macros to reference
those include files.

madhur_ahuja

Yes 10 is the latest. 7 and 8 were earlier versions and are obsolete now.

brethren

QuoteI want to be able to put together apps such as rich-text editors, music apps such as a customized MP3 player (complete with a comprehensive 1/3 octave EQ, if possible), and perhaps create some wild and crazy graphics that move to the beat of the music.

sounds like you may find easy code useful. heres tutorials
http://www.easycode.cat/English/Tutorial/Chapter1.html

and heres the easycode\goasm download
http://www.masm32.com/board/index.php?topic=6761.msg50301#msg50301

and heres easycode\masm download
http://www.masm32.com/board/index.php?topic=2792.msg21798#msg21798

Shooter

Whew! Thank you, madhur_ahuja. I was beginning to get worried that the various versions were for different OS's or something.

Another Beginner's Guide question...

Does this forum help or aid in the development of custom API's, OCX's, DLL's, and advanced materials like that? Are there any reference materials that can be found on these areas when dealing with Windows?

It will take me a while to get up to that level considering I'm basically starting all over from scratch, but it would be nice to know where to steer my knowledge curve before I get up this mountain, so to speak.

brethren, Thank you for the links. I'll definitely be checking those out. Knowledge is power, and knowing how and where to find things is the most powerful thing a person can know, in my humble opinion.
Never use direct references to anything ever. Bury everything in
macros. Bury the macros in include files. Reference those include
files indirectly from other include files. Use macros to reference
those include files.

jj2007

Hi Shooter,

First of all: Welcome to the forum :U

Don't confuse Masm with Masm32: Masm is Microsoft's Macro Assembler, Masm32 is a library package maintained by hutch with occasional help from forum members. Masm32 contains version 6.14 of Masm, but for advanced work (e.g. with the new SSE instructions) you will need at least Masm 6.15 or JWasm.

Members here are extremely helpful but are divided on the use of macros :green2

Some personal tips, tricks and traps are found here.

madhur_ahuja

Just amazes me the number of assemblers out there after MASM - > GoASM, JWAsm, NASM .... and much more.

Is it that easy to write an assembler ?  :bg


Shooter

I don't know, madhur_ahuja, but right off the bat while attempting to use EasyCode I received an error, "COMMCTRL.INC - Was not found in any of the following folders:" and it lists four folders.

I've searched all of my drives and the original Zip files but alas, it's not anywhere to be found. I googled it and only found mention to it in three locations, all dealing with a tweak  to the file.

Thank you, jj2007 for the clarification and the advice. I was beginning to wonder.
Never use direct references to anything ever. Bury everything in
macros. Bury the macros in include files. Reference those include
files indirectly from other include files. Use macros to reference
those include files.

GregL

Quote from: jj2007Masm32 contains version 6.14 of Masm, but for advanced work (e.g. with the new SSE instructions) you will need at least Masm 6.15 or JWasm.

MASM 6.14 supports SSE, MASM 6.15 supports SSE2.