Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

masm?

Status
Not open for further replies.

rjwilldohisbest

Technical User
Jun 2, 2001
79
US
Hi All.

I just downloaded the masm32 assembler and have written in an example Hello World prog. I'm using the Qeditor and when I complete the code and select bulid all from the menu tab, I get a fatal error A1000 and a directory that doesn't exist under C:My.asm The target directory is C:/My Documents/assembly/ C:\My.asm directory isn't found through the find files and folders options. Here is what I have:

Listing 1: first.asm
; A simple hello world program.

include \masm32\include\windows.inc ; always first
include \masm32\include\user32.inc ; system include
include \masm32\include\kernel32.inc ; file next

.model small
.stack
.data

Message db "Hello World!!$" ; Message to be displayed.

.code

mov dx, OFFSET Message ; offset of Message is in dx
mov ax, SEG Message ; segment of Message is in ax
mov ds, ax ; ds:dx points to string

mov ah, 9 ; function 9 - displays string
int 21h ; calls the dos service
mov ax, 4c00h ; return to dos DOS

END start ; end here

The assembler cannot locate the asm file?
Do I need to write in autoexec.bat for the save path?
Any advice would be great. Thanks for your time.

RJ
 
Hello,

You are trying to write a DOS program in a Windows-only environment. Write a windows-program, and everything will work fine.
With Masm32, one thing you have to pay attention to is to make your project in a directory below the masm32 directory (for instance C:\MASM32\HELLO).
Also, read iczelion's tutorials, the masm32-versions are included, you can read the texts at Wouter Dijkslag

 
If you intend to do 16-bit DOS programming, I suggest getting an older version of MASM... "Information has a tendency to be free. Which means someone will always tell you something you don't want to know."
 
I downloaded MASM recently from MS's site. It's MASM (ml.exe) version 6.15.
Is this suitable for writing DOS programs?

I have been getting the same error no matter how many tutorials I try, and I know I must be missing something simple.

This is the most basic tutorial code I've tried:
Code:
  .MODEL SMALL
  .STACK 200H
  .CODE
  START:

  mov ah, 2
  mov dl, 1
  int 21h

  mov ah, 4ch
  mov al,00h
  int 21h

  END START
If I try and assemble that, I get the following output from ml.exe:
Assembling: first.asm
Microsoft (R) Incremental Linker Version 6.00.8447
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

/z2
"first.obj"
"first.exe"
NUL
LINK : warning LNK4044: unrecognized option "z2"; ignored
first.obj : warning LNK4033: converting object format from OMF to COFF
LINK : fatal error LNK1181: cannot open input file "first.exe"


If I just run the linker (link.exe) on the first.obj file, I get the following:
Microsoft (R) Incremental Linker Version 6.00.8447
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

first.obj : warning LNK4033: converting object format from OMF to COFF
LINK : fatal error LNK1561: entry point must be defined


Any advice would be greatly appreciated...I'm pulling my darn hair out just getting started! ;)

Thanks,
mark ;)
 
I think:
Your linker is still for Windows... get a DOS linker. I think you can download one from Iczelion's site.

Anyway my post above is a bit incorrect, you can use the newer version, you just need to use a DOS linker.
"Information has a tendency to be free. Which means someone will always tell you something you don't want to know."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top