News:

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

help with hello world program

Started by xellos, January 25, 2009, 04:24:22 PM

Previous topic - Next topic

xellos

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?

MichaelW

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 . . .
eschew obfuscation

xellos

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.

MichaelW

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.
eschew obfuscation

herge


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
// Herge born  Brussels, Belgium May 22, 1907
// Died March 3, 1983
// Cartoonist of Tintin and Snowy

Fishy

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.

Jimg

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


Fishy

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


Fishy

Yeah i got that.

I figured it out. Everything works good now.


Thank you