The MASM Forum Archive 2004 to 2012

Specialised Projects => Compiler Based Assembler => Assembler With Microsoft Visual C => Topic started by: Tron2.0 on January 13, 2010, 03:59:26 PM

Title: Using Visual C++ Express...
Post by: Tron2.0 on January 13, 2010, 03:59:26 PM
Hello to everybody....
My first post for a one little question.
It's possible to use Visual C++ 2008 Express (or another edition) to write own commercial software?
I mean, can i code my micro videogames and sell them (and get rich) without any legal question from Microsoft?
I'm sorry in advance if this question was debated elsewhere, but i have found nothing....
Oh, one more thing... it's almost 20 years from the last time that i had wrote something in english, so it's possible that i have killed the grammar with my sentences....is it?
Title: Re: Using Visual C++ Express...
Post by: oex on January 13, 2010, 05:13:28 PM
I think Express is like a student version, I think you require professional to redistribute but I'm not entirely sure

If you havent bought yet you could email Microsoft and describe your basic needs
Title: Re: Using Visual C++ Express...
Post by: Vortex on January 13, 2010, 06:38:31 PM
Hi Tron2.0,

Welcome to the forum.

I think you need to read the license coming the Visual C++ Express Package to get the correct answer.
Title: Re: Using Visual C++ Express...
Post by: hutch-- on January 14, 2010, 09:37:32 AM
Tron,

This is the action and if I read it correctly the answer is YES as long as you,

1. Write the software only for the Windows Operating System.

2. Do not try and distribute it under an Open Source licence.

Quote
a.      Installation and Use.  You may install and use any number of copies of the software on your devices to design, develop and test your programs that run on a Microsoft Windows operating system.  Further, you may install, use and/or deploy via a network management system or as part of a desktop image, any number of copies of the software on computer devices within your internal corporate network to design, develop and test your programs that run on a Microsoft Windows operating system.  Each copy must be complete, including all copyright and trademark notices.  You must require end users to agree to the terms that protect the software as much as these License terms.
Title: Re: Using Visual C++ Express...
Post by: z941998 on January 14, 2010, 12:36:22 PM
@Hutch: I read your quoted statement to apply only to the Express software only, and in what the user can do to setup a good IDE, but the user could not resell/redistribute Express without violating the agreement.  However, if I developed a Bingo program that ran on any platform or OS, and distributed it without Express I would think that this would be ok.  If not, then what?

@Tron2.0:  Welcome on board.

Steve
Title: Re: Using Visual C++ Express...
Post by: Tron2.0 on January 14, 2010, 03:12:35 PM
Thank you very much for the replies.
Title: Re: Using Visual C++ Express...
Post by: Tron2.0 on January 14, 2010, 05:13:15 PM
Ok i have installed Visual C++ 2008 Express and picked ML and the other binaries to copy them to the directory that i use for RadAsm with Win32Inc.
Now i get an error....

E:\DevsArea\MAsm32Extend\Bin\ML.EXE /c /coff /Cp /Zi /nologo /I"E:\DevsArea\MAsm32Extend\Include" "Masm9.asm"
Assembling: Masm9.asm

MASM : fatal error A1016: Internal error

  Version 9.00.30729.01

  ExceptionCode            = C0000005
  ExceptionFlags           = 00000000
  ExceptionAddress         = 0041BFF5 (00400000) "E:\DevsArea\MAsm32Extend\Bin\ML.EXE"
  NumberParameters         = 00000002
  ExceptionInformation[ 0] = 00000000
  ExceptionInformation[ 1] = 014D0015

CONTEXT:
  Eax    = 0044ACD4  Esp    = 0013F650
  Ebx    = 0013F7EC  Ebp    = 0013F988
  Ecx    = 00BE5FDD  Esi    = 014D0015
  Edx    = 00000001  Edi    = 0013F65C
  Eip    = 0041BFF5  EFlags = 00010202
  SegCs  = 0000001B  SegDs  = 00000023
  SegSs  = 00000023  SegEs  = 00000023
  SegFs  = 0000003B  SegGs  = 00000000
  Dr0    = 00000000  Dr3    = 00000000
  Dr1    = 00000000  Dr6    = 00000000
  Dr2    = 00000000  Dr7    = 00000000

