Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Recent posts

Tools & Toys / Re: A Teaching Toy: Sine wave ...
Last post by HSE - July 19, 2024, 11:28:52 PM
Hi stoo!

Quote from: stoo23 on July 11, 2024, 09:59:00 AMPlease understand, I am NOT completely inept

I'm sure not. Well... I was sure...

32 bit "thing" still is placed in a 64 bit section  :biggrin:  :biggrin:

I toll you before: what you think is reasonable, that it's Ok  :thumbsup:

Just I have to note that to mess a 32 bit example with 64 bit it's not reasonable for me.

Game Development / Re: Space Invaders
Last post by _japheth - July 19, 2024, 12:38:46 AM
Quote from: daydreamer on July 18, 2024, 10:15:13 PMits design is old dos game run ASAP=run As fast as possible,it makes my cpu go full speed with turbo and cooler fan goes full speed(windows version)

Yes, the program uses PeekMessage() in the message loop, thus returning instantly if no message is available. IIRC inserting a Sleep(1) call in the message loop - probably just before the WaitForVerticalBlank() call - should reduce cpu load significantly.
Game Development / Re: Space Invaders
Last post by FORTRANS - July 19, 2024, 12:03:17 AM

Windows NTVDM, and all ran normally.  INVADERS.COM and
INVADERS.EXE had an odd long pause after dying until I could

   Trying in an OS/2 VDM, all ran too fast.  Same odd Pauses.


Steve N.
Game Development / Re: Space Invaders
Last post by daydreamer - July 18, 2024, 10:15:13 PM
nice work japhet  :thumbsup:
its design is old dos game run ASAP=run As fast as possible,it makes my cpu go full speed with turbo and cooler fan goes full speed(windows version)

but I already have a different energy setting for lower cpu speed to switch to when run old win95 games for that to solve that kinda problem
Game Development / Re: Space Invaders
Last post by FORTRANS - July 18, 2024, 08:26:26 AM

   The Windows version works well with my Win2k system.


Game Development / Re: Space Invaders
Last post by Vortex - July 18, 2024, 04:25:12 AM
Hi Japheth,

Nice work :thumbsup:

For those who would like to try the game, here is how to use the keyboard : left and right arrow keys to move the cannon and SPACE to fire.
Game Development / Space Invaders
Last post by _japheth - July 17, 2024, 08:45:34 PM

Hello Friends,

I played with Paul S. Reid's "Space Invaders" source code a bit. It's a clone of the famous Arcade game of the 1980s, written with TASM, using VGA mode 0x13 ( 320x200x8 ). The first step was to convert it to Masm syntax. Then, just for fun, I made protected-mode variants, for DPMI 16-/32-bit and Win32.

The Win32 variant uses the (now "legacy") DirectDraw API, and runs in 640x480x8 mode; this seems to be supported by all Windows versions. It might run too fast on new machines - that probably can be fixed rather easily by switching to DirectDraw7 and then select a vertical refresh rate of 60 or 70.

The DOS versions run fine in true DOS and in DosBox. However, with Qemu and VBox there's a problem - they don't support "vertical retrace" synchronisation ( an interesting discussion about this is here: ) - so the game runs way too fast there.

Btw, the game is copyright Paul S. Reid, but distribution of binary and source is ok....

ObjAsm / Command Line Options
Last post by Biterider - July 17, 2024, 05:32:33 PM
Managing the command line options turned out to be a repetitive task that can be greatly simplified with some procedures I have come up with that I would like to share.

Starting from the following command line format:
MyApplication.exe -MyOption1 -MyOption2 ...
where MyOption can be a number, a quoted string, a bit position, a boolean or a single character, e.g.
MyApplication.exe -I:".\Windows Drivers\" -s:1 -W:42
There are 2 pieces of information needed. The first is the target structure where the options are stored and the second is the definition where the procedures take their information to process the switches.

Here I used a fictional structure that could look like this:
OPTIONS struct
  bShowUsage          BYTE      FALSE         ;-? command line switch
  pIncludeDirs        PSTRINGW  NULL          ;-I command line switch
  dSelectiveOutput    DWORD     0             ;-s command line switch
  dWarningLevel       DWORD     0             ;-W command line switch

And the second one, in accordance with the first structure, could be like this:
OptionDefTable label OPTION_ENTRY
  OPTION_ENTRY <$OfsTBStr("-?"),  OPT_IS_BOOL,    offset OPTIONS.bShowUsage>
  OPTION_ENTRY <$OfsTBStr("-I:"), OPT_IS_STRING,  offset OPTIONS.pIncludeDirs>
  OPTION_ENTRY <$OfsTBStr("-s:"), OPT_IS_BIT,     offset OPTIONS.dSelectiveOutput>
  OPTION_ENTRY <$OfsTBStr("-W:"), OPT_IS_DECIMAL, offset OPTIONS.dWarningLevel>

Once this is done, only 3 procs need to be called:
Options OPTIONS {}
invoke GetCommandLine
invoke ParseCmdLineArgs, xax
mov pCmdLineArgList, xax
lea xdx, Options
invoke GetOptions, offset OptionDefTable, xdx, xax

Finally when you are done, free the allocated argument list (pCmdLineArgList) and all option strings.
MemFree pCmdLineArgList
invoke StrDispose Options.pIncludeDirs

The workhorses are the ParseCmdLineArgs and GetOptions procedures.
They can be downloaded fromof from the attachment or from

Some definitions must be added:
OPT_IS_BOOL     equ 0
OPT_IS_BIT      equ 1
OPT_IS_CHAR     equ 2

;Option table entry
  pSwitch  PSTRINGW ?     ;BSTR
  bType    BYTE     ?
  xOffset  XWORD    ?

- pSwitch points to a BSTR in the alt .const segment and can be created using the $OfsTBStr macro.
- The created option strings are WIDE (unicode) und must be disposed when no longer needed.

Regards, Biterider
The Campus / Re: ML errors
Last post by stoo23 - July 17, 2024, 11:28:39 AM
Beat me to it,  :smiley: ... I was on the phone. ... Thanks  :thumbsup:
The Campus / Re: ML errors
Last post by NoCforMe - July 17, 2024, 11:21:57 AM