Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

ml.exe missing

Options
  • 30-09-2010 9:04pm
    #1
    Registered Users Posts: 85 ✭✭


    Hi all, I'm doing a bit of programming in college (Assembly using Visual C++ 2008 Express downloaded from Dreamsparks). As a basic introduction I'm importing existing code from this site: http://www.kipirvine.com/asm/examples/index.htm

    I try to build one of the examples but it fails as ML.exe is missing. I've tried using a different OS (was using win7 x64 so I installed x86 in case it mattered) but no good. I've also tried reinstalling and cannot find MASM for the 2008 version

    Any ideas? I assume Win7 is good to go normally?


Comments

  • Registered Users Posts: 413 ✭✭noxqs


    I dont believe ml is provided via VS express editions. However, you can get it through the MASM32 package at http://www.masm32.com/

    Remember to add it to your %PATH% environment variable if you want to ease your life a bit. Good luck and let me know if you need any help with assembly. I have programmed in MASM for over a decade :)


  • Registered Users Posts: 85 ✭✭Bomber6


    Many thanks for the help. Ok, installed MASM and copied the ml.exe and ml.err files into the VC/bin folder of Visual C++.
    Now it's throwing the following error:

    Assembling...
    MASM : warning A4018: invalid command-line option : /errorReport:prompt
    MASM : fatal error A1017: missing source filename
    Project : error PRJ0019: A tool returned an error code from "Assembling..."

    Damn program just doesn't want to work for me :(


  • Registered Users Posts: 413 ✭✭noxqs


    I think this is because your environment is not set correctly. It is important that the lib files is available in your path variable, if not, the compiler can not find them and link them. You dont receive a syntax error but effectively an error finding the file to compile.

    Check that you have the MASM lib and bin in your %PATH% before continuing. Also imporant is that the bin and lib of the windows SDK is in your %PATH% if you are INVOKEing any win32 APIs.

    If you still have problems let me know your current setup by pasting the output of cmd.exe "set" command and the file you are trying to compile.


  • Registered Users Posts: 85 ✭✭Bomber6


    I did the set path variables before I think for Java. Have set them I think (I only paste the paths seperated by comma's yes?)
    I'm still getting errors though!

    Assembling...
    MASM : warning A4018: invalid command-line option : /errorReport:prompt
    MASM : fatal error A1017: missing source filename
    Project : error PRJ0019: A tool returned an error code from "Assembling..."

    On a side note, I'm adding existing code main.asm however the code appears differently on my machine to what it should appear as. I'm a true novice when it comes to Assembly so I have very little understanding of what's going on yet
    TITLE MASM Template						(main.asm)
    
    ; Description:
    ; 
    ; Revision date:
    
    INCLUDE Irvine32.inc
    .data
    myMessage BYTE "MASM program example",0dh,0ah,0[B]
    
    posVal REAL10 -999999999999999999.0
    negVal REAL8 -1.5
    intVal REAL8 999999999999999999.0
    
    bcdVal TBYTE 0
    guard BYTE 5 DUP(0FFh)
    
    checkThis TBYTE 987654321
    [/B]
    .code
    main PROC
    	call Clrscr
       [B]
    	fld	posVal		
    	fbstp bcdVal	
       
    	fld	negVal		; -1.5
    	fbstp bcdVal	; rounds down to -2  ( 80 00 00 00 00 00 00 00 02 )
          [/B]
    	mov	 edx,OFFSET myMessage
    	call WriteString
    
    	exit
    main ENDP
    
    END main
    
    All Code in bold shouldn't be there I think.
    Also, from the "set" CMD command
    C:\>set
    ALLUSERSPROFILE=C:\ProgramData
    APPDATA=C:\Users\Stephen\AppData\Roaming
    CommonProgramFiles=C:\Program Files\Common Files
    COMPUTERNAME=WORKOS-LAPTOP
    ComSpec=C:\Windows\system32\cmd.exe
    FP_NO_HOST_CHECK=NO
    HOMEDRIVE=C:
    HOMEPATH=\Users\Stephen
    LOCALAPPDATA=C:\Users\Stephen\AppData\Local
    LOGONSERVER=\\WORKOS-LAPTOP
    NUMBER_OF_PROCESSORS=2
    OS=Windows_NT
    Path=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32
    \WindowsPowerShell\v1.0\,C:\masm32\bin,C:\masm32\lib
    PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
    PROCESSOR_ARCHITECTURE=x86
    PROCESSOR_IDENTIFIER=x86 Family 6 Model 23 Stepping 10, GenuineIntel
    PROCESSOR_LEVEL=6
    PROCESSOR_REVISION=170a
    ProgramData=C:\ProgramData
    ProgramFiles=C:\Program Files
    PROMPT=$P$G
    PSModulePath=C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
    PUBLIC=C:\Users\Public
    SESSIONNAME=Console
    SystemDrive=C:
    SystemRoot=C:\Windows
    TEMP=C:\Users\Stephen\AppData\Local\Temp
    TMP=C:\Users\Stephen\AppData\Local\Temp
    USERDOMAIN=WorkOS-Laptop
    USERNAME=Stephen
    USERPROFILE=C:\Users\Stephen
    VS90COMNTOOLS=C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\
    windir=C:\Windows
    
    Oh and again, thanks for the help!


  • Registered Users Posts: 413 ✭✭noxqs


    Your path syntax is wrong:

    \WindowsPowerShell\v1.0\,C:\masm32\bin,C:\masm32\lib

    it is ; that seperates and not ,

    I copied the files in his VS2010 package to the root of my masm32 folder (I should have sorted it but hey..).

    Run the following command to compile then:

    ml -nologo -c -Zi test.asm
    (I saved your code in test.asm file). This assembles fine once your path variable is correct. (I did a quick set PATH=%PATH%;c:\masm32\bin;c:\masm32\lib)

    Then link with the following:

    link /NOLOGO /SUBSYSTEM:CONSOLE irvine32.lib kernel32.lib user32.lib test.obj /ENTRY:main

    (All of these switches was gathered basically from asm32.bat).

    P.S.

    you are correct about the unnessary code you can just do:
    INCLUDE Irvine32.inc
    .data
    myMessage BYTE "MASM program example",0dh,0ah,0
    .code
    main PROC
    	call Clrscr
    	mov edx, OFFSET myMessage
    	call WriteString
    	exit
    main ENDP
    
    END main
    

    Which should look far less intimidating than the original code :)


  • Advertisement
  • Registered Users Posts: 85 ✭✭Bomber6


    Ok my mistake. Fixed that issue. Still not right though as you can guess. In case it helps here's the command lines section of the buildlog:
    Creating temporary file "c:\Irvine\IrvineExamplesVS2008\ch03\Project\Debug\BAT0000031121168.bat" with contents
    [
    @echo off
    
    ml.exe /c  /nologo /Fo"Debug\Moves.obj" /Fl"Moves.lst" /I "c:\Irvine" /W3 /Zi /errorReport:prompt  /Ta..\Moves.asm
    
    if errorlevel 1 goto VCReportError
    
    goto VCEnd
    
    :VCReportError
    
    echo Project : error PRJ0019: A tool returned an error code from "Assembling..."
    
    exit 1
    
    :VCEnd
    ]
    Creating command line "c:\Irvine\IrvineExamplesVS2008\ch03\Project\Debug\BAT0000031121168.bat"
    Creating temporary file "c:\Irvine\IrvineExamplesVS2008\ch03\Project\Debug\BAT0000041121168.bat" with contents
    [
    @echo off
    
    ml.exe /c  /nologo /Fo"Debug\main.obj" /Fl"main.lst" /I "c:\Irvine" /W3 /Zi /errorReport:prompt  /Ta.\main.asm
    
    if errorlevel 1 goto VCReportError
    
    goto VCEnd
    
    :VCReportError
    
    echo Project : error PRJ0019: A tool returned an error code from "Assembling..."
    
    exit 1
    
    :VCEnd
    ]
    Creating command line "c:\Irvine\IrvineExamplesVS2008\ch03\Project\Debug\BAT0000041121168.bat"
    
    Also note that when I opened the project it had an .asm file called move already opened that I cannot view (I was supposed to open main.asm manually)

    I haven't even started programming in Assembly yet and I already loathe it :mad: :o

    Thanks once again!

    EDIT: Just saw your edit, ignore all the above while I mess around with this. Also, on a side note is blank/white space the same in Assembly as in higher-level languages like Java? (i.e. Ignored)

    EDIT: Assuming that after doing as you say I open the project in C:\masm32\ch03\project in Visual C++ the problem is still recurring. Same message as before. I assume you can write assembly in TextPad and run it without Visual C++? If I could just get code to run on my system I would be happy, for now at least anyway. Also I have contacted the lecturer about the problem so I'm excused from project work until Monday thankfully :)
    And that code looks much nicer :D


  • Registered Users Posts: 413 ✭✭noxqs


    Yes whitespace is ignored.

    I would suggest a simple batch file consisting of the lines:
    ml -nologo -c -Zi test.asm
    link /NOLOGO /SUBSYSTEM:CONSOLE irvine32.lib kernel32.lib user32.lib test.obj /ENTRY:main
    

    Should do - you can copy the lib files to \lib by the way. I am doing this entirely with notepad and cmd.exe - it is the most appropriate for these kind of projects. Alternatively the VS compiler supports inline assembler via __asm {}.


  • Registered Users Posts: 85 ✭✭Bomber6


    Ok I'm still messing with this but I've got loads to do elsewhere. Hopefully by tomorrow evening I'll have something sussed for this. If not I may be looking for a tiny bit more help noxqs :D
    Thanks!


  • Registered Users Posts: 85 ✭✭Bomber6


    Solved. I got to check the Lab Computers yesterday. It seem SP1 for the Visual C++ 2008 Express was installed on their machines. Obviously mine wasn't up to date. I can hear the cry's of always make sure your software is up to date but it wouldn't update by Microsoft Update as intended. Since I couldn't find an SP1-only download I have to download the .iso file containing all express versions of Visual from Microsoft
    Makes you wonder, why distribute the non-SP1 version via Dreamspark if it will cause this hassle. The use of the 2010 example would also have solved the problem I'm told though...

    Thans noxqs for the help. Will file all that for future use :D


Advertisement