Make finished.
Total compile time 3203 ms


The code is very simple...

.686
.model      flat, stdcall
.stack      2 * 1024
option      casemap:none

WIN32_LEAN_AND_MEAN   equ   1

include   WINDOWS.INC
includelib   USER32.LIB

.code
start:
      invoke   ExitProcess,0
end start

I was only testing the Win32Inc with the new ML....
Building the code with VC2008 give the same error....
Any idea?
Title: Re: Using Visual C++ Express...
Post by: dedndave on January 14, 2010, 05:20:38 PM
ExitProcess is in kernel32
but - try this...

        INCLUDE \masm32\include\masm32rt.inc

        .CODE

_main   PROC

        INVOKE  ExitProcess,0

_main   ENDP

        END     _main

masm32rt.inc has the model, processor set to .486 (you can set it to .686 afterwards), etc
it also includes the required LIBs and INCs to do most stuff   :U
take a look inside that file
Title: Re: Using Visual C++ Express...
Post by: Tron2.0 on January 14, 2010, 06:17:41 PM
So, it's not possible to use the Win32Inc package?
I don't understand: switching to the previous version of ML, all works fine and without errors, so WHY the new can't?
(Obviously, i have changed the USER32.LIB to KERNEL32.LIB..... :lol)
Title: Re: Using Visual C++ Express...
Post by: dedndave on January 14, 2010, 06:31:58 PM
in the masm32 package, there is also a kernel32.inc to go with that
it has all the prototypes for the functions in the kernel32.dll library
assuming the LIB and INCLUDE path variables are set up properly in your environment....

      include    kernel32.inc
      includelib kernel32.lib

the c0000005 error says that ML.EXE is trying to access memory that it has no permission for
i have never seen the assembler throw that error - usually it is the programs i write myself   :P
Title: Re: Using Visual C++ Express...
Post by: hutch-- on January 15, 2010, 02:08:27 AM
you should not use the .STACK operative, its a DOS leftover. In a PE file you set the stack reserve and commit in the linker options.
Title: Re: Using Visual C++ Express...
Post by: Tron2.0 on January 15, 2010, 02:29:27 PM
Hutch, it's not the .stack keyword that cause the error.
If i use the previous version of ML, i get no error....
Maybe ML9 require something in the same directory to work correctly?
I have copied all the files present in the bin directory of VisualC++2008 to the work directory of RadAsm....what else?

Title: Re: Using Visual C++ Express...
Post by: dedndave on January 15, 2010, 03:14:21 PM
some versions of ML require the ML.ERR file to be present
it is essentially a file full of error strings
i thought it had been done away with for ML 9, though
Hutch is right - get rid of the .STACK directive - it may be ignored, anyways

maybe you just have a gorfed file - d/l a fresh copy if you think that's the case
Title: Re: Using Visual C++ Express...
Post by: Tron2.0 on January 15, 2010, 03:18:37 PM
I have tried, but don't work. Assembling stop with the same error.... :red
Nobody tried if the code works on own pc?
Title: Re: Using Visual C++ Express...
Post by: dedndave on January 15, 2010, 03:27:46 PM
i use MASM 6.15
but, i do not have VS or VC
(actually, i may have VS installed, but i only use it for some libraries - lol)

questions - did you install the masm32 package ?
i see that you are on the E: drive - hopefully, all the files are on the same drive - that can cause issues
at the DOS prompt, type "SET" - it will show you your environment variables
if you do not explicitly specify paths for LIBs and INCs, masm will look at the paths defined in the environment
hope that helps...

        .686
        .model  flat, stdcall
        option  casemap:none

        include    kernel32.inc
        includelib kernel32.lib

        .code
start:
        invoke  ExitProcess,0
        end     start

