Proposal:
There have been numerous new members coming on board that already have Visual Studio set up as their programming environment (which is good, as they have the 64 bit binaries already :wink2:). Then they also wish to use either Masm32 SDK or Masm64 SDK to build assembler projects.
It seems clear to me that perhaps there should be a separate board for VS + Masm users. The experienced members here that do use Visual Studio, could then (theoretically) give some guidance on how to properly set up Visual Studio and either Masm32 SDK or Masm64 SDK to work together, what VS settings are needed to build a release or debug version of their projects, path related help, etc. (some use differing paths than most users use)
As both of the SDK's were designed to be used independently without the need for Visual Studio or any other IDE, many members do not have Visual Studio on their computer nor a desire to do so. Therein lies a necessity so that Visual Studio issues do not wind up in the Campus for instance. Case in point (https://masm32.com/board/index.php?msg=133570)
Also when VS users post their code, there is usually an incomplete header as Visual Studio apparently uses some sort of default for it (a guess on my part). And members that do not have VS, in order to help them, would have to insert their own header as well as construct their own command lines or a batch file to build the project for debugging purposes to help the member that posted a request for help. Tedious at best.
Any helpful comments or advisements are welcome. Trolls unwelcome. :smiley:
Not sure where to post this for better visibility or where most appropriate.
Setting up Visual Studio is quite an easy task. Its very nice to use with good debugger. Can use Git to push to GitLab/GitHub, can also pull projects from online sites with Git.
But theres some more. Hutch/Vasilys include files are not complete and need manual addons time to time, when something is found what is not there yet.
Also include libs, like:
\masm64\lib64\kernel32.lib
28/04/2020 17:22 213,016 kernel32.lib
1 File(s) 213,016 bytes
C:\Program Files\Microsoft Visual Studio\2022\Community\SDK\ScopeCppSDK\vc15\SDK\lib\kernel32.lib
30/11/2022 20:33 297,196 kernel32.Lib
1 File(s) 297,196 bytes
Differ in size, so they are not equal in content. Same equals to other include libs this was a single case to compare.
Cheers,
Petter
Masm64 is becoming old. Visual Studio uses newer versions with more code. And always an updated masm.
Quote from: BugCatcher on September 27, 2024, 01:31:14 AMMasm64 is becoming old.
ml64 is not included in the Masm64 SDK, that was always left up to the user to obtain - because of Microsofts licensing restrictions it could not be redistributed within the Masm64 SDK like ml.exe was within the Masm32 SDK.
Quote from: C3 on September 27, 2024, 12:38:48 AMHutch/Vasilys include files are not complete...
Also include libs...
The Masm64 SDK is still a Work-in-progress. (beta version)
Quote from: C3 on September 27, 2024, 12:38:48 AMSetting up Visual Studio is quite an easy task. Its very nice to use with good debugger.
That is good to know, thanks.
Quote from: C3 on September 27, 2024, 12:38:48 AMSetting up Visual Studio is quite an easy task. Its very nice to use with good debugger.
Agreed. All you need are include files, the libraries are with VS (or the Windows SDK if you install that too).
ML and LINK command-line options are set via a properties dialog, one set for debug and another for release.
One thing to watch out for: bloat :biggrin:
Microsoft Visual Studio
7.74 GB (8,319,590,400 bytes)
49,531 Files, 7,649 Folders
Windows Kits
1.95 GB (2,100,789,248 bytes)
10,206 Files, 1,329 Folders
Of course, most of that is superfluous (C++ (and VB in my case)).
How about at least a sticky post somewhere with basic instructions for using VS for those who don't know? Nice to leave at least a few breadcrumbs on this topic ...
a web search gave this How to Use MASM in Visual Studio 2022 (https://www.wikihow.com/Use-MASM-in-Visual-Studio-2022)
it's a bit late for me but I plan on trying it out tomorrow
Quote from: jack on September 27, 2024, 12:41:56 PMa web search gave this How to Use MASM in Visual Studio 2022 (https://www.wikihow.com/Use-MASM-in-Visual-Studio-2022)
it's a bit late for me but I plan on trying it out tomorrow
That wiki is for using VS and MASM (the
assembler, i.e., ml.exe or ml64.exe), NOT either the Masm32 SDK or Masm64 SDK. I have modified the topic title to make this distinction.
While it is useful information, and thanks for the wiki link btw, it does
not address using Visual Studio with either the Masm32 SDK or Masm64 SDK which is what this topic is about. Again, title changed to make the distinction.
Using only information in that link, one would not have access to the macros and libraries in the Masm(32 or 64) SDK's. That is the goal here. To try and make it easier for a user to have both Visual Studio and the use of the macros and libraries within the SDK's. All without having confused paths, the SDK in a location other than the default location (root of a drive), getting around VS's path changes in the registry, and a few other stumbling blocks that new members may find challenging while trying to use VS and either of the SDK's with each other as well as separately. :smiley:
Side note not specifically pointing to any particular member or user: I am very surprised and dismayed to find out that there are quite a few members that do not even have either of the SDK's installed. Somewhat
alarming since that is why this forum was created. Not to simply just use ml.exe or ml64.exe for writing assembler code, but to take advantage of hutchs (and many other contributors) hard work in making the macros and libraries and putting together the SDK's. That is literally
The reason for the forums existence in the first place.
I did read that WikiHow-tutorial what Jack posted. Theres all you need to do when configuring Visual Studio after it, you just use MASM SDK what Hutch made available (include and includelib directives. To use includes, macros and libraries) from MASM32/64 folders. Last do setup of Project/Solution to configure ML/ML64 and LINK settings, choose Debug/Release and are you doing 32bit or 64bit software, and is it for Console or Window as Sinsi pointed previously.
Quote from: C3 on September 27, 2024, 11:56:59 PMI did read that WikiHow-tutorial what Jack posted. Theres all you need to do when configuring Visual Studio after it, you just use MASM SDK what Hutch made available (include and includelib directives. To use includes, macros and libraries) from MASM32/64 folders. Last do setup of Project/Solution to configure ML/ML64 and LINK settings, choose Debug/Release and are you doing 32bit or 64bit software, and is it for Console or Window as Sinsi pointed previously.
Perfect C3. Thank you.
Would you be willing to help out in The Campus (https://masm32.com/board/index.php?board=1.0) if/when there are new members having issues using Visual Studio? Time permitting, of course.
Or (better option?) simply by making a one-time posting there (that can be pinned) on the steps needed to make Visual Studio ready for use in writing assembly projects (plus any useful tips)? That would be a great help, as many members like myself do not use Visual Studio. And such advice and knowledge is always better coming from an experienced, active member, than a wiki page.
Thank you for considering...
zedd151, once you've set up VS for MASM, all you need is one line at the top of your source
include \masm64\include64\masm64rt.inc
or
include \masm32\include\masm32rt.inc
There's nothing magical about VS versus qeditor, or even notepad++.
VS gives you ML64 and LINK, installing the Windows 11 Kit gives you the latest libraries, that's it.
It's got a nice debugger though :biggrin:
Make a sticky post on this, pleeze.
I would also assume (lol) that anyone using VS would be familiar with it, just not familiar with the ASM setup.
I would expect a noob to use something easier, like qeditor - perfectly suited to the task. VS is overkill.
NoCforMe, there needs to be a coherent post to make it sticky. You are the documentation man, if we throw some stuff at you do you volunteer to break it down into bite-sized pieces?
I sure can't.
Quote from: zedd151 on September 28, 2024, 01:10:23 AMWould you be willing to help out in The Campus (https://masm32.com/board/index.php?board=1.0) if/when there are new members having issues using Visual Studio? Time permitting, of course.
Yes I am willing to help everyone here. I have received so much knowledge from you friends and I am willing to pass that knowledge forward, and document that knowledge here.
That Wiki tutorial has nice content of doing that Visual Studio setup, it's very small, and its very easy to setup. And as Sinsi said just add that one-line include to get default MASM SDK running.
I have clean virtual Windows 11 EDU VM where I could do tutorial, but it's all in that Wiki, so it would be duplicate? If theres really need for new tutorial posted to here I guess I could do that.
I haven't tried in versions after vs2015, but it used to be like this - you check the C++ package during installation, then add a C++ project to the solution (don't worry C haters like me, you won't see a single line of C code :smiley: ), right click it and under Build dependencies > Build customizations, tick MASM.
Add new C++ file and rename it to "something.asm".
If in x64 mode, then you're good to go - write your first PROC and call it from your fav managed language using DllImport or such. It's good to set the output directory to be the same for both, the managed and assembly.
The nice thing is you can assign memory to variables in managed lang., not having to worry about the stack. And debug altogether.
Oh.. and under properties, enable No Entry point
I gave it a go in a new Windows 10 VM. Installed VS (C++ build) and the Windows 11 Kit, installed MASM64.
Created a template with settings for (hopefully) MASM64.
The way it's configured you need the ASM project on the same drive as MASM64.
If not, you need to change the configuration from "\masm64\..." to "x:\masm64\...".
I put the template in "Documents\Visual Studio 2022\Templates\ProjectTemplates\MASM".
It's a 64-bit windows project.
:thumbsup:
Quote from: sinsi on September 29, 2024, 04:11:04 PMNoCforMe, there needs to be a coherent post to make it sticky. You are the documentation man, if we throw some stuff at you do you volunteer to break it down into bite-sized pieces?
Sure, just give me the (accurate) raw material and I'll massage it into something useful for n00bs (and non-n00bs).
Thanks guys for the replies. :thumbsup:
It seems there are more members here than I had even thought, that use Visual Studio.
So I think if someone needs assistance in setting up VS + masm (one of the SDKs that is) and posts questions in the Campus about any issues, there is a high probability of their query being answered by someone with experience and knowledge with that scenario. Thanks again.
Perhaps I was making much ado about nothing. And perhaps a separate board for Visual Studio+Masm SDK's is unwarranted. As suggested a "sticky topic" with helpful instructions might be all that is needed.
Any thoughts? Any willing volunteers for that little task?
As a new MASM by VS learner, it's really diffcult and waste me much time to know How to configur VS and build a MASM project, and make integration two or more project
I hope someone could make a video or pic about it, or teach me , then I can make a video share it.
There are tons of videos how to do it ...
https://www.youtube.com/results?search_query=masm+visual+studio (https://www.youtube.com/results?search_query=masm+visual+studio)
get it ~ thank you
Quote from: kingdelee on October 16, 2024, 06:16:06 PMAs a new MASM by VS learner, it's really diffcult and waste me much time to know How to configur VS and build a MASM project, and make integration two or more project
I hope someone could make a video or pic about it, or teach me , then I can make a video share it.
Just to comment this post. Setup of Visual Studio for Assembly Project is very easy, takes two minutes to add required settings. And you can make a template for Project to create from it again. I assume you read other posts in this Forum and I guess you already found a YouTube video with this topic? If you didn't I can make show to step by step guide here.
I've volunteered to put together a sticky post explaining how to use VS with our SDKs.
Since I have no experience myself with doing this, I need accurate information to do this. I would be functioning as your humble scribe.
I've put out a call for information, PM'd a member who seemed willing to provide it, but have heard nothing back.
If you have experience using VS to create MASM programs, could you please send me any information on doing this that would be helpful to beginners here? My intention is to put together a "recipe" in a single sticky post that would get people started with the basics here, including all needed configuration settings.
Instead of posting here and cluttering up this thread, please put this info in a PM to me. When I get enough info to put together a decent post, I'll post it here so people can examine it and correct any errors before we publish it.
Thanks!
Link (https://www.youtube.com/watch?v=41GTgw1C8S4)
:smiley:
Thanks. But no thanks, no videos please: I use text.
And that video has nothing to do with our SDK so far as I can tell. That's the whole point of this exercise.
Quote from: iZ! on September 29, 2024, 10:35:22 PMI haven't tried in versions after vs2015, but it used to be like this - you check the C++ package during installation, then add a C++ project to the solution (don't worry C haters like me, you won't see a single line of C code :smiley: ), right click it and under Build dependencies > Build customizations, tick MASM.
Add new C++ file and rename it to "something.asm".
If in x64 mode, then you're good to go - write your first PROC and call it from your fav managed language using DllImport or such. It's good to set the output directory to be the same for both, the managed and assembly.
The nice thing is you can assign memory to variables in managed lang., not having to worry about the stack. And debug altogether.
Oh.. and under properties, enable No Entry point
I knew I forgot something:
Under 'Source Files', where you've put your asm file, you also need to add the Module-Definition file (.def) found under Code group. It should contain something like this:
LIBRARY "MyLib"
EXPORTS MyFunction1
EXPORTS MyFunction2
...
Quote from: iZ! on October 19, 2024, 02:04:06 AMQuote from: iZ! on September 29, 2024, 10:35:22 PMI haven't tried in versions after vs2015, but it used to be like this - you check the C++ package during installation, then add a C++ project to the solution (don't worry C haters like me, you won't see a single line of C code :smiley: ), right click it and under Build dependencies > Build customizations, tick MASM.
Add new C++ file and rename it to "something.asm".
If in x64 mode, then you're good to go - write your first PROC and call it from your fav managed language using DllImport or such. It's good to set the output directory to be the same for both, the managed and assembly.
The nice thing is you can assign memory to variables in managed lang., not having to worry about the stack. And debug altogether.
Oh.. and under properties, enable No Entry point
I knew I forgot something:
Under 'Source Files', where you've put your asm file, you also need to add the Module-Definition file (.def) found under Code group. It should contain something like this:
LIBRARY "MyLib"
EXPORTS MyFunction1
EXPORTS MyFunction2
...
Yes, its required but only for DLL Project and needs to be added LINKer's Module Definition File setting, to successfully do assembly and linking.
Came across these titbits of info, which might be of interest when integrating assembler and visual studio:
https://www.deconflations.com/2011/masm-assembly-in-visual-studio-2010/ (https://www.deconflations.com/2011/masm-assembly-in-visual-studio-2010/)
https://www.codeproject.com/Articles/410776/Integrating-a-compiler-assembler-in-VS-Using-NASM (https://www.codeproject.com/Articles/410776/Integrating-a-compiler-assembler-in-VS-Using-NASM)