MrDoomMaster
February 21st, 2004, 01:27 PM
Hey guys, I'm in a college class for Assembly right now, and at the moment we're using MASM 6.11 (which is all dos commands) to compile and link our assembly programs. I really dread the DOS environment, and since I have Visual Studio 2003 .NET Enterprise, I figured there has to be a way to do all of the assembly work in it!
So far I have created a custom build which uses the file C:\masm611\bin\ml.exe to compile and link a .ASM file into a .EXE.
I went to TOOLS >> EXTERNAL TOOLS and created a custom build with the following information:
---------------------------------------------------------
TITLE: Assemble/Link .EXE (MASM)
COMMAND: C:\MASM611\BIN\ML.EXE
ARGUMENTS: $(ItemDir)$(ItemFileName).ASM
INITIAL DIRECTORY: $(ItemDir)
(also enabled 'Use Output Window')
---------------------------------------------------------
This information provides a button on the TOOL menu to compile and link my ASM code.
To test this, I entered the following code:
PAGE 60,132
TITLE ASM1 (EXE) simple proggy
;-----------------------------------------------------
STACK SEGMENT PARA STACK 'Stack'
STACK ENDS
;-----------------------------------------------------
DATASEG SEGMENT PARA 'Data'
DW 32 DUP (0)
DATASEG ENDS
;-----------------------------------------------------
;-----------------------------------------------------
CODESEG SEGMENT PARA 'Code'
MAIN PROC FAR
ASSUME SS:STACK, DS:DATASEG, CS:CODESEG
MOV AX,DATASEG
MOV DS,AX
MOV AX,4C00H
INT 21H
MAIN ENDP
CODESEG ENDS
END MAIN
This is the basic assembler code for any EXE program. This code compiles perfectly when I use MASM611 from DOS to compile and link, with no errors. Yet when I use VS.NET to compile this very same code, I get the following information in my output window:
Microsoft (R) Macro Assembler Version 6.11
Copyright (C) Microsoft Corp 1981-1993. All rights reserved.
Assembling: C:\Programming\Assembler\Solution1\Untitled1.ASM
Microsoft (R) Incremental Linker Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
/z2
"Untitled1.obj"
"Untitled1.exe"
NUL
LINK : warning LNK4044: unrecognized option "z2"; ignored
LINK : warning LNK4044: unrecognized option "r"; ignored
LINK : error : Segment reference in fixup record
Untitled1.obj : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
I know it is so possible to use the VS.NET IDE to compile this code... I hope someone can help! Thanks a lot!
So far I have created a custom build which uses the file C:\masm611\bin\ml.exe to compile and link a .ASM file into a .EXE.
I went to TOOLS >> EXTERNAL TOOLS and created a custom build with the following information:
---------------------------------------------------------
TITLE: Assemble/Link .EXE (MASM)
COMMAND: C:\MASM611\BIN\ML.EXE
ARGUMENTS: $(ItemDir)$(ItemFileName).ASM
INITIAL DIRECTORY: $(ItemDir)
(also enabled 'Use Output Window')
---------------------------------------------------------
This information provides a button on the TOOL menu to compile and link my ASM code.
To test this, I entered the following code:
PAGE 60,132
TITLE ASM1 (EXE) simple proggy
;-----------------------------------------------------
STACK SEGMENT PARA STACK 'Stack'
STACK ENDS
;-----------------------------------------------------
DATASEG SEGMENT PARA 'Data'
DW 32 DUP (0)
DATASEG ENDS
;-----------------------------------------------------
;-----------------------------------------------------
CODESEG SEGMENT PARA 'Code'
MAIN PROC FAR
ASSUME SS:STACK, DS:DATASEG, CS:CODESEG
MOV AX,DATASEG
MOV DS,AX
MOV AX,4C00H
INT 21H
MAIN ENDP
CODESEG ENDS
END MAIN
This is the basic assembler code for any EXE program. This code compiles perfectly when I use MASM611 from DOS to compile and link, with no errors. Yet when I use VS.NET to compile this very same code, I get the following information in my output window:
Microsoft (R) Macro Assembler Version 6.11
Copyright (C) Microsoft Corp 1981-1993. All rights reserved.
Assembling: C:\Programming\Assembler\Solution1\Untitled1.ASM
Microsoft (R) Incremental Linker Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
/z2
"Untitled1.obj"
"Untitled1.exe"
NUL
LINK : warning LNK4044: unrecognized option "z2"; ignored
LINK : warning LNK4044: unrecognized option "r"; ignored
LINK : error : Segment reference in fixup record
Untitled1.obj : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
I know it is so possible to use the VS.NET IDE to compile this code... I hope someone can help! Thanks a lot!