News:

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

Where to start ?

Started by TmX, June 13, 2006, 02:13:29 PM

Previous topic - Next topic

TmX

My first encounter with asm is in Win 2000 (MASM32 & HLA).
Back to the good old DOS era, I never learn asm, such as TASM.
So, where to start learning asm, since it very different from another languages,
such as C or Pascal ?

Ossa

Hi TmX, welcome to the board!

You'll find that ASM is nearly as easy as C once you've been using it for a bit, so no need to fear.

There are plenty of tutorials and lots of example code in the MASM32 package (which I assume you have).

It comes with Iczelion's Windows 32-bit Assembly tutorials, but they are also online at: http://spiff.tripnet.se/~iczelion/tutorials.html

As for other resources, I wrote a small tutorial a few years ago which some liked and some didn't: http://ossa.the-wot.co.uk/tutorial_asm1_tex.htm

For reference, you will want to download a copy of the Intel manuals (or the AMD manuals - they cover the same stuff and, yes, anything you write for one will work on the other): http://developer.intel.com/design/Pentium4/documentation.htm (scroll down to the "manuals" section).

Once you have the basics down, you should look at Mark Larson's optimisation tutorials: http://www.mark.masmcode.com/

Of course, if you have any other questions, the great people will be able to help.

Hope some of that helps,
Ossa

(sorry for the "genericness" of the post... I got most of the links from one of my older posts)
Website (very old): ossa.the-wot.co.uk

dsouza123

This is a minimal example of a GUI MASM32 program, MASM32 can also produce console based programs.


; #########################################################################
;
; This is a minimal GUI based program for MASM32.
; It displays a MessageBox, waits for user response, then exits.
;
; It needs to be Assembled & Linked to produce mini.exe
;
; #########################################################################

      .386                   ; minimum CPU needed to run program on
      .model flat, stdcall   ; flat memory model, standard call default
      option casemap :none   ; case sensitive

; #########################################################################

      include \masm32\include\windows.inc  ; predefined values for constants etc
      include \masm32\include\user32.inc   ; include file for user32.dll
      include \masm32\include\kernel32.inc ; include file for kernel32.dll

      includelib \masm32\lib\user32.lib    ; library file for user32.dll
      includelib \masm32\lib\kernel32.lib  ; library file for kernel32.dll

; #########################################################################
    .data
      szDlgTitle    db "Minimum MASM32",0
      szMsg         db "  --- Assembler Pure and Simple ---  ",0

    .code
start:

    ; ------------------------------------------------------------------
    ; The following are the function calls using MASM "invoke" syntax.
    ; It is clearer code, it is type checked against a function prototype
    ; and it is less error prone.
    ; ------------------------------------------------------------------

    invoke MessageBox,0,ADDR szMsg,ADDR szDlgTitle,MB_OK
    invoke ExitProcess,0

    ; ------------------------------------------------------------------
    ; The following are the same function calls using push, call syntax.
    ; ------------------------------------------------------------------

    ; push MB_OK
    ; push offset szDlgTitle
    ; push offset szMsg
    ; push 0
    ; call MessageBox

    ; push 0
    ; call ExitProcess

end start

Mark Jones

"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

TmX

Those are nice  :bg
But ... I need a tutorial on the assembler itself (using opcodes,registers, etc...)
Don't want to rush to Win32 API programming  :bg

Ossa

Once again, take a look at the tutorial I wrote: here

Also Tomas Bleeker's Tutorials here might help.

Ossa
Website (very old): ossa.the-wot.co.uk

dsouza123

In the MASM32 package there are 9 help files,
with 5 addressing assembly language and it's use/formatting in MASM.

They are very easy to access using the MASM32 editor.
Click on Help on the menu and then click on one of the help files.

The direct files are:
opcodes.hlp
masm32.hlp
asmintro.hlp
hlhelp.hlp
fphelp.hlp