News:

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

Main Menu

Why are people still using 32 bit ASM?

Started by RedSkeleton007, September 03, 2015, 02:42:35 PM

Previous topic - Next topic

RedSkeleton007

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?

hutch--

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.

avcaballero

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?


RedSkeleton007

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:

rrr314159

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
I am NaN ;)

nidud

#6
deleted

jj2007

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, 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
.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

Vortex

Hi nidud,

I guess your code is a JWasm example.

nidud

#9
deleted

dedndave

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/

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

AssemblyChallenge

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.

zedd151

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.

K_F

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
;)
'Sire, Sire!... the peasants are Revolting !!!'
'Yes, they are.. aren't they....'

Magnum

There are some applications that benefit from 64 bit, but most do not.

Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org