The MASM Forum

General => The Campus => Topic started by: RedSkeleton007 on September 03, 2015, 02:42:35 PM

Title: Why are people still using 32 bit ASM?
Post by: RedSkeleton007 on September 03, 2015, 02:42:35 PM
I should have asked this when I first started using these forums, but I'm just going to come right out and say it:

Why bother utilizing MASM32 if it's only designed for only 32 bit programming? Many new operating systems have x86 processors, but are in 64 bit. I was reading the MASM32 Home Page, but it warned that it's targeted for advanced ASM users. So, in my short hunt for a more beginner-friendly compiler, I came across flat assembler, but it's also in 64 bit. I want to try it, but I'm concerned that the programs I write in flat assembler won't work properly in the 32 bt MASM32 compiler. I would be sad if I ended up not having any further use of these MASM forums just because of the seemingly radical differences of MASM syntax between 32 bit and 64 bit x86 processors. Should I be concerned about this or not?
Title: Re: Why are people still using 32 bit ASM?
Post by: hutch-- on September 03, 2015, 03:32:31 PM
I am not going to try and convince you one way or another but an assembler is an advanced tool that requires more work than compilers. The differences between 32 and 64 bit code in in the architecture of the operating system and if you choose to write 64 bit code, you will find it is a different animal, whether you use MASM, JWASM or FASM.
Title: Re: Why are people still using 32 bit ASM?
Post by: avcaballero on September 03, 2015, 05:43:58 PM
Why deprecate so early 32 bits. Programming is programming, no matter how many bits you use. I'd even say, what deprecate 16 bits for? 64 bits has a huge of flat memory, how powerful. In 80s they had to work with command based OS, very few memory, and even though they got to make so wonderful videogames, overcoming size constraints, tools and information. If we are now so advanced, should any of us be able to create any of those old games, are we?
Title: Re: Why are people still using 32 bit ASM?
Post by: jj2007 on September 03, 2015, 05:56:18 PM
The full story. (http://www.masmforum.com/board/index.php?topic=12019.msg92262#msg92262)
Title: Re: Why are people still using 32 bit ASM?
Post by: RedSkeleton007 on September 04, 2015, 02:07:40 AM
Quote from: avcaballero on September 03, 2015, 05:43:58 PM
Why deprecate so early 32 bits. Programming is programming, no matter how many bits you use... If we are now so advanced, should any of us be able to create any of those old games, are we?

Fair enough ;) I guess I will stick with x86 32-bit asm for now. However, can anybody point me to a MASM compiler that's more beginner friendly than MASM32? I think I've done just barely enough reading and headache-note-taking to start getting hands on. But I don't want built-in libraries and includes to deprive me of the important gory details. HOW DOES A BEGINNER GET A DECENT HEAD START ON 32-bit MASM?!  :dazzled:
Title: Re: Why are people still using 32 bit ASM?
Post by: rrr314159 on September 04, 2015, 02:22:14 AM
This issue can prompt a "holy war", RedSkeleton007, so look out!

64-bit is not better than 32 for most apps. As jj2007's link says, 32-bit can be expected to work fine for a long time (decades). If you merely convert existing 32-bit to 64, it simply bloats the .exe (by a factor of 1.3 to 2) - that's all. Speeds are slightly different, some apps might be a few % faster or slower, maybe. So 64-bit is a loser in this case.

