Archived

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

ASM Compile Problem :: Assembly

This topic is 5579 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi. I am trying to compiler my first basic ASM program. I used 16 bits x86 in DOS and used MASM 7.0 (ml.exe) that comes with Visual Studio .NET. Here is the simple code. ----- .MODEL SMALL 586 ; Indicates support for Pentium chip. .STACK 100h .DATA NameOut DB ''My name is Kuphryn. Welcome to ASM programming!.'', 13, 10, ''$'' .CODE Myname PROC mov ax, @data mov dx, ax mov dx, OFFSET NameOut mov ah, 9h int 21h mov al, 0 mov ah, 4ch int 21h Myname ENDP END Myname ----- Here is the errors MASM outputted. ----- Assembling: myname.asm myname.asm(21) : error A2006: undefined symbol : DGROUP myname.asm(31) : warning A4023: with /coff switch, leading underscore required for start address : Myname ----- Does anyone know what the error message indicates? Thanks, Kuphryn

Share this post


Link to post
Share on other sites
I don't know MASM, but all the keyword thingies you spell with capitals are preceded by a "." except the "END" which is at line 21.

...Was that it?

[edited by - Kurioes on September 8, 2002 12:12:47 PM]

Share this post


Link to post
Share on other sites
Thanks.

masm does not like this line.

-----
mov ax, @data
-----

The error is this:

-----
Assembling: myname.asm
myname.asm(21) : error A2006: undefined symbol : DGROUP
-----

Kuphryn

Share this post


Link to post
Share on other sites
for error 2, this means that for the COFF format of binary files, all function and variable names have to have a leading underscore. So where you define your MyName PROC do it like this: _MyName PROC

Also - this program won''t run as is because there is no main entry or exit point to the program. I''m guessing you want to interface it with C++ then? If so, I think you need to make MyName public so that it can be seen by the linker.

Share this post


Link to post
Share on other sites
Okay. Thanks

The problem was I was using the wrong version of Masm. I was using Masm 7.0 which came with Visual Studio .NET. I downloaded Masm 6.15. Everything works.

The only line I needed to change was this line.

-----
mov ds, ax
-----

What is ds and why do you have to move register ax to register ds?

Kuphryn

Share this post


Link to post
Share on other sites