News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

newbies, use JWasm ...

Started by rrr314159, January 03, 2015, 06:10:56 AM

Previous topic - Next topic

rrr314159

Having just got started with 64-bit assembler I'd like to give those about to take the plunge some advice. My perspective is that of a contented Masm32 user with not much (other) knowledge of modern Windows software. If you're like me, Masm32 provides a comfortable environment where we can concentrate on x86 assembler and, for the most part, ignore libraries, DLL's, include files, C++ and so forth. The bad news is: you have to deal with those things a bit more now. That's also the good news - it's time you learned!

Bottom line: use JWasm. Of course that's the same advice everyone on this forum gives, but I have a couple points to make. First, you'll notice that Japheth's site is down. A number of posts here give you that link, but it doesn't work. You go to code.google and click on the "official JWasm site" - same broken link. At this point you decide to follow your initial instinct and get ML64 - evil they may be, but at least Microsoft.com is never down! Later on you can deal with the peculiarities of open source stuff - it's usually better but has more headaches and requires more expertise. That's a bad move. Instead, go to the projects page of this forum, "JWasm versions and development", and get it there.

Why JWasm? First, all the sample programs work. With ML64 there are no examples, nor anything else (assuming you get it with VC13, the only way I know). There are many other beginner examples around, e.g. with WinInc, which have a strong Linux odor and don't seem to work readily. Anything which comes with a "makefile" shld be viewed with suspicion; this is Windows! Like everyone else, I'm anti-Micro$oft and love the idea of open source, but: we use "batch" files, NOT "make"files. Second, JWasm is a very light download. VC13 is huge, takes every file extension on your computer, demands personal information, etc. Third, JWasm still supports high level macros like invoke and .if; for some reason ML64 doesn't. BTW if any of this info is wrong, oldbies pls correct me.

You will run into 3 problems with JWasm. The first is a problem with ML64 also (and every other alternative) - it doesn't have the new Kernel32, User32 etc lib's you will need. BTW am I the only one who expected to see "Kernel64", etc? The 64-bit versions have the same -32 names and it takes a while to realize the old ones from Masm32 don't work anymore. Apparently the easiest (only?) way to get them is WinInc: another light, free download. Unfortunately it requires Pelles C to create the files - not so light, it's proprietary and wants to grab file extensions - but looks like you're stuck with it. Get WinInc and figure it out. You also get a couple new libs - the most important ones, Kernel32 and User32 - with VC13. You can search forever for the others, wondering what the new names are, do they have to be unzipped, ... forget it. It would be better if those two weren't there, so you would give up quicker.

Second, you need to provide the PATH (like, \masm32\lib) to the lib's, wherever you put them. See Mark44's posts below. Of course this is so with any assembler/environment, including masm32. Elementary but worth re-mentioning.

Third, it handles resource files differently. Probably I should just do it "the J-way", because (of course) the old cvtres.exe doesn't work. However, VC13 does have a new 64-bit compatible cvtres; search under Program Files(x86) (Why isn't it x64?), Microsoft Visual Studio 12.0 (not 13 - VC13 means VC2013).

Linker - there is no "link64", any more than "Kernel64" or "cvtres64". (Old hands are chuckling, but I think these are not unreasonable misunderstandings!) The good news: any linker at all will work, even the one you got with Masm32. In fact, that's the one I'm using, because it handles resource files the traditional way, and because the updated one with VC13 gives errors where it doesn't; who cares why.

Include files - well, you don't actually need include files. JWasm samples put all the required proto's, typedef's, equ's etc at the top of the file. I hated that for about a minute, then loved it - no mysterious include files to find. These are the actual entry points into the lib's - messier perhaps but transparent and direct. Still, include files are probably necessary for anything larger than examples. Get WinInc, the samples show you how to include them all at one fell swoop (like masm32rt.inc).

Looking this over I see there are still various pitfalls for a newbie, but I'm getting sick of this, and I suppose you are too. Someday perhaps I'll go into aligning the stack - basically, a non-issue. Good luck, I'm sure you'll figure it out. I do want to mention - if you decide to get it, for cvtres if nothing else, VC13 hangs up forever at the end of the download/installation on "Service Pack 4" (in my case it was an hour). Don't wait; ML64 and the other files have already been unpacked and can be grabbed before installation is over. As for those oldbies who are L(their)AO over my ignorance - dude, this stuff is confusing the first time around!

I am NaN ;)

jj2007

Quote from: rrr314159 on January 03, 2015, 06:10:56 AMSecond, you need to provide the PATH (like, \masm32\lib) to the lib's, wherever you put them. See Mark44's posts below. Of course this is so with any assembler/environment, including masm32. Elementary but worth re-mentioning.

Minor correction to an otherwise very neat intro: No environment variables needed when working with Masm32. The secret is the \Masm32\... - no drive letter but root-bound paths in all includes and libs. It works out of the box.

vogelsang

To make WinInc 64-bit lib files you need PellesC(for x64) as you know. POLIB.EXE will create them when you add path to its location to environment variables and run \WinInc208\Def64\makelibs.bat . Follow instructions in \WinInc208\readme.txt file.

PellesC probably has lib and include files for x64. If you install it search through folders they should be somewhere inside.

Quote
Third, it handles resource files differently. Probably I should just do it "the J-way", because (of course) the old cvtres.exe doesn't work. However, VC13 does have a new 64-bit compatible cvtres; search under Program Files(x86) (Why isn't it x64?), Microsoft Visual Studio 12.0 (not 13 - VC13 means VC2013).

It seems to me that you have that problem:

http://stackoverflow.com/questions/10888391/error-link-fatal-error-lnk1123-failure-during-conversion-to-coff-file-inval

https://www.google.pl/search?q=cvtres.exe+.net+4.5.1+problem&ie=utf-8&oe=utf-8&gws_rd=cr&ei=5ACnVMZL5s7uBr-AgeAO

My solution for that is to uninstall .NET 4.5.1 and install older but there are other ways to fix this.

I have masm tools for x64 in C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64 on
Windows 7 with Windows SDK installed. There you'll find also linker and resource compiler.

PellesC has toolset for x64 too. Search for bin folder.

JWASM is n00bproof :biggrin:.
Good Luck! :t



"How beautiful this world ruled by dibs, not a gun!"
...

rrr314159

Thanks to both of you. Of course I knew I'd miss one thing or another; wish I'd known the files were in Pelles; but any way that works is good enough. Going the long way 'round I learned a lot of miscellaneous facts which may come in handy. For instance VC12, which I had considered a mere stepping stone, looks pretty useful. Now I'm beginning to convert my old projects to 64-bit. Since it requires 99% persistence and 1% ability, with a little help from my friends, I expect to get done someday!
I am NaN ;)