hello I have just started out with assembler.
I have tasm and masm
and this code:
   .MODEL small
  .STACK 100h
  .DATA
HelloMessage DB 'Hello, world',13,10,'$'
  .CODE
  mov  ax,@data
  mov ds,ax ;set DS to point to the data segment
  mov ah,9 ;DOS print string function
  mov dx,OFFSET HelloMessage ;point to "Hello, world"
  int 21h ;display "Hello, world"
  mov ah,4ch ;DOS terminate program function
  int 21h ;terminate the program
  END



which assembles well with tasm but in masm:

Assembling: C:\lab_1\HELLO1.asm
C:\lab_1\HELLO1.asm(8) : error A2006: undefined symbol : DGROUP
Volume in drive C has no label.
Volume Serial Number is 53B2-6E85

Directory of C:\lab_1

12/13/1998  10:16 PM              450 HELLO1.ASM
              1 File(s)            450 bytes
              0 Dir(s)  5,989,752,832 bytes free



why?
thank you in advance
Posted on 2006-04-15 15:14:08 by para
This is most probably due to the version of the MASM assembler (ML.EXE) which you are using. Versions from 6.15 up will not assemble 16-bit DOS instructions. The @data is the undefined symbol in your case.

Raymond
Posted on 2006-04-15 20:41:03 by Raymond
so how do I make this work? modify the code I mean?
Posted on 2006-04-16 11:04:30 by para
I may have mislead you about the "assembler" version. It's a 16-bit linker version which may be what you need with MASM. However, I would suggest you look at the following thread which will provide important info and a link where you can get the proper linker.

http://www.masmforum.com/simple/index.php?topic=1827.0

Raymond
Posted on 2006-04-16 20:58:52 by Raymond
why is the link censored?
I cannot see it or access it like this

and anyway I don't want to change the linker version to make my code work I want to change my code so as to work with this linker
Posted on 2006-04-17 01:48:38 by para
para, if you want to link 16bit applications, you need the 16bit linker. If you don't want to do 16bit applications, you need to write 32bit code :)

Check out http://www.asmcommunity.net/board/index.php?topic=18392.0. If you're worried about legality of getting the linker from Iczelion's old site, you can start searching ftp.microsoft.com - it's around there somewhere.

As for the link censoring, there's been a bunch of problems with hutch--, so it was decided to censor links to his forum, at least temporarily. Ask SpooK about it or search the forum.
Posted on 2006-04-17 03:32:09 by f0dder
http://www.google.com/search?&q=16-bit+masm

The first link on google leads to http://www.thefreecountry.com/compilers/assemblers.shtml. In that page you find a link to the 16-bit linker hosted by Mircosoft's own FTP (ftp://ftp.microsoft.com/Softlib/MSLFILES/LNK563.EXE), which makes it quite a legal and reliable download I would say. Just to squash any question of legality beyond the standard EULA :)
Posted on 2006-04-17 04:50:56 by SpooK
8)
Posted on 2006-04-17 06:16:19 by f0dder
no, you don't understand I already have a 16 bit assembler called tasm on my box and I am happy with it although I don't know much assembler but that is another story

I wanna make my code work with 32 bit masm
I wanna turn it into 32 bit code
if you could tell me how to do that that would be cool thank you in advance
I don't want any 16 bit version of masm or anything like that
Posted on 2006-04-17 08:03:00 by para

no, you don't understand I already have a 16 bit assembler called tasm on my box and I am happy with it although I don't know much assembler but that is another story

I wanna make my code work with 32 bit masm
I wanna turn it into 32 bit code
if you could tell me how to do that that would be cool thank you in advance
I don't want any 16 bit version of masm or anything like that


So you basically want to know how to create a hello world application using 32 bit masm. Well, get the MASM32 package and create a file named hello.asm with the following source:

.386
.MODEL flat,stdcall
OPTION casemap:none

INCLUDE windows.inc
INCLUDE kernel32.inc
INCLUDE user32.inc
INCLUDE masm32.inc

INCLUDELIB kernel32.lib
INCLUDELIB user32.lib
INCLUDELIB masm32.lib

.DATA
HelloMessage DB 'Hello, world', 13, 10, 0
.CODE
Start:
INVOKE StdOut, OFFSET HelloMessage
INVOKE ExitProcess, NULL
END Start


Then open a command prompt and navigate to the directory where your source file lies. Then type the following commands to build the application.


\masm32\bin\ml /nologo /c /coff /I\masm32\include hello.asm
\masm32\bin\link /nologo /subsystem:console /opt:noref /libpath:\masm32\lib hello.obj


Once you have completed this, go to the \masm32\examples\ directory and start checking out some of the example codes.

Regards,
Bryant Keller
Posted on 2006-04-17 09:31:29 by Synfire