Archived

This topic is now archived and is closed to further replies.

Jonus

Please help me with asm (using ML.exe/MASM.exe v7.1)

Recommended Posts

Jonus    170
I am just starting out and i typed in a hello world programm and saved it as a hello.asm file:
.MODEL SMALL
.STACK 256

.DATA
ausgabe DB 'Hallo, Welt',13,10,'$'

.CODE
_start:
	mov ax,@data
	mov ds,ax
	
	mov ax,OFFSET ausgabe
	mov ah,9
	int 21h
	
	mov ah,4ch
	int 21h
	
END _start    
I tried to assemble it with:
ml hello.asm      
but it gives me the error message:
G:\Dev\Asm>ml hello.asm
Microsoft (R) Macro Assembler Version 7.10.3077
Copyright (C) Microsoft Corporation.  All rights reserved.

 Assembling: hello.asm
hello.asm(9) : error A2006: undefined symbol : DGROUP     
What's wrong? I am using the ML that comes with VS.NET 2003. [edited by - Jonus on October 9, 2003 1:23:28 PM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
ML.exe is the assembler.

First I see that you are writing a dos program. I think, but don''t hold me to it, that you are going to need a 16 bit linker as well. Also you need to check the syntax for ML. I think there is a way to assemble your code to be compatible with MASM 5.10 which is what you want. One more thing, I think INT 21h Function 9 requires your string to be in dx.
Try this:

mov ah, 9
lea dx, ausgabe
int 21h

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
Ok you need to do this.
Download the 16 bit linker.
http://download.microsoft.com/download/vc15/Update/1/WIN98/EN-US/Lnk563.exe

Extract Link.exe and rename it to Link16.exe at plop it into the folder with ML.exe. You don''t want to overwrite the existing Link.exe that would be bad.

ML /Bllink16 /Zm hello.asm

Then you should be all set.

Share this post


Link to post
Share on other sites
Jonus    170
I did all that you said, but it still gives me the same error message.
.MODEL SMALL
.STACK 256

.DATA
ausgabe DB 'Hallo, Welt',13,10,'$'

.CODE
_start:
mov ax,@data
mov ds,ax

mov ax,OFFSET ausgabe
mov ah,9
int 21h

mov ah,4ch
int 21h

END _start


The error points still at line 9 with the same error message.

DGROUP has something to do with the @data. This is from the msdn library:
quote:
@data
The name of the default data group. Evaluates to DGROUP for all models except FLAT. Evaluates to FLAT under the FLAT memory model (text macro).

Yes i am trying to write a dos app and i am quit sure the code is correct because it runs perfect with tasm (borland).

[edited by - Jonus on October 10, 2003 2:21:48 PM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
I would try downloading MASM32 from http://www.masm32.com
It has a nice little installer and everything. Maybe it has something to do with ML 7.10 I don''t know.

As for the code. It is not correct.
http://users.win.be/W0005997/GI/dosref.html#int21-09

You must have the string offset in dx. Otherwise it will most likely put a whole bunch of garbage on the screen until it runs across a ''$'' somewhere. It prints whatever the register dx points to.

Share this post


Link to post
Share on other sites
Jonus    170
Hey u Anonymous Poster you're right there was a problem in the code. Thanks for your help.

I know now why this crap didn't work. This is the command to assemble the hello.asm:
ml /omf /Bllink16 /Zm hello.asm 
For the 16-Bit crap to work you have to disable the /coff that ML implicit uses.

Again thanks for your great help to get me started.

[edited by - Jonus on October 10, 2003 4:54:44 PM]

Share this post


Link to post
Share on other sites