News:

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

General Syntax Help

Started by Achilles, January 01, 2005, 08:52:27 PM

Previous topic - Next topic

Achilles

Hello all

I'm trying to learn ASM. I'm a complete noob so plz try to bear with me. I'm using the Book "Assembly Language for the IBM PC" by "KIP R. IRVINE". The syntax it follows is supported by Masm 6.11 but not by Masm8. can you please guide, I'm really stuck here, becuase I have to submit some assignments and I'm without a compiler as yet. The syntax goes here:

dosseg

.model small
.stack 100h

.data



.code

main proc

    mov ax, @data
    mov ds, ax



    mov ax, 4c00h
    int 21h

main endp
end main


This works fine on campus, where we have Masm6.11, but it doesnt work for me when I try it with Masm8. I found and downloaded Masm 6.11, but its kinda messy as well, for example if I complie the following program:

dosseg

.model small
.stack 100h

.data

    message db "This is a string $"


.code

main proc
    mov dx, offset message
    mov ah, 09h
    int 21h


    mov ax, 4c00h
    int 21h

main endp

end main


It should print the string "It is a String" right?, but it prints some ASCII characters, about 3-4 lines of them and then the string "It is a string". can anyone please help?

Thanks in Advance.

Vortex

Before mov dx,offset message, you should insert these two lines below to initialize the data segment:

mov ax, @data
mov ds, ax


Statix Star

http://xorslash.freefronthost.com/

Give a try to the Dark Star Tutorials. It doesn't have much MACROS but it's a great introductory to beginners. You can download my
doc if you want to learn Masm32.

http://www.programmersheaven.com/

It contains lots for tutorials for assembly.

http://webster.cs.ucr.edu/

Go to Assembler and Tools. In Masm then.

Check the AOA for the DOS edition.








Achilles

Thanks alot for all your help. Can u please clarify why the same program wont work with MASM32 Version 8.2. Whenever I'd try to compile it, it gives some errors.

Here are the errors upon Assembling:

Assembling: D:\masm32\wot.asm
D:\masm32\wot.asm(1) : warning A4015: directive ignored with /coff switch
D:\masm32\wot.asm(14) : error A2006: undefined symbol : DGROUP
D:\masm32\wot.asm(27) : warning A4023: with /coff switch, leading underscore required for start address : main


Can you please shed some light. The program being assembled is as under:


dosseg

.model small
.stack 100h

.data

    message db "This is a string $"


.code

main proc
    mov ax, @data
    mov ds, ax
   
    mov dx, offset message
    mov ah, 09h
    int 21h

    mov ax, 4c00h
    int 21h

main endp

end main

Thanks.

Statix Star

#4
You're using the 16-bits architectures. I recommend using http://www.csn.ul.ie/~darkstar/ in ASSEMBLER and download the A86.
The Masm32 it's for the use of 32-bits. If you want to code in the code you just written using Masm32; use http://win32asm.cjb.net/
DOWNLOADS Link version 5.63.
Unpack the link into the masm32\bin and replace it.  http://www.movsd.com/download/topgun1a.zip  Use this NOTEPAD.

save your code as yourfilename.asm in the masm32\bin

START > RUN  TYPE cmd then cd  \ ENTER specify the masm directory.

cd masm32\bin ENTER

Type ml yourfilename.asm ENTER Object was created then  link yourfilename.obj, the EXE was created.

just run yourfilename.exe

Sorry for not explining well, better not use a86. Since the copyrights are some kind of lame. But you can use it if you want.
Run A86 then A86 yourfilename.asm. Be aware of the copyright notice.
Please tell me if it works?

Achilles

#5
Thanks alot  Statix Star

Yes, it does work for me now. I downloaded the LINK version 5.63, unpacked to masm32\bin and everything works fine now.

Also, topgun is a cool text editor, thanks alot for it.

EDIT
Tha A86 doesnt work for me, it marks dosseg as an error.

Statix Star

Oh I see, I didn't knew it. Anyways Masm32 it's much better if you ask Randall Hyde.