

        README for the MASM 6.0 Demonstration Program ASMCLOCK.ASM


ASMCLOCK is a direct translation of the sample program DIGCLOCK in Chapter 5
of Charles Petzold's "Programming Windows".

The purpose of this demonstration program was not to show how much better
assembler programming is than C for this particular application, rather to
show that Windows programming is now POSSIBLE with MASM 6.0.  Because of the
new high-level and not-so high-level features in MASM 6.0, this sample
application was actually a very straight-forward to develop.

Files in this demonstration are:

    o README.TXT       This file
    o ASMCLOCK.ASM     Application source code
    o ASMCLOCK.MAK     NMAKE file for this application
    o ASMCLOCK.DEF     Linker DEF file
    o ASMCLOCK.OBJ     Result of assembling ASMCLOCK.ASM
    o ASMCLOCK.EXE     Application executable
    o WINDOWS.INC      Converted WINDOWS.H
    o STDIO.INC        Converted from STDIO.H by H2INC
    o TIME.INC         Converted from TIME.H by H2INC
    o PROLOGUE.INC     Prologue/Epilogue sequences

NOTE: In order to actually build this application you must have the Windows
      SDK v3.0 and MASM 6.0.


Items of Interest
-----------------

If you build the application, the first interesting item you will notice
is the new command-line program to run the assembler.  Previous releases
used MASM.EXE.  Keeping with the rest of the Microsoft family of languages,
this new release uses ML.EXE (akin to CL and FL).  For those of you who
have MAKE files that are dependent upon MASM.EXE, we have included a
MASM.EXE utility that converts the old command-line arguments to the new
and then invokes ML.EXE.

ASMCLOCK.ASM demonstrates many of the new features available with MASM 6.0.
Moving from the top of the files ASMCLOCK.ASM and moving down through the
source, some of the items of interest are:

    o STDIO.INC and TIME.INC were directly converted from their C counterparts
      (STDIO.H and TIME.H) using the new utility in MASM 6.0, H2INC.  H2INC
      converts the C header files to their MASM include file equivalent.
      H2INC takes advantage of the new features available in MASM 6.0, so the
      resulting .INC file can only be used with MASM 6.0.

    o PROTOTYPES.  Prototypes are new to MASM 6.0.  The have the same purpose
      as prototypes in other high-level languages.  Having prototypes allows
      MASM to check on the calling convention, distance, number and types
      of arguments being used in PROC's and in INVOKE's (more on that in a
      bit).

    o New data initializers.  Instead of DB's and DW's we now have BYTE
      (unsigned), SBYTE (signed), WORD, SWORD, REAL4, REAL8, etc. etc.

    o In the PROC statement for WinMain, the type of the hInstance parameter
      is HANDLE.  MASM 6.0 has the new directive TYPEDEF to let programmer's
      define their own types (HANDLE and LPSTR are defined in WINDOWS.INC).

    o .IF (hPrevInstance == 0).  MASM 6.0 has provided high-level programming
      constructs.  The whole family includes .IF/.ELSEIF/.ELSE/.ENDIF,
      .WHILE/.ENDW, .REPEAT/.UNTIL/.UNTILCXZ, and .BREAK and .CONTINUE.

    o INVOKE.  The counterpart to PROTO is INVOKE.  This is an intelligent
      CALL.  The arguments are pushed on to the stack according to the
      procedure's calling convention (and cleaned up if necessary).
      Programming for Windows is API function call based, so calling pre-set
      system functions is a large percentage of Windows programming, this
      feature alone makes Windows programming possible.

These are some of the "cooler" new features in MASM 6.0, there are also
some other less visible changes that make MASM 6.0 an even more powerful
assembler.  An example of this is the ability to ASSUME registers to items
other than segments in this example BX gets ASSUME'd to a pointer to a
structure.

MASM 6.0 made this Windows demonstration possible.  The high-level features
in the assembler make the code easier to write and understand.  Basically,
MASM 6.0 makes it easier to make your programmer's faster.

Thanks,
B.
