Archived

This topic is now archived and is closed to further replies.

Assembly Compiling and Linking (follow up)

This topic is 5170 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I post a question on this topic already (http://www.gamedev.net/community/forums/topic.asp?topic_id=185230). But I want to re-state my problem as I found out that I asked the wrong question. Basically, I''m beginning with assembly programming. I encounter code from a book and from the Internet that look like they run as a stand-alone programs. Although I could compile them with ml.exe into a .obj file, I''m having a confusing time with the linker. For example, I get the following error when I type "link mycode.obj": --------------------------- Microsoft (R) Incremental Linker Version 5.12.8078 Copyright (C) Microsoft Corp 1992-1998. All rights reserved. test2.obj : warning LNK4033: converting object format from OMF to COFF test2.obj : warning LNK4078: multiple ".data" sections found with different attributes (C0220040) LINK : fatal error LNK1561: entry point must be defined --------------------------- Mycode.asm is: --------------------------- dosseg .model small .stack .code write proc mov ah,2h; mov dl,2ah; int 21h mov ah,4ch int 21h write endp end write --------------------------- Essentially, I just want this thing to work so that I could try out things for myself. So, how do I fix this? Or is there an application or emulator out there where you''ll just type in your assembly code, and it will take care of the compiling/linking process and you could see the results of your program right away? Thanks!

Share this post


Link to post
Share on other sites
I think you''ll find it easier to start with inline assembly in a C or C++ compiler rather than from the ground up. If you haven''t done so already, google for a book titled "The Art of Assembly Language" and start reading.

In regard to those error messages, the first suggests that your linker doesn''t like the obj file format produced by your assmembler. It''s also likely that you need to supply your own startup code aka stub code. What you have there is code for a "write" procedure, basically a stand alone function and not a program. What you need is a "Main proc", aka an entry point.

Share this post


Link to post
Share on other sites