CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2011
    Posts
    7

    Unhappy Hello.asm Compiles without errors yet no Hello.exe generates

    Hello there,
    I am newbi in assembly programming. Kindly consider the following simple hello world program in assembly;


    .model small

    .stack 100h
    .data
    message DB "Hello world !$"

    .code
    main:
    mov ax,@data
    mov ds,ax
    mov dx,offset message

    mov ah,09 ;print contents of DX on STDOUT
    int 21h

    mov ax,4ch ;Terminate to DOS successfully
    int 21h
    end main

    I saved the file as "Hello.asm". To compile, I do this:
    D:\MASM611\BIN>masm Hello.asm;
    Here is the output:
    Microsoft ® MASM Compatibility Driver
    Copyright © Microsoft Corp 1993. All rights reserved.

    Invoking: ML.EXE /I. /Zm /c /Ta Hello.asm

    Microsoft ® Macro Assembler Version 6.11
    Copyright © Microsoft Corp 1981-1993. All rights reserved.

    Assembling: Hello.asm

    Then I am linking like this:
    D:\MASM611\BIN>link Hello;

    After that no .EXE file is created although compiling and linking issues no error:
    D:\MASM611\BIN>dir Hello.*
    Volume in drive D is New Volume
    Volume Serial Number is 667D-17CC

    Directory of D:\MASM611\BIN

    05/20/2012 10:06 AM 252 Hello.asm
    05/20/2012 11:18 AM 166 Hello.obj
    2 File(s) 418 bytes
    0 Dir(s) 15,581,913,088 bytes free

    Kindly help me. If there are no errors then why .EXE is not executed.

    Best Regards

  2. #2
    Join Date
    Dec 2011
    Posts
    7

    Re: Hello.asm Compiles without errors yet no Hello.exe generates

    Hello there, I am much upset due to this problem. I have to solve this before morning, I before going to class. Please help me. It's driving me crazzzyy..

  3. #3
    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    3,654

    Re: Hello.asm Compiles without errors yet no Hello.exe generates

    The /c removes the linkage part. See this http://msdn.microsoft.com/en-us/library/s0ksfwcf.aspx
    Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are, by
    definition, not smart enough to debug it.
    - Brian W. Kernighan

    To enhance your chance's of getting an answer be sure to read
    http://www.codeguru.com/forum/announ...nouncementid=6
    and http://www.codeguru.com/forum/showthread.php?t=366302 before posting

    Refresh your memory on formatting tags here
    http://www.codeguru.com/forum/misc.php?do=bbcode

    Get your free MS compiler here
    https://visualstudio.microsoft.com/vs

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured