Skip to main content
GameDev.net gamedev.net
🔒 Locked

WinAsm problem (or maybe linking problem?)

Started by Ilankt Dec 19, 2004 at 10:37 AM 2 replies 800+ views
Original Post
Ilankt
Ilankt
I'm trying to link a dos assembly code, and I get a weird error... I'm using a 16bit linker for dos applications, and the code is getting assemblied, but failed in linking. here is the code:

.model tiny
.data
      msg   db "This is a 16-bit DOS .COM executable",13,10,"Hello World!",13,10,"$" ; The string must ends with a $
.code
	.startup
	mov   dx,offset msg ; Get the address of our message in the DX
	mov   ah,9			; Function 09h in AH means "WRITE STRING TO STANDARD OUTPUT"	
	int   21h			; Call the DOS interrupt (DOS function call)
	
	mov   ah,0			; Call bios function "GET KEYSTROKE"
	int   16h
	.exit
end

and here is the linking error

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

LINK : fatal error L1093: and Settings\Ilankt\Desktop\Programming\WinAsmFull304b\masm32\bin\Link16 @D:\Documents and Settings\Ilankt\Desktop\Programming\Assembly Projects\test1\link.war : object file not found

Make finished. 1 error(s) occured.
How appropriate, you fight like a cow!
JOL
JOL
well - obviously the linker doesn't find the object file... :)
but heres a idea anyway...
maybe you should try putting the object file in a folder with only short folder names and without spaces.
not these
../Documents and Settings/...
since the linker is a old 16bit and all...
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~I'm looking for work
Namethatnobodyelsetook
Namethatnobodyelsetook
I believe .model tiny is for .com files (.small is for small exes with code and data segments). COM files must have an entry point of 0x100, and nothing can come before it.

You can do this:

.model tiny
.code
org 100h
start:
...code here...
.data ; note there is no point of .data in tiny
...data here...
end start

Or you can do a
org 100h
start: jmp realstart
db data
realstart:
...code...
end start
Ilankt
Ilankt
well, I found it's a bug with dos projects in winasm...
ohh well, I'll use command line for now :-)
How appropriate, you fight like a cow!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.