News:

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

MASM Tutorial

Started by suma, December 29, 2004, 06:28:33 AM

Previous topic - Next topic

suma

Hey sup sup...

I have recently decided to learn ASM, and i am looking for a good tutorial about using the MASM compiler.

I already have a great paper on the language itself (The Art of Assembly), but i cannot find much documentation on the compiler.

For example,
In the code i have seen so far, segments called dseg, cseg, and sseg are declared. These segments r "registered" by the line:      assume cs:cseg, ds:dseg
However this dosn't happen for the stack segment... and i have no idea why.

I am looking for a good tutorial explaning these sort of things about MASM compiler.


Any help would  be much appreciated,
suma

hutch--

Hi suma,

Welcome on board. The type of code you will normally find available these days is 32 bit Windows code rather than DOS code so you don't have any use the segment definitions for a COM file like the code you have posted. Unless you have good reason to write legacy DOS code, I would recommend 32 bit code as its a lot easier, clearer and far faster. It also has more instructions available and less restrictions on how you use many of them.

Now Randy Hyde's HLA is one good starting point. You can also get the MASM32 project if you know your way around compilers and Windows. there are Iczelions classic tutorials and other well written stuff. Have a look on the forum web site for the references.

Just keep this in mind, while almost all compilers come with at least some runtime library, MASM comes with nothing at all so it is impossible by itself to build a working EXE or DLL file by itself. What it means is you must use some runtime functions and with MASM you have the choice. The MASM32 project has a number of simplified library/macros that make it a lot easier to get started and this is similar to the minimum runtime library in a compiler. The other factor that is different to DOS is that you have a massive range of Windows functions available in the API interface.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

suma

Quote from: hutch-- on December 29, 2004, 06:40:00 AMyou don't have any use the segment definitions for a COM file

Ahh icic... I didnt' realize this. The main reason I'm learning ASM is to get a better understanding on the low level stuff... That said, anything i made in ASM would ofcause be for win32.

I downloaded the latest version of MASM32, and I should be able to use the documentation included to figure out any futher problems i may encounter.

Cheers,
Suma