The MASM Forum Archive 2004 to 2012

Miscellaneous Forums => 16 bit DOS Programming => Topic started by: xellos on January 25, 2009, 04:24:22 PM

Title: help with hello world program
Post by: xellos on January 25, 2009, 04:24:22 PM
im new to asm and i was reading the tut from this site http://www.xs4all.nl/~smit/asm01001.htm

and i wanted to build this example with masm32 but it it doesnt work.


.model small
.stack
.data
message   db "Hello world, I'm learning Assembly !!!", "$"

.code

main   proc
   mov   ax,seg message
   mov   ds,ax

   mov   ah,09
   lea   dx,message
   int   21h

   mov   ax,4c00h
   int   21h
main   endp
end main


can someone please tell me whats wrong?
Title: Re: help with hello world program
Post by: MichaelW on January 25, 2009, 04:50:10 PM
There is nothing wrong that I can see. When I assemble, link, and run it with this batch file, using the version of ML that is included with MASM32, and a 16-bit linker from the forum website:

ML /c xellos.asm
pause
LINK16 xellos.obj;
pause
xellos
pause

I get:

D:\MASMDOS>ML /c xellos.asm
Microsoft (R) Macro Assembler Version 6.14.8444
Copyright (C) Microsoft Corp 1981-1997.  All rights reserved.

Assembling: xellos.asm

D:\MASMDOS>pause
Press any key to continue . . .

D:\MASMDOS>LINK16 xellos.obj;

Microsoft (R) Segmented Executable Linker  Version 5.60.339 Dec  5 1994
Copyright (C) Microsoft Corp 1984-1993.  All rights reserved.


D:\MASMDOS>pause
Press any key to continue . . .

D:\MASMDOS>xellos
Hello world, I'm learning Assembly !!!
D:\MASMDOS>pause
Press any key to continue . . .
Title: Re: help with hello world program
Post by: xellos on January 25, 2009, 05:01:26 PM
i dont understand it i use the masm32 qeditor and then i get those errors but if i make a bat file then it works.
why is that?

so you need to make bat files to compile?
if so can someone please explain how that works?
thanks in advance.
Title: Re: help with hello world program
Post by: MichaelW on January 25, 2009, 05:13:00 PM
QE is set up to create Windows executables. To get an idea of what the differences are, compare the batch file that I provided to the batch files in the masm32\bin directory.
Title: Re: help with hello world program
Post by: herge on March 04, 2009, 03:10:27 PM

Hi  xellos:

MASM32 qeditor is set up to produce 32-bit code.
It uses the 32-bit linker you need the 16-bit linker
to produce 16-bit code.

Regards herge
Title: Re: help with hello world program
Post by: Fishy on March 14, 2009, 02:48:55 PM
Hello im also just beginning to learn assembler.

Im using WisAsm Studio and MASM32.

When im assemble i get the 2 errors:
C:\WinAsm\Projects\Helloworld.asm(9) : error A2004: symbol type conflict
C:\WinAsm\Projects\Helloworld.asm(19) : warning A4023: with /coff switch, leading underscore required for start address : main


I understand that it is not meant to run 16 bit coding but doest understand where i type the code to "link" what your saying.


Thank you for your assistance.
Title: Re: help with hello world program
Post by: Jimg on March 14, 2009, 03:24:57 PM
Hi Fishy,

Try the example in the templates in -

\WinAsm\Templates\DOS\DosExe

notice you need a 16 bit linker.

Also, look at the help file under-

Getting Started / DOS Programs

Title: Re: help with hello world program
Post by: Fishy on March 14, 2009, 04:29:44 PM
I have the 16-bit linker. That template doesn't give any other instructions besides put it into the \masm32\bin folder.

On that template i dont receive any errors just says "Execution failed" when i try to run it.

Where are the help files located?



Thanks
Title: Re: help with hello world program
Post by: Jimg on March 14, 2009, 07:15:55 PM
http://www.winasm.net/help-files.html
Title: Re: help with hello world program
Post by: Fishy on March 14, 2009, 07:18:55 PM
Yeah i got that.

I figured it out. Everything works good now.


Thank you