The MASM Forum Archive 2004 to 2012

Miscellaneous Forums => 16 bit DOS Programming => Topic started by: joseph_1978 on March 21, 2006, 12:01:02 PM

Title: hoo! It is not working!!!
Post by: joseph_1978 on March 21, 2006, 12:01:02 PM
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
      .model tiny      ; 16 bit memory model
      option casemap :none ;case sensitive
.code
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
.STARTUP
   
    call main
main proc
    mov ah,02h
    mov dl,'A'
    int 21h
    ret
main endp
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
end

while I tried to link the above file with ML.exe it threw the error message
--------------------------------------------------------------------------------------------------------------------------------------
test2.obj : warning LNK4078: multiple ".data" sections found with different attributes (C0220040)
LINK : error LNK2001: unresolved external symbol _WinMainCRTStartup
test2.exe : fatal error LNK1120: 1 unresolved externals
_
Link error
Press any key to continue . . .
---------------------------------------------------------------------------------------------------------------------------------------
pls correct the error and give me the right prog.
Title: Re: hoo! It is not working!!!
Post by: Shantanu Gadgil on March 21, 2006, 05:38:58 PM
Seriously dude!!! You need to read the homework rule.  :tdown

You have been warned before by hutch:
http://www.masmforum.com/simple/index.php?topic=4232.msg31729#msg31729

Regarding this:
Quotepls correct the error and give me the right prog.
I know that you are new to the forum and all, but you need to correct the tone of the language.  :naughty: :tdown

The statement you have written sound more of an order than a request! Things could easily get misunderstood especially because you can't actually see the person. Also avoid the chat jargon like "pls", this is _NOT_ chat!!!

An to answer your question....again seriously...you need to hunt some more. Problems similar to this have been answered before!
This is not a clue or anything, just simple advice, hope you take this constructively! :)
Title: Re: hoo! It is not working!!!
Post by: hutch-- on March 21, 2006, 05:46:37 PM
shantanu is right here, no-one will correct your program and give you the right prog but if you make some effort to do your own schoolwork, you may get some help there.

1. You are trying to use the MASM32 project to build 16 it code which it will not do.

2. You need to get the 16 bit linker from the forum web site.

3. You then need to learn the OMF linker syntax so you can build a 16 bit app.
Title: Re: hoo! It is not working!!!
Post by: Rockphorr on March 22, 2006, 11:48:40 AM
call main

main proc
    mov ah,02h
    mov dl,'A'
    int 21h
    ret
main endp

Your call "main" 2 times (1- by call 2- after ret)
Your code is equal

call main
main:
    mov ah,02h
    mov dl,'A'
    int 21h
    ret
ASM is NOT PASCAL
You must add Jmp instruction like this:

call main
jmp exit
main proc
    mov ah,02h
    mov dl,'A'
    int 21h
    ret
main endp
exit:
   mov AH,4Ch
   int  21h