News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

compiling masm without VC++

Started by dr3w2k, December 28, 2010, 10:14:57 PM

Previous topic - Next topic

dr3w2k

I'm reading through a book called Assembly Language for Intel-Based Computers 5th edition. I have been compiling my code with Visual Studio C++ express 2008. I was wondering if there was another assembler I could use with this book, other than Visual Studio C++ express 2008.

Thanks.

jj2007

Download the Masm32 package, it includes Masm version 6.14, as \masm32\bin\ml.exe;
or use JWasm, fully compatible with Masm.

dr3w2k

;infinite l00p

INCLUDE C:\Irvine\Irvine32.inc
.data
x dworD 26

.code
main PROC
   MyLoop:
      mov eax, x
      call WriteInt
      jmp MyLoop
      
   
   exit
   
main ENDP

END main





C:\masm32\bin>ml infinitel00p.asm
Microsoft (R) Macro Assembler Version 6.14.8444
Copyright (C) Microsoft Corp 1981-1997.  All rights reserved.

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

/z2
"infinitel00p.obj"
"infinitel00p.exe"
NUL
LINK : warning LNK4044: unrecognized option "z2"; ignored
infinitel00p.obj : warning LNK4033: converting object format from OMF to COFF
LINK : fatal error LNK1181: cannot open input file "infinitel00p.exe"


did not work :(

dedndave

\masm32\bin\ml /c /Fl /coff infinitel00p.asm
\masm32\bin\link /SUBSYSTEM:CONSOLE /OPT:NOREF infinitel00p.obj

i think /c is the trick

/Fl creates an assembler listing
/coff creates a COFF object module
/SUBSYSTEM:CONSOLE is for console apps - for gui apps, use /SUBSYSTEM:WINDOWS

dr3w2k

thank you guys for all the help.
it's still not working right....


C:\asm>ml /c /Fl /coff infinitel00p.asm
Microsoft (R) Macro Assembler Version 6.14.8444
Copyright (C) Microsoft Corp 1981-1997.  All rights reserved.

Assembling: infinitel00p.asm

C:\asm>link /SUBSYSTEM:CONSOLE /OPT:NOREF infinitel00p.obj
Microsoft (R) Incremental Linker Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

infinitel00p.obj : error LNK2001: unresolved external symbol _ExitProcess@4
infinitel00p.obj : error LNK2001: unresolved external symbol _WriteInt@0
infinitel00p.exe : fatal error LNK1120: 2 unresolved externals


once again, here is the code...


;infinite l00p

INCLUDE C:\Irvine\Irvine32.inc
.data
x dworD 26

.code
main PROC
   MyLoop:
      mov eax, x
      call WriteInt
      jmp MyLoop
      
   
   exit
   
main ENDP

END main


dedndave

with Kips lib, you have to add a few items that we all have in windows.inc
ExitProcess PROTO :DWORD
WriteInt    PROTO

place those lines near the beginning of the program

dedndave

better yet
take those PROTO's out and
at the beginning of the program......
        INCLUDE    C:\Irvine\SmallWin.inc
        INCLUDE    C:\Irvine\Irvine32.inc     ;you already have this one
        INCLUDELIB C:\Irvine\Irvine32.lib