Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Compiling MASM programs...
#1
I just got a MASM compiler and I finaly figured out how to make .obj files. I can't figure out how to make .coms or .exes directly. Can MASM32 make program files? How? If not, is there any way I can convert .obj files to .com or .exe files? Thanks!
Reply
#2
You need a linker (LINK.EXE, for example). Look in your masm distro, there should be one.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#3
Thanks! but I have one problem. Every time I try to assemble this peice of code...

Code:
.MODEL medium
.386
.STACK 100h
.CODE

mov ax,13h    
int 10h
mov ax,4Ch        
int 21h

END

...it makes the obj file but it doesn't link. It gives me this error...

Code:
Microsoft (R) Macro Assembler Version 6.14.8444
Copyright (C) Microsoft Corp 1981-1997.  All rights reserved.

Assembling: C:\masm32\test2.asm
Microsoft (R) Incremental Linker Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

test2.obj : warning LNK4078: multiple ".data" sections found with different attr
ibutes (C0220040)
LINK : error LNK2001: unresolved external symbol _WinMainCRTStartup
test2.exe : fatal error LNK1120: 1 unresolved externals
_
Link error
Press any key to continue . . .

The error message says there are "multiple ".data" sections found with different attributes" but I don't have a ".data" statement in my code. How do I fix this?
Reply
#4
I don't know if this is the same problem, but I think you need to specify the entry point, like so:
Code:
.MODEL medium
.386
.STACK 100h
.CODE

start:
mov ax,13h
int 10h
mov ax,4Ch
int 21h

END start

Also, that assembler looks like a DOS program, but the error message is as if you're trying to link it as a Windows exe...
Reply
#5
In MASM there is a switch / that specifies you want to link after assemble. I primarily use TASM so I don't know the switch.

Try MASM /?
y smiley is 24 bit.
[Image: anya2.jpg]

Genso's Junkyard:
http://rel.betterwebber.com/
Reply
#6
Reading the documentation would also come handy Wink
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)