The MASM Forum

General => The Campus => Topic started by: RedSkeleton007 on September 11, 2015, 12:24:20 AM

Title: How to test and run assembly programs without Visual Studio
Post by: RedSkeleton007 on September 11, 2015, 12:24:20 AM
I'm sure most of you have heard of Microsoft Visual Studio. It's a very nice IDE, but the installation DVD costs $500+, and even though dreamspark is supposed to give students the option of downloading it for free, I haven't been able to successfully install it, even though I tried 25+ times. I did, however, install a free 30-day trial of Visual Studio at one point, but that trial ended months ago, and it will no longer let me compile or run any of my code or projects.

Despite that, when I tried to run a simple program in your famous masm32 assembler, my computer tried opening up Visual Studio (and of course, my trial expired, so I didn't get a chance to view the output of my program). This is getting annoying. Can someone please tell me where I can get a free IDE that will compile, run, and output the results of masm programs WITHOUT Visual Studio?
Title: Re: How to test and run assembly programs without Visual Studio
Post by: anta40 on September 11, 2015, 12:58:53 AM
Why would you need VS to compile MASM programs?
The MASM32 SDK is sufficient.
Title: Re: How to test and run assembly programs without Visual Studio
Post by: hutch-- on September 11, 2015, 01:08:20 AM
Uninstall the trial copy of VC then install MASM32 and set your file associations to QE with the ".asm" extension.
Title: Re: How to test and run assembly programs without Visual Studio
Post by: TouEnMasm on September 11, 2015, 01:25:28 AM
Visual Studio community is free and give you access to vc,VB and more..

With Windows 10 I have VS2015.
VC come all with it is needed  (there is a resource editor added for free),sdk,ddk,..
To build asm program just put jwasm in the binary (bin) directory for 32 bits or 64 bits.
Then use one the batch:
   call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat"
All is free and for old version of Windows there is also old version of vs downloadable (need a little search)
If you want to build mixed vc asm executable,it's the only choice you have.
Title: Re: How to test and run assembly programs without Visual Studio
Post by: jj2007 on September 11, 2015, 04:25:56 AM
Don't toy around with Visual Crap, use RichMasm 8)
Title: Re: How to test and run assembly programs without Visual Studio
Post by: RedSkeleton007 on September 11, 2015, 08:20:50 AM
Quote from: jj2007 on September 11, 2015, 04:25:56 AM
Don't toy around with Visual Crap, use RichMasm 8)
Well, I couldn't access RichMasm. When I tried clicking on the link (see the image in the attached zipped folder), it said:

"The topic or board you are looking for appears to be either missing or off limits to you."

I can't find the RichMasm folder in the masm32 folder either. Should I just put the Win32.hlp in the MasmBasic folder instead, or do I really need to re-download masm32 and start all over again in hopes that the masm32 I download will have a RichMasm in it the second time around?

Title: Re: How to test and run assembly programs without Visual Studio
Post by: zedd151 on September 11, 2015, 09:43:42 AM
Quote
...masm32 I download will have a RichMasm in it...



RichMasm isn't part of the Masm32 sdk. You won't automatically find it there.

And imo, you don't really need it.
Title: Re: How to test and run assembly programs without Visual Studio
Post by: jj2007 on September 11, 2015, 10:00:07 AM
Quote from: RedSkeleton007 on September 11, 2015, 08:20:50 AM
Quote from: jj2007 on September 11, 2015, 04:25:56 AM
Don't toy around with Visual Crap, use RichMasm 8)

I can't find the RichMasm folder in the masm32 folder either.

I was just joking. If you installed MasmBasic, version 9/11 (http://masm32.com/board/index.php?topic=94.0), it's here: \Masm32\MasmBasic\RichMasm.exe

QuoteShould I just put the Win32.hlp in the MasmBasic folder instead, or do I really need to re-download masm32 and start all over again in hopes that the masm32 I download will have a RichMasm in it the second time around?

If you want "select and hit F1" functionality in RichMasm, move it to \Masm32\RichMasm\Help\WIN32.HLP
Title: Re: How to test and run assembly programs without Visual Studio
Post by: RedSkeleton007 on September 11, 2015, 02:11:15 PM
I uninstalled Visual Studio from my computer, but now, when I click file -> run program in Masm32 Editor, NO output is showing up! I'm having such a difficult fulfilling the directions at http://www.webalice.it/jj2006/Masm32_Tips_Tricks_and_Traps.htm (http://www.webalice.it/jj2006/Masm32_Tips_Tricks_and_Traps.htm).
Title: Re: How to test and run assembly programs without Visual Studio
Post by: hutch-- on September 11, 2015, 03:18:31 PM
Is it a console mode app you are trying to run ? If so run it from the command prompt.
Title: Re: How to test and run assembly programs without Visual Studio
Post by: jj2007 on September 11, 2015, 04:22:26 PM
Either use RichMasm (an intelligent editor that recognises a console app and knows that the window must stay open), or put an inkey before exit.
Title: Re: How to test and run assembly programs without Visual Studio
Post by: TWell on September 11, 2015, 06:05:06 PM
Visual Studio Express is free.
PellesC IDE have debugger too :t here (http://www.pellesc.de/index.php?page=download&lang=en&version=8.00)
Title: Re: How to test and run assembly programs without Visual Studio
Post by: RedSkeleton007 on September 12, 2015, 02:31:22 AM
Quote from: hutch-- on September 11, 2015, 03:18:31 PM
Is it a console mode app you are trying to run ?
Interesting. By default, Visual Studio displayed the program's output into the console by default. I wish Masm32 Editor would do that from the get go. How do I get it to do that?

Quote from: hutch-- on September 11, 2015, 03:18:31 PM
If so run it from the command prompt.
What commands must I type into the command prompt to make that happen?

Quote from: jj2007 on September 11, 2015, 04:22:26 PM
Either use RichMasm (an intelligent editor that recognises a console app and knows that the window must stay open),
Again, I don't think I have the full fledged RichMasm in my masm32 package for some bizarre annoying reason. The only RichMasm related thing I have is in the screen shot image I attached to this post in a zipped folder. If you have a latest version of the masm32 sdk package with the RichMasm content I'm supposed to have, please provide or point me to it. By the way, can you also tell me how I can place inline images in my posts?

Quote from: jj2007 on September 11, 2015, 04:22:26 PM
or put an inkey before exit.
What do you mean by that? Am I supposed to add the masm reserved word inkey somewhere in my code in the Masm32 editor?

Quote from: TWell on September 11, 2015, 06:05:06 PM
Visual Studio Express is free.
PellesC IDE have debugger too :t here (http://www.pellesc.de/index.php?page=download&lang=en&version=8.00)
Thanks, but it seems from the description that it's only for C. How do you know that it also compiles masm too?
Title: Re: How to test and run assembly programs without Visual Studio
Post by: TouEnMasm on September 12, 2015, 02:42:09 AM

The inkey is a macro of the masm32 package who use the crt getch function.

Two soluce ,use the masm32.lib and the macro inkey (include macros.asm)

or
inludelib msvcrt.lib (vc lib)
declare the "_getch PROTO C"
then:
invoke _getch  ;the dos prog wait for a keyboard key and the black screen is always visible.



 
 

Title: Re: How to test and run assembly programs without Visual Studio
Post by: pcMike on September 12, 2015, 02:51:41 AM
Quote from: RedSkeleton007 on September 12, 2015, 02:31:22 AM
What commands must I type into the command prompt to make that happen?

You would first use the CD (Change Directory) command to select the project folder, and then type the name of the executable. So if your project is located in c:\fubar and is named fubar.asm, then after you perform the "Console Assemble and Link" command in Qeditor, you could run it by typing:

cd\fubar
fubar

I like the inkey method better though.

Regards,  Mike
Title: Re: How to test and run assembly programs without Visual Studio
Post by: TWell on September 12, 2015, 02:55:51 AM
Quote from: RedSkeleton007 on September 12, 2015, 02:31:22 AM

Quote from: TWell on September 11, 2015, 06:05:06 PM
Visual Studio Express is free.
PellesC IDE have debugger too :t here (http://www.pellesc.de/index.php?page=download&lang=en&version=8.00)
Thanks, but it seems from the description that it's only for C. How do you know that it also compiles masm too?
Because in Visual Studio Express there are ml.exe and ml64.exe
Title: Re: How to test and run assembly programs without Visual Studio
Post by: jj2007 on September 12, 2015, 07:43:54 AM
Quote from: RedSkeleton007 on September 12, 2015, 02:31:22 AM
Quote from: jj2007 on September 11, 2015, 04:22:26 PM
Either use RichMasm (an intelligent editor that recognises a console app and knows that the window must stay open),
Again, I don't think I have the full fledged RichMasm in my masm32 package for some bizarre annoying reason. The only RichMasm related thing I have is in the screen shot image I attached to this post in a zipped folder. If you have a latest version of the masm32 sdk package with the RichMasm content I'm supposed to have, please provide or point me to it. By the way, can you also tell me how I can place inline images in my posts?

You do have it. You even highlighted it yourself. Just select it and hit Return. Re inline images: rename the jpg to zip and attach it...
Title: Re: How to test and run assembly programs without Visual Studio
Post by: herge on September 12, 2015, 06:37:34 PM
 Hello:

You have a couple of options.
1. File Open with ... You might have to Browse for the Application
     You need i e Qeditor
2. _getch ( ); in C++ or inkey in Assembler

3. Do Nothing in VC2010 it pauses automatically.

4. Download the Borland 5.5 Compiler I think it's under
    10 meg. Very Old but still can do the Job.


Regards Herge
Title: Re: How to test and run assembly programs without Visual Studio
Post by: Oliver Scantleberry on December 01, 2015, 08:40:57 AM
Quote from: ToutEnMasm on September 12, 2015, 02:42:09 AM

Two soluce ,


Even if only one, is it a typo or some foreign language garbage. This is America. We speak English here.
Title: Re: How to test and run assembly programs without Visual Studio
Post by: jj2007 on December 01, 2015, 09:42:10 AM
Quote from: Oliver Scantleberry on December 01, 2015, 08:40:57 AM
Quote from: ToutEnMasm on September 12, 2015, 02:42:09 AM

Two soluce ,


Even if only one, is it a typo or some foreign language garbage. This is America. We speak English here.

Nope. This is Australia, we are tolerant here, and most of us speak and write more than one language.
Title: Re: How to test and run assembly programs without Visual Studio
Post by: Oliver Scantleberry on December 01, 2015, 11:59:49 AM
Quote from: jj2007 on December 01, 2015, 09:42:10 AM
Quote from: Oliver Scantleberry on December 01, 2015, 08:40:57 AM
Quote from: ToutEnMasm on September 12, 2015, 02:42:09 AM

Two soluce ,


Even if only one, is it a typo or some foreign language garbage. This is America. We speak English here.


Nope. This is Australia, we are tolerant here, and most of us speak and write more than one language.

I believe you. Life would be difficult down there in Australia without French, or Italian, or German, or Erse in addition to English.
Title: Re: How to test and run assembly programs without Visual Studio
Post by: hutch-- on December 01, 2015, 07:48:46 PM
Since we have members from many places around the world, we have long ago learnt to be tolerant of differences in language from one place to another. The "English" we speak in OZ would not be understood by most except the Kiwis and the English. Since Yves's English is certainly better than my French I tend to get most of what he says most of the time. This is an English language forum but we get plenty of variations on the way through.
Title: Re: How to test and run assembly programs without Visual Studio
Post by: TouEnMasm on December 01, 2015, 09:37:11 PM
 thanks to Hutch
Here an explain of this word
Soluce is a french-portugues word for solution,Walkthrough
He is used more often speaking of video-game.
latin is solutio
portugues say soluçar.
Can be a valuable word also for the English OZ (US language)
:lol:
Title: Re: How to test and run assembly programs without Visual Studio
Post by: Oliver Scantleberry on December 02, 2015, 03:15:47 PM
Quote from: hutch-- on December 01, 2015, 07:48:46 PM
Since we have members from many places around the world, we have long ago learnt to be tolerant of differences in language from one place to another. The "English" we speak in OZ. . .

Being tolerant is one thing but throwing French, Portuguese, Erse, etc. words around an English forum is, at best, inconsiderate. At least "OZ", whatever that is, is different.
Title: Re: How to test and run assembly programs without Visual Studio
Post by: hutch-- on December 02, 2015, 03:51:11 PM
Well, I would like to think that OZ was where Judy Garland went to in the movie (The Wizard of) but sad to say its also the idiomatic abbreviation for Australia where this forum is located and where I live. Now I am sure that you know that all spoken English is only ever approximate English, the dialect that I speak here in OZ would not be understood by most. The largest English speaking population in is India with China catching up fast and they are both full of expressions that I only barely get. We deal with a wide range of folks from many places with many different variations of English, pseudo English and often due to language origin differences, truly lousy English but English has a capacity to handle foreign words that many other "academy" languages cannot do. We generally call them "loan words", voila etc ....
Title: Re: How to test and run assembly programs without Visual Studio
Post by: jj2007 on December 02, 2015, 06:57:03 PM
In short, as Yves would put it: "English is a beautiful language, and she can be abused by everybody" 8)
Title: Re: How to test and run assembly programs without Visual Studio
Post by: GoneFishing on December 02, 2015, 10:38:15 PM
Quote from: jj2007 on December 02, 2015, 06:57:03 PM
... and she can be abused by everybody" 8)
:biggrin:
I like her very much, she's so beautiful
:biggrin:
Title: Re: How to test and run assembly programs without Visual Studio
Post by: TouEnMasm on December 03, 2015, 03:22:03 AM

abuse not,i'm not JJ.
But playing with language is a pleasure for many authors,it is like that in France.
Title: Re: How to test and run assembly programs without Visual Studio
Post by: Grincheux on December 03, 2015, 06:51:39 AM
Je confirme
I confirm
Title: Re: How to test and run assembly programs without Visual Studio
Post by: Siekmanski on December 03, 2015, 06:59:09 AM
ik bevestig.
Title: Re: How to test and run assembly programs without Visual Studio
Post by: jj2007 on December 03, 2015, 07:05:47 AM
Quote from: ToutEnMasm on December 03, 2015, 03:22:03 AMabuse not,i'm not JJ.

Ts ts ts, Yves :eusa_naughty: I am the good guy. You haven't been in Texas, right?
Title: Re: How to test and run assembly programs without Visual Studio
Post by: Oliver Scantleberry on December 03, 2015, 07:14:17 PM
Quote from: hutch-- on December 02, 2015, 03:51:11 PM
. . . but sad to say its also (OZ) the idiomatic abbreviation for Australia where this forum is located and where I live. . .

I have a first cousin born and raised here in Maine USA and until very recently, lived in Australia in a place called Round Corner--not too far from Sydney--for over thirty years. Spoke to him hundreds of times over the years and he never once mentioned "OZ".
Title: Re: How to test and run assembly programs without Visual Studio
Post by: hutch-- on December 03, 2015, 10:42:28 PM
I would not hold it against him, not everyone is familiar with older AU idiom.

With thanks to Don McLean.

Quote
Over the rainbow a Kansas tornado
Can twist up a little girls head
Aunt Em's on relief and the tin man's a thief
And even the wizard can't wake the dead
Title: Re: How to test and run assembly programs without Visual Studio
Post by: Oliver Scantleberry on December 05, 2015, 05:25:24 AM
Quote from: hutch-- on December 03, 2015, 10:42:28 PM
I would not hold it against him, not everyone is familiar with older AU idiom.

Next time I speak to him, I'm gonna call him a dumb, numskull, ignorant, nincompoop Aussie.

By the way, where can I find out how to adjust Windows (Win 10) sequential file pointer? I didn't see any thing in MASM32 that would help. DOS used to do it with Int 21h, function 42h (I think).
Title: Re: How to test and run assembly programs without Visual Studio
Post by: TWell on December 05, 2015, 08:06:46 AM
If you use Win32 API search from MSDN SetFilePointer()
Title: Re: How to test and run assembly programs without Visual Studio
Post by: Oliver Scantleberry on December 05, 2015, 08:18:00 AM
Quote from: TWell on December 05, 2015, 08:06:46 AM
If you use Win32 API search from MSDN SetFilePointer()

The only thing regarding SetFilePointer I saw in MSDN was in C++ and C, neither of which I use much. In fact, I never use C++.
Title: Re: How to test and run assembly programs without Visual Studio
Post by: TWell on December 05, 2015, 08:21:42 AM
A silly question.
You can use Win32 API with masm too.

BTW:
How about your drugs, remember to take them too.
Title: Re: How to test and run assembly programs without Visual Studio
Post by: Oliver Scantleberry on December 05, 2015, 08:29:50 AM
Quote from: TWell on December 05, 2015, 08:21:42 AM
A silly question.
You can use Win32 API with masm too.

BTW:
How about your drugs, remember to take them too.

Don't know about Win32 API. Don't know where it is nor how to use it.

I take lots of drugs. Always take them on time. Especially insulin.
Title: Re: How to test and run assembly programs without Visual Studio
Post by: hutch-- on December 05, 2015, 12:24:12 PM
> Next time I speak to him, I'm gonna call him a dumb, numskull, ignorant, nincompoop Aussie.

Most foreigners make a mess of Australian idiom, you don't appear to be an exception.
Title: Re: How to test and run assembly programs without Visual Studio
Post by: dedndave on December 05, 2015, 11:45:34 PM
Quote from: Oliver Scantleberry on December 05, 2015, 08:18:00 AM
The only thing regarding SetFilePointer I saw in MSDN was in C++ and C, neither of which I use much. In fact, I never use C++.

just because the example they offer is in C, doesn't mean it can't be used by other compilers or assemblers
"windows API" refers to the "Application Programming Interface"
it includes thousands of functions that provide a programming interface layer - access to the OS

if you have written any windows program, you have used the API
ExitProcess is a windows API function   :P
Title: Re: How to test and run assembly programs without Visual Studio
Post by: Oliver Scantleberry on December 10, 2015, 07:06:15 PM
Quote from: dedndave on December 05, 2015, 11:45:34 PM
Quote from: Oliver Scantleberry on December 05, 2015, 08:18:00 AM
The only thing regarding SetFilePointer I saw in MSDN was in C++ and C, neither of which I use much. In fact, I never use C++.

if you have written any windows program, you have used the API
ExitProcess is a windows API function   :P

The only thing I have found that's useful is: SetFilePointer  :DWORD, :DWORD, :DWORD, :DWORD. I just need to know what the four double word arguments are. I have only been vectored to C and C++ stuff which, for me, is useless. I have only been using COBOL, Perl, and Assembly during the past few years. I'll just keep looking.

Title: Re: How to test and run assembly programs without Visual Studio
Post by: Grincheux on December 10, 2015, 09:15:43 PM
Take a look here : https://msdn.microsoft.com/en-us/library/windows/desktop/aa365541%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396
Quote
DWORD WINAPI SetFilePointer(  _In_        HANDLE hFile, _In_        LONG   lDistanceToMove, _Inout_opt_ PLONG  lpDistanceToMoveHigh, _In_        DWORD  dwMoveMethod );

There are all DWORD
Title: Re: How to test and run assembly programs without Visual Studio
Post by: dedndave on December 11, 2015, 03:45:18 AM
SetFilePointer
https://msdn.microsoft.com/en-us/library/windows/desktop/aa365541%28v=vs.85%29.aspx (https://msdn.microsoft.com/en-us/library/windows/desktop/aa365541%28v=vs.85%29.aspx)

SetFilePointerEx
https://msdn.microsoft.com/en-us/library/windows/desktop/aa365542%28v=vs.85%29.aspx (https://msdn.microsoft.com/en-us/library/windows/desktop/aa365542%28v=vs.85%29.aspx)

first, nearly all windows API functions have such a page
there are similar MSDN pages for most constants, structures, messages, notifications, enumerations, and so on
(use the index in the left pane of the pages to find other pages)

now, as to syntax...

this is the normal C declaration syntax
the assembly language equivalent is the PROTO (prototype)

DWORD WINAPI SetFilePointer(
  _In_        HANDLE hFile,
  _In_        LONG   lDistanceToMove,
  _Inout_opt_ PLONG  lpDistanceToMoveHigh,
  _In_        DWORD  dwMoveMethod
);


if you examine the windows.inc file, you will see that Hutch has TYPEDEF'ed many of the C types to DWORD's

HANDLE TYPEDEF DWORD

the C language uses "strong" typing
that means that if you try to pass a LONG integer as a HANDLE, some sort of compiler error will be generated
assembly language is not strong typed
the assembler is really only concerned with the size of each argument
so, we can just refer to HANDLE, LPSTR, LPVOID, LONG, etc, as DWORD's

the best thing to do is to learn Hungarian Notation so that you can tell if an argument is a value, or a pointer to a value   :biggrin:

in assembly language, we can use INVOKE to call these functions (as long as the function is prototyped)

    INVOKE  SetFilePointer, hFile, lDistanceToMove, lpDistanceToMoveHigh, dwMoveMethod

refer to the MSDN page for a description of each argument
Title: Re: How to test and run assembly programs without Visual Studio
Post by: Oliver Scantleberry on December 11, 2015, 06:10:31 PM
Quote from: dedndave on December 11, 2015, 03:45:18 AM
SetFilePointer
https://msdn.microsoft.com/en-us/library/windows/desktop/aa365541%28v=vs.85%29.aspx (https://msdn.microsoft.com/en-us/library/windows/desktop/aa365541%28v=vs.85%29.aspx)

Now, as to syntax...

this is the normal C declaration syntax
the assembly language equivalent is the PROTO (prototype)

DWORD WINAPI SetFilePointer(
  _In_        HANDLE hFile,
  _In_        LONG   lDistanceToMove,
  _Inout_opt_ PLONG  lpDistanceToMoveHigh,
  _In_        DWORD  dwMoveMethod
);


if you examine the windows.inc file, you will see that Hutch has TYPEDEF'ed many of the C types to DWORD's

Thank you, Dave. I now have enough to try 'er out.
Title: Re: How to test and run assembly programs without Visual Studio
Post by: Oliver Scantleberry on December 11, 2015, 06:11:34 PM
Quote from: Grincheux on December 10, 2015, 09:15:43 PM
Take a look here : https://msdn.microsoft.com/en-us/library/windows/desktop/aa365541%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396
Quote
DWORD WINAPI SetFilePointer(  _In_        HANDLE hFile, _In_        LONG   lDistanceToMove, _Inout_opt_ PLONG  lpDistanceToMoveHigh, _In_        DWORD  dwMoveMethod );

There are all DWORD

Thank you, Grinch. I'm gonna try it out.
Title: Re: How to test and run assembly programs without Visual Studio
Post by: hutch-- on December 12, 2015, 12:02:58 PM
Oliver,

It would be to your advantage to get a copy of the old WIN32.HLP file and if necessary, get the Winhelp update from Microsoft so you can use it as it has all of the core Win32 API functions in it. You can get the later stuff from MSDN or similar. Something that simplifies almost all Windows API functions is the SIZE of the arguments which are almost all DWORD (32 bit in size). What you get from WIN32.HLP is what is expected as to whether an argument for an API is a value or an address.
Title: Re: How to test and run assembly programs without Visual Studio
Post by: Oliver Scantleberry on December 15, 2015, 04:08:38 PM
Quote from: hutch-- on December 12, 2015, 12:02:58 PM
Oliver,

It would be to your advantage to get a copy of the old WIN32.HLP file and if necessary, get the Winhelp update from Microsoft so you can use it as it has all of the core Win32 API functions in it. You can get the later stuff from MSDN or similar. Something that simplifies almost all Windows API functions is the SIZE of the arguments which are almost all DWORD (32 bit in size). What you get from WIN32.HLP is what is expected as to whether an argument for an API is a value or an address.

I haven't been able to find an executable that will run with a '.hlp' file. The ones I found would not load under Windows 10 which is what this laptop is. The ones I've tried error'd out trying to load (install) them.

Thanks for the hint.
Title: Re: How to test and run assembly programs without Visual Studio
Post by: TWell on December 15, 2015, 07:46:17 PM
Read this (http://masm32.com/board/index.php?topic=4212.msg44813#msg44813)