that is about as simple as it gets - lol
if it wil not assemble, there is something wrong with the way you have things set up   :U
Title: Re: Using Visual C++ Express...
Post by: TNick on January 15, 2010, 03:32:29 PM
With the new ml from Visual Studio Express
QuoteMicrosoft (R) Macro Assembler Version 9.00.30729.01
I use a batch file like this:
Quote
@ECHO OFF
TYPE nul > Junk.txt

call "Clean.bat"

@ECHO OFF
call "C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat" >> Junk.txt
ECHO. >> Junk.txt
ECHO . . . . . . . . . . . . . . . . . . . . . . . . >> Junk.txt
ECHO. >> Junk.txt

"C:\masm32\bin\RC.EXE" /v "AxyGenV2.rc" >> ../Junk.txt
ECHO. >> Junk.txt
ECHO . . . . . . . . . . . . . . . . . . . . . . . . >> Junk.txt
ECHO. >> Junk.txt
IF NOT %ERRORLEVEL% == 0 GOTO TST_Asm_E
"C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\ML.EXE" /c /coff /Cp /Zi /Zd /nologo /I"C:\MASM32\INCLUDE" AppName.Asm >> Junk.txt
ECHO. >> Junk.txt
ECHO . . . . . . . . . . . . . . . . . . . . . . . . >> Junk.txt
ECHO. >> Junk.txt
IF NOT %ERRORLEVEL% == 0 GOTO TST_Asm_E
"C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\LINK.EXE" /SUBSYSTEM:WINDOWS /DEBUG /LIBPATH:"C:\MASM32\LIB" /OUT:"AppName2.exe" AppName.obj >> Junk.txt
IF NOT %ERRORLEVEL% == 0 GOTO TST_Asm_E
ECHO. >> Junk.txt
ECHO . . . . . . . . . . . . . . . . . . . . . . . . >> Junk.txt
ECHO. >> Junk.txt


del /q Junk.txt
ECHO ////////////////////////////////////////////////
ECHO ------------------------------------------------
ECHO _       B U I L D     S U C C E S S F U L      _
ECHO ------------------------------------------------
ECHO \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

GOTO EXITM


:TST_Asm_E
POPD
ECHO =================================================
ECHO /
ECHO APP COULD NOT BE ASSEMBLED
ECHO ERRORLEVEL IS %ERRORLEVEL%
ECHO \
ECHO =================================================
TYPE Junk.txt
ECHO =================================================

PAUSE


:EXITM
@ECHO ON


See if calling that bat file will do any good.
You may replace the paths with fully qualified paths to see if what dave is saying is the root of the problem (but I guess you already know that).

Nick
Title: Re: Using Visual C++ Express...
Post by: Tron2.0 on January 23, 2010, 03:43:40 PM
Ok, this is weird....
I don't understand why, but debugging with VC2008 and the "step into" function, sometimes there is no corrispondence between source and code....Actually is pointing to a blank source... :eek
There is a keyword that wraps the internal counter of the assembler and messing around the code?
Any ideas?

I know that "proc" and "ret" causes the assembler to put the prologue and epilogue code before (and not after) the line that contain them.
Title: Re: Using Visual C++ Express...
Post by: TNick on January 23, 2010, 07:45:44 PM
I don't actually use VC for debugging, but WinDBG. I think they use same core, however.
The thing that you say happens whenever I edit the sources, save the file, but I don't assemble. Debug informations are not updated, so I have weird results.

Otherwise, I have no idea about what could cause your problem... sorry

Nick
Title: Re: Using Visual C++ Express...
Post by: Tron2.0 on January 25, 2010, 02:49:36 PM
Ok, i have found the reason....
Maybe ML9 has a bug with .DATA and .CODE keywords.
The problem was created by a file with a .DATA section. The counter wraps and eschange code count with data count, i think.
So, i put a .CODE as last command in that file and all works.
Title: Re: Using Visual C++ Express...
Post by: GregL on January 25, 2010, 10:34:55 PM
Neither ML 9.0 nor the VC debugger should have a problem with a .DATA directive. The .DATA directive is such a common thing in MASM code, I can't imagine there would be any bugs caused by it.  Post your code or an example showing the problem.