News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Error MSB3721 when trying to compile simple program

Started by revolution9540, September 11, 2015, 05:35:45 AM

Previous topic - Next topic

revolution9540

I am learning Assembly Language (x86) and I need to figure out how to make a register overflow using only variables rather than intermediate values.

I with to overflow the AX register by putting FFFF into a variable, moving that variable into AX, and then incrementing AX. However, I am running into problems. First off, I go to declare a WORD variable like this:

limitReg WORD 0

Then later on in .code I do this:

MOV limitReg, FFFFh
MOV ax, limitReg


However, I get the following error:

error MSB3721: The command "ml.exe /c /nologo /Zi     /Fo"Debug\pa2.obj" /Fl"PA2.lst" /I "C:\Irvine" /W3 /errorReport:prompt  /Ta..\..\..\..\..\..\..\Irvine\Examples\ch03\pa2.asm" exited with code 1.   C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\BuildCustomizations\masm.targets   50

I receive no other errors. Can someone please help me out?

Here is the entire code:

INCLUDE Irvine32.inc

.data; the data segment
limitReg WORD 0

.code         ; start code segment
main PROC ; start the main procedure

SUB ax, ax; zero out all registers to be used by subtracting their contents from themselves

MOV limitReg, FFFFh
MOV ax, limitReg


call DumpRegs ; dump the registers
exit

main ENDP ; end of main procedure
END main ; end of source code


FORTRANS

Hi,

   If you use MASM, hexadecimal values need to start with a number.
so FFFFH should be 0FFFFH.

Steve

dedndave

here is a template for Irvine32 code

notice the paths of the files - you may need to modify them

the floatio.inc, graphwin.inc, and macros.inc files are optional
you may not need them, but it won't hurt to add them if not used

the lib files are needed

the option casemap directive forces case-sensitivity in symbol names
you can leave it out, if desired, but i don't recommend it
;###############################################################################################

        INCLUDE     \Masm32\Irvine\Irvine32.inc  ;adds SmallWin.inc, VirtualKeys.inc

        OPTION      CaseMap:None

        INCLUDE     \Masm32\Irvine\floatio.inc
        INCLUDE     \Masm32\Irvine\GraphWin.inc
        INCLUDE     \Masm32\Irvine\macros.inc

        INCLUDELIB  \Masm32\Irvine\kernel32.lib
        INCLUDELIB  \Masm32\Irvine\user32.lib
        INCLUDELIB  \Masm32\Irvine\Irvine32.lib

;###############################################################################################

        .DATA

szMessage db 'Hello World',13,10,0

;***********************************************************************************************

        .DATA?

;###############################################################################################

        .CODE

;***********************************************************************************************

main    PROC

        mov     edx,offset szMessage
        call    WriteString

        call    WaitMsg
        INVOKE  ExitProcess,0

main    ENDP

;###############################################################################################

        END     main