However of course 64-bit gives u a bunch of extra registers, with twice the bits, and the large address space. Extra registers are nice to have and very useful in some cases, like math programming. The registers can handle not just numbers of 2-4 billion but the square of that. The large address space, beyond 2 billion, is really great for some apps, and will become more useful as time goes by (bigger video mem's for instance). So if you need those things 64-bit is essential.

The biggest problem is, there's no "masm64.com"! 64-bit is not as standardized yet as 32, so we constantly have the problem that others on this board can't run our 64-bit code. For instance both Mikl__ and ToutEnMasm use different environments than me, and each other; when I want to run their code it's a PITA substituting include files etc.

32-bit is the "lingua franca", the common language - we all use the same masm32 stuff and everybody's code always compiles.

It's important to note that (contrary to general opinion) it's not really that big a deal converting from 32 to 64. 64 to 32 is also easy, if you don't use the advanced capabilities, or at least sequester them carefully. So I've come around to posting 32-bit here, but often using 64 for my own work.

FASM is very good for some things but quite different and has its limitations - for one thing the community is not as active. Many people use both but of course that's more trouble.

Bottom line, if it must be one or the other, use masm32 unless you have good reason to go to 64-bit or FASM. Approx everything you do with 32-bit is directly applicable to 64-bit. Certainly, as long as you're "learning", 32 is the way to go. But get used to 64-bit, it's really not that big a transition.

And to answer your question - perhaps the major reason "everybody still uses 32-bit" is, they're old.

Quote from: RS007However, can anybody point me to a MASM compiler that's more beginner friendly than MASM32?

- No! - especially considering your next statement ...

Quote from: RS007But I don't want built-in libraries and includes to deprive me of the important gory details.

- There are "beginner-friendly" environments like EasyCode etc, but they all achieve this by hiding the gory details.

Quote from: RS007HOW DOES A BEGINNER GET A DECENT HEAD START ON 32-bit MASM

- Here's what I did ... use masm32 examples and code freely, including the macros and includes. get them working, play with them a bit. Then dig down into the macros.asm and the .inc files and (more or less) rewrite them yourself. That brings you in contact with all the gory details (except the standard library functions, that's yet another step if you want to take it). For example simply use "print" at first. Then when you're ready dig into macros.asm and see how it works, rewite it to your own taste
Title: Re: Why are people still using 32 bit ASM?
Post by: nidud on September 04, 2015, 03:15:41 AM
deleted
Title: Re: Why are people still using 32 bit ASM?
Post by: jj2007 on September 04, 2015, 03:22:29 AM
Quote from: rrr314159 on September 04, 2015, 02:22:14 AMuse masm32 examples and code freely, including the macros and includes. get them working, play with them a bit. Then dig down into the macros.asm and the .inc files and (more or less) rewrite them yourself. That brings you in contact with all the gory details (except the standard library functions, that's yet another step if you want to take it). For example simply use "print" at first. Then when you're ready dig into macros.asm and see how it works, rewite it to your own taste

This is good advice! The macros are not meant to hide the details, they just serve to hide boring details. The MasmBasic library has a special macro called "deb", which does not change any registers or flags, and thus allows you to monitor step by step what your code is doing. It is an alternative to OllyDbg (http://www.ollydbg.de/version2.html), but allows you to see the diagnostics and the output in the same window.

Below an advanced example - if you had to do that with "pure" assembler, it would be several hundred lines long, and you would be so buried in a lot of detail that certainly you wouldn't ever understand what fld1 or movlps do (for example).

include \masm32\MasmBasic\MasmBasic.inc      ; download (http://masm32.com/board/index.php?topic=94.0)
.data
MyDword      dd 123456789
MyR8      REAL8 1234567.890123456789

  SetGlobals My$="Hello World"
  SetGlobals int a1=111,a2=222,a3=333

  Init
  or eax, -1            ; set sign flag (as an example)
  deb 4, "Some flags", flags      ; lowercase shows only the important ones
  deb 4, "All flags", FLAGS
  mov esi, My$
  fldpi      ; put something on the FPU
  mov eax, MyDword
  movd xmm0, eax
  movlps xmm1, MyR8
  fld1
  mov ecx, 123
  usedeb=1
  deb 4, "Variables etc", ST(0), ST(1), b:eax, $ecx, $esi, $My$, a1, a2, a3, MyDword, MyR8, x:xmm0, f:xmm1
  Exit
end start

Output:
Some flags      flags:          czSo
All flags       FLAGS:          cPazStIdo

Variables etc
ST(0)           1.000000000000000000
ST(1)           3.141592653589793238
b:eax           00000111010110111100110100010101
$ecx            123     <not a pointer>
$esi            Hello World
$My$            Hello World
a1              111
a2              222
a3              333
MyDword         123456789
MyR8            1234567.890123457
x:xmm0          00000000 00000000 00000000 075BCD15
f:xmm1          1234567.890123457


P.S.: Read ttt, it has many links to good material (http://www.webalice.it/jj2006/Masm32_Tips_Tricks_and_Traps.htm)
Title: Re: Why are people still using 32 bit ASM?
Post by: Vortex on September 04, 2015, 03:24:18 AM
Hi nidud,

I guess your code is a JWasm example.
Title: Re: Why are people still using 32 bit ASM?
Post by: nidud on September 04, 2015, 03:40:58 AM
deleted
Title: Re: Why are people still using 32 bit ASM?
Post by: dedndave on September 04, 2015, 03:57:32 AM
Hi Red

first, let me say - yes, i still use Masm32
microsoft made a real mess of things in 64-bit world - lol
but, the truth is, i am still running XP
even if i had a 64-bit machine/OS, i'd probably dabble with 64-bit, mostly stay with 32-bit

as for how i learned to program using Masm32
well - i had considerable experience with Masm in old 16-bit DOS days
that helped, mainly with assembler syntax
i've also worked with several other processors 4004, 8008, 8080, 8051, 6500, 6800, 68000, and so on

none of that really prepares you for what awaits in windows-32  :lol:
the Masm32 package has a lot of code that is pre-written
i do use some of it
but - i forced myself to examine the source files for every PROC and macro i use

the Masm32 examples and Iczelion's tutorials helped with GUI programming
i also did a lot of reading on the MSDN site (a LOT) - that helps
Hutch also has ProStart and CodeGen programs (several versions, along the way)
these programs would spit out - pre-rolled GUI apps to get your project started
i learned a lot from the code they generated, as well as code from other forum members

when the forum doesn't answer what you want - try MSDN
there are also sites like CodeProject and StackOverflow
mostly in C - but there are a lot of sharp people in there   :P

and - i will also mention Jose Roca's site

http://www.jose.it-berater.org/ (http://www.jose.it-berater.org/)

examples of many API functions, and a forum, too

many sites have pushed along the way, mad wizard has many examples, ewayne, and so on

when it comes to painting and drawing, MSDN has a lot of reading material
Title: Re: Why are people still using 32 bit ASM?
Post by: AssemblyChallenge on September 04, 2015, 06:52:41 AM
My two cents:

If you want/need both 32 and 64 bits, give it a try to GoAsm (GoTools).

EasyCode has a nice editor for it (and Masm32 of course) but I can't tell how good this compiler is.

In my humble opinion, you will be using 32 bits most part of the time, unless you need to address more than 4GB of RAM, create a driver, of some x64's exotic feature  :lol:

Greetings.
Title: Re: Why are people still using 32 bit ASM?
Post by: zedd151 on September 04, 2015, 07:00:46 AM
QuoteWhy bother utilizing MASM32 if it's only designed for only 32 bit programming?

For me, for practical purposes. I only have winxp pro sp3 32 bit you see.

And no intention of changing it either.

Besides I really like the Masm32 SDK. qeditor is very simple very basic. Don't need all of the garbage

that they put into full-blown, bloated IDE's.


zedd.
Title: Re: Why are people still using 32 bit ASM?
Post by: K_F on September 04, 2015, 07:31:19 AM
If you look hard enough.. even DOS v6.22 is still going... might seem crazy.. but it was very stable compared to windows.. maybe it still is.

Like everything in software (like life I suppose).. there's a lot of hype about something new, and everyone's an expert.. but in the end.. it's only a little better/worse than the tried and tested.

It'll take a while for 64bits to settle... it was the same for 32bits, so until it happens, it's probably better to stick to something that works.
By all means go for 64bits... we all have to sometime
;)
Title: Re: Why are people still using 32 bit ASM?
Post by: Magnum on September 04, 2015, 11:30:16 AM
There are some applications that benefit from 64 bit, but most do not.

Title: Re: Why are people still using 32 bit ASM?
Post by: RedSkeleton007 on September 04, 2015, 03:40:54 PM
The installation process of masm32v11r has been stuck for more than 5 minutes (see the attached screen shot). I'm concerned. Or am I supposed to take some kind of action?
Title: Re: Why are people still using 32 bit ASM?
Post by: zedd151 on September 04, 2015, 04:01:03 PM
Quote from: RedSkeleton007 on September 04, 2015, 03:40:54 PM
The installation process of masm32v11r has been stuck for more than 5 minutes (see the attached screen shot). I'm concerned. Or am I supposed to take some kind of action?

What are the specifics regarding the installation?

What O/S are you using, and how long initially did the installation take before it got 'stuck'?

Can you take a screen shot of Task Manager? (while the install is still stuck')??
Title: Re: Why are people still using 32 bit ASM?
Post by: dedndave on September 04, 2015, 04:32:35 PM
hmmmm - don't recall seeing this problem before
it might be related to your anti-virus program, not allowing the test program to run
(or deleting before it runs, or trying to delete it while it's running - lol)
see if you can assemble and run it "manually"

otherwise, see if you can assemble and run any simple program

the other thing - see if you can run the installer as Admin
Title: Re: Why are people still using 32 bit ASM?
Post by: jj2007 on September 04, 2015, 05:35:11 PM
Quote from: dedndave on September 04, 2015, 04:32:35 PMthe other thing - see if you can run the installer as Admin

Good idea, but check this first:
- start \Masm32\qEditor.exe
- open \Masm32\examples\exampl01\generic\generic.asm (<----- you can copy and paste the path)
- use menu Project/Build all
- use menu Project/Run program

If that doesn't work, something went wrong, and you should indeed retry as Admin.
Title: Re: Why are people still using 32 bit ASM?
Post by: RedSkeleton007 on September 04, 2015, 05:53:16 PM
Quote from: zedd151 on September 04, 2015, 04:01:03 PM

What are the specifics regarding the installation?

What O/S are you using, and how long initially did the installation take before it got 'stuck'?

Can you take a screen shot of Task Manager? (while the install is still stuck')??

Just so everyone is on the same page, I'm trying to follow this:
http://www.webalice.it/jj2006/Masm32_Tips_Tricks_and_Traps.htm (http://www.webalice.it/jj2006/Masm32_Tips_Tricks_and_Traps.htm)

I succeeded in fixing my previous post's problem, so lets just think of that as a false alarm for now. I'm now stuck on step 6. When I tried to run the MasmBasic application downloaded from:
http://masmforum.com/~masm32/board/index.php?topic=94 (http://masmforum.com/~masm32/board/index.php?topic=94)

I now have a new problem (see the attached picture, and on a side note, how do you display images inline within posts?).
And when I extract that downloaded zip folder, it goes empty for some reason. Any help?
Title: Re: Why are people still using 32 bit ASM?
Post by: hutch-- on September 04, 2015, 06:16:56 PM
Red,

Something that is important running XP is to ensure you run as admin as the restricted profile in XP excludes disk writes. You can also have problems with installed anti-virus applications as at least some of them will silently shut down applications that they don't understand properly. Sad to say not all AV programs are created equal and many of the freeware beta versions in popular use are badly written and make unsound assumptions. The Portable Executable specification (win32 EXE and DLL programs) are published by Microsoft and should be available in their complete capacity but some AV vendors don't fully undeerstand the specifications and restrict what can be done.

I use the standard Microsoft AV in my Win7 64 Ultimate version and it does not squark at anything so it is an issue with the junky end of AV scanners.
Title: Re: Why are people still using 32 bit ASM?
Post by: RedSkeleton007 on September 04, 2015, 06:44:13 PM
Quote from: hutch-- on September 04, 2015, 06:16:56 PM
I use the standard Microsoft AV in my Win7 64 Ultimate version and it does not squark at anything so it is an issue with the junky end of AV scanners.

My apologies. I forgot to mention that my OS is a 64-bit Windows 7 with an AMD processor. I would try right-clicking as administrator on the masmBasic application executable file from http://masmforum.com/~masm32/board/index.php?topic=94 (http://masmforum.com/~masm32/board/index.php?topic=94), but as far as I know, Windows 7 doesn't allow you to run any program in a zipped folder. And as I mentioned in my previous post, when I extract all, the extracted/unzipped, the folder is empty for some strange reason. I have no idea what to do about this.  :(  Also, I don't know the gory details of some of the crappier anti-virus programs, but I use Norton.
Title: Re: Why are people still using 32 bit ASM?
Post by: jj2007 on September 04, 2015, 07:09:43 PM
Quote from: RedSkeleton007 on September 04, 2015, 05:53:16 PMAnd when I extract that downloaded zip folder, it goes empty for some reason. Any help?

Interesting. Since this morning (!), it happened three times to me that I tried to double-click on images inside zipped folders. That always worked, but now Windows (7-64) complains that there is no such file.

Can you unzip the setup exe to a folder, and run it from there? Your compressed size is 505kBytes, which is OK, so in principle it should be possible to extract it. If not, it's Norton, and it's no surprise. Try if there is a setting to exclude some folders (\masm32\...) from virus checking.
Title: Re: Why are people still using 32 bit ASM?
Post by: rrr314159 on September 04, 2015, 07:19:31 PM
At webalice.it, all remarks in green refer to the MasmBasic package which is "extra". That's by jj2007, and provides a lot of very useful functions emulating the Basic language. You may, or may not, want to use it at this time. If you have trouble with it then, for the time being, skip it. masm32 package is the essential thing. Ollydebug is also extra; you'll definitely want it (or, some debugger), someday, but not necessarily now. Both these extras, you can download any time, as appropriate. You want to get that "Hello World" program going first, then you're on firm ground.

BTW, has it occurred to you that maybe G-d is out to get you? Think about it - that would explain a lot ... :biggrin:
Title: Re: Why are people still using 32 bit ASM?
Post by: RedSkeleton007 on September 05, 2015, 05:22:56 AM
Quote from: rrr314159 on September 04, 2015, 07:19:31 PM
BTW, has it occurred to you that maybe G-d is out to get you? Think about it - that would explain a lot ... :biggrin:

Huh?! :icon_confused:
Title: Re: Why are people still using 32 bit ASM?
Post by: satpro on September 05, 2015, 07:34:12 AM
Don't know about the G-d thing -- can't do the math there, but I'll second the GoAsm recommendation.  No libraries needed, only the dlls.  There are not as many users (or macros and other aids) but it's a lightning-quick, no BS assembler with straight-up syntax that is actively developed and has a sub-forum here.  EasyCode works great with it, or you can write (and assemble) with something like Notepad++, which, by the way, is an awesome development environment.  I'll volunteer to help get you started as I have NPP all decked out for GoAsm.

What the others said --> you had better spend most of your time reading because assembly is a lot of great things, but it's definitely not something you'll learn through osmosis and the use of fancy IDEs.

Good luck which ever way you go.
Title: Re: Why are people still using 32 bit ASM?
Post by: rrr314159 on September 05, 2015, 08:25:23 AM
Quote from: RedSkeleton007 on September 05, 2015, 05:22:56 AM
Quote from: rrr314159 on September 04, 2015, 07:19:31 PM
BTW, has it occurred to you that maybe G-d is out to get you? Think about it - that would explain a lot ... :biggrin:

Huh?! :icon_confused:

- Hate to have to explain myself, but, the point was, you keep running into problems so the joke is, maybe you're cursed. Of course it's only a joke, these problems are very normal when trying to get a new prog or download up and running

- Jeez, some people have no sense of humor  :biggrin: :biggrin: :biggrin:
Title: Re: Why are people still using 32 bit ASM?
Post by: zedd151 on September 05, 2015, 08:51:39 AM
Quote from: rrr314159 on September 05, 2015, 08:25:23 AM
Quote from: RedSkeleton007 on September 05, 2015, 05:22:56 AM
Quote from: rrr314159 on September 04, 2015, 07:19:31 PM
BTW, has it occurred to you that maybe G-d is out to get you? Think about it - that would explain a lot ... :biggrin:
Huh?! :icon_confused:
...Jeez, some people have no sense of humor....

Nah, he just never solved crossword puzzles enough to be able to fill in the blank. lol   ^ triple nested quote

By the way (RedSkeleton...), did you ever solve your problem, or are you still having trouble?
Title: Re: Why are people still using 32 bit ASM?
Post by: K_F on September 05, 2015, 11:30:34 PM
Quote from: RedSkeleton007 on September 04, 2015, 06:44:13 PM
when I extract all, the extracted/unzipped, the folder is empty for some strange reason. I have no idea what to do about this.  :(  Also, I don't know the gory details of some of the crappier anti-virus programs, but I use Norton.
Maybe Norton is not allowing you to extract the zip contents... try deleting (or disabling) Norton (it's always been considered a virus on it's own, since it converted to windows  ;) )
:biggrin:
Title: Re: Why are people still using 32 bit ASM?
Post by: dedndave on September 06, 2015, 01:31:50 AM
my all-time favorite program: the norton removal tool - lol
guaranteed to speed up your computer

but - you have to have something in place
i use the HOSTS file, extensively - i have the URL's of most of the worst virus payload sites blocked (and many ads, too)

also, create a backup image of your boot drive
something screws you up - bang, 30 minutes later, you're on the air again
keep most of your personal data on another volume
Title: Re: Why are people still using 32 bit ASM?
Post by: RedSkeleton007 on September 07, 2015, 01:10:51 PM
Quote from: zedd151 on September 05, 2015, 08:51:39 AM
By the way (RedSkeleton...), did you ever solve your problem, or are you still having trouble?

I solved it. Sure enough, it was norton. The reason the file kept disappearing every time I extracted that zipped folder was norton saw the setupmasmbasic application file as a threat and automatically deleted it. So I had to restore it from norton's quarantine.
Title: Re: Why are people still using 32 bit ASM?
Post by: alloy on September 14, 2015, 11:07:19 AM
I still have found that 32 bit windows assembler is the easiest programming language to understand.
Title: Re: Why are people still using 32 bit ASM?
Post by: xanatose on September 19, 2015, 06:27:43 AM
Why not?

Use the right tool for the right job. Sometimes I need a very small utility that would run fast, spend little memory and not drain a laptop battery. I found assembly gives me that. Not even C comes near.

Sometimes the time to do an assembly application would be too long, so I use C++ instead.

Most of the time that assembly will help me for 1% of the application. If speed is important, I use assembler, but only after the application is near complete.

Have you seeing the footprint of today's drivers? It makes you want to weep. I bet most machines are running at 50% their capacity because of the overuse of high level languages on drivers.