From news.sas.ab.ca!rover.ucs.ualberta.ca!news.bc.net!vanbc.wimsey.com!news.mindlink.net!agate!spool.mu.edu!howland.reston.ans.net!news.sprintlink.net!news.dgsys.com!DGS.dgsys.com!raymoon Mon Mar 27 16:41:31 1995
Path: news.sas.ab.ca!rover.ucs.ualberta.ca!news.bc.net!vanbc.wimsey.com!news.mindlink.net!agate!spool.mu.edu!howland.reston.ans.net!news.sprintlink.net!news.dgsys.com!DGS.dgsys.com!raymoon
From: raymoon@dgsys.com (Raymond Moon)
Newsgroups: comp.lang.asm.x86,alt.lang.asm
Subject: x86 Assembly Language FAQ - MASM
Followup-To: poster
Date: 25 Mar 1995 23:18:17 GMT
Organization: Digital Gateway Systems
Lines: 266
Distribution: world
Expires: Thu, 20 Apr 1995 23:59:59 GMT
Message-ID: <3l28bp$1j8@news.dgsys.com>
Reply-To: raymoon@dgs.dgsys.com
NNTP-Posting-Host: dgs.dgsys.com
Summary: This is the FAQ for the x86 Assembly Language programmers
 for the alt.lang.asm and comp.lang.asm.x86 newsgroups.  This
 particular section of the FAQ contains x86 assembly information
 specific to the Microsoft MASM assembler.
Keywords: ASM FAQ MASM
X-Newsreader: TIN [version 1.2 PL2]
Xref: news.sas.ab.ca comp.lang.asm.x86:6023 alt.lang.asm:4555

Archive-name: asm_x86_faq/masm
Alt-lang-asm-archive-name: asm_x86_faq/masm
Comp-lang-asm-x86-archive-name: asm_x86_faq/masm
Posting-Frequency: monthly (21st of every month)
Last-modified: 1995/02/19

------------------------------

Subject: 1. Introduction and Intent

This is the x86 Assembly Language FAQ for the comp.lang.asm.x86 and
alt.lang.asm and newsgroups.  This FAQ is posted monthly on or about
the 21st of the month on both newsgroups and news.answers, alt.answers
and comp.answers.  It also is archived at the normal FAQ archival
sites.  Currently, this FAQ is broken into four sections.  The
following are the section filenames (hopefully, once the FAQ as a
whole is approved) and the scope of each section of the FAQ.

asm_x86_faq/gen_part1 - This is the basic portion of the FAQ that
    contains information of interest to all assembly language
    programmers.  In general, the information contained in this
    portion of the FAQ is not specific to any particular assembler.

asm_x86_faq/gen_part2 - This is a continuation of the above FAQ.

asm_x86_faq/masm - This portion of the FAQ contains information
    specific for the Microsoft MASM.

asm_x86_faq/tasm - This portion of the FAQ contains information
    specific for the Borland TASM.

asm_x86_faq/A86 - This portion of the FAQ contains information
    specific for the A86 Shareware Assembler.

The scope and content of this FAQ is to go beyond just answering the
frequently asked questions.  I am including pointers to assembly
language treasure troves that are hidden out on the internet.  I
believe that this will enhance the FAQ's value not only to the novices
but also to the old hands.

Any subject listed as "OPEN" means that this topic as been requested
but no one has come forth and volunteered to write this section. 
Volunteers please indicate your intentions to the author listed below
either by posting to either newsgroup or by sending e-mail to the
author at the below address.

The general guidelines for submission are:
 *  accuracy and conciseness;
 *  pointers to where on the internet more detailed information is
    available; and
 *  any code submitted will be generic so that most assemblers can
    assemble successfully.

Any subject listed as "UNDER CONSTRUCTION" has a volunteer currently
writing that subject.  If you desire to assist or have some
information that you believe would be of help in writing that
particular subject, contact the contributor of that subject or post to
both newsgroups.  Once a subject is submitted to me, I will post it on
both newsgroups for comment.  After any changes that may be necessary
are made, I will include it in the next posting of the FAQ.

For the ease of determining what has changed since the last FAQ, the
Table of Contents will have "REVISED" at the end of the subject line
for all revised subjects.  If more than one FAQ revision has been
missed, the "Last Changed:" entry at the end of each subject can be
used to determine which subjects have been revised during the
intervening time frame.

The information in this FAQ is free for all to use as long as you
acknowledge the source.  This FAQ can be reproduced in part or in its
entirety as long as the copyright is included.  This FAQ can be made
available on public servers, like ftp, gopher or WWW servers.  Please
do not modify the file, such as converting it into some other format,
without prior permission of the author.

Suggestions for changes and comments are always welcome.  They can be
posted to either newsgroup or e-mailed directly to the me.

As I had to break this section of the FAQ into two parts, I probably
will have to start the approval process all over again.  That is about
a two month process.  So, do not use the above filenames until this
FAQ is approved.

Author: Raymond Moon, raymoon@dgs.dgsys.com
Copyright 1995 - Raymond Moon
ALL RIGHTS RESERVED
Last Changed: 22 Mar 95

------------------------------

Subject: 2. Table Of Contents

1.  Introduction And Intent                         REVISED
2.  Table Of Contents                               REVISED
3.  How To Get The Patch For MASM 6.11
4.  What Is And How To Access The Microsoft Knowledge Base
5.  Pentium Instruction Macros
6.  Acknowledgements
7.  Intel OpCodes Not Supported By MASM             OPEN
8.  Illegal OpCodes In MASM                         OPEN
9.  Undocumented OpCodes                            OPEN
    
------------------------------

Subject: 3. How To Get The Patch For MASM 6.11

There is a patch available from Microsoft for MASM 6.11.  This patch
converts MASM 6.11 into the latest version MASM 6.11a.

To obtain this patch:

    ftp ftp.microsoft.com
    anonymous ftp log on
    cd /softlib/mslfiles
    get ML611A.EXE

ML611A.EXE is a self-extracting file which when executed will create
the following files:

    ERRMSG.TXT      PATCH.RTP
    H2INC.EXE       PATCH.RTD
    H2INC.ERR       README.TXT
    ML611A.TXT      SUPPORT.TXT
    PATCH.EXE

All the instructions for installing the patch are contained in
ML611A.TXT.

Contributor: Raymond Moon, raymoon@dgs.dgsys.com
Last Changed: 28 Dec 94

------------------------------

Subject: 4.  What Is and How to Access the Microsoft Knowledge Base


4.1  WHAT IS THE MICROSOFT KNOWLEDGE BASE

The Microsoft Knowledge Base (KB) is a collection of articles that is
maintained and used by the Microsoft Support personnel to answer
customer questions.  Included in the Knowledge Base are detailed
how-to articles, answers to technical support questions, bug lists,
fix lists, and documentation errors.  This Knowledge Base is available
to all on Microsoft's Internet Node.  An index of all the articles is
available in a file, index.txt.

4.2  HOW TO OBTAIN INDEX.TXT

    ftp ftp.microsoft.com
    anonymous ftp log on
    cd /developr/masm/kb
    get index.txt

4.3  FILE FORMAT OF INDEX.TXT

The format of this file consists of three columns.

    Column One is the file type with the following meanings:
        FIX     - Bug Fix
        DOCERR  - Documentation Error
        INF     - Information
        PRB     - Problem
        BUG     - Bug
    Column Two is the path and file name in the following format:
        Qxxxyzz
        where   the part,  Qxxx', is Q followed by two or three
                    numbers and represents the first subdirectory
                    under the kb subdirectory,
                the part,  y', is the next subdirectory under Qxxx,
                    and
                The part,  zz', when combined with  .txt' is the
                    filename.

                ****WARNING**** Some of the Qs are uppercase and some
                are lower case.  Unlike DOS, the filenames and
                directory names are case sensitive.

    Column Three is a short description of the file.

4.4  GETTING FILES

You can get all the files from the /developr/masm/kb directory without
transversing this very strange directory structure by using the path
in the get command.  As an example, let's say you want Q106399, a very
useful file if you use Visual C++ (see below).  Using the parsing
rules above, you can use the following get command:

    get q106/3/99.txt
    
4.5  HOW TO ACCESS THE KNOWLEDGE BASE USING GOPHER

    gopher gopher.microsoft.com
    select "Access the Microsoft Knowledge Base (KB)/"
    select "Knowledge Base (KB) - Developer Tools /"
    select "Search Macro Assembler (MASM) kb (?)

Now you can search the Knowledge Base for any entry with a specific
word.

4.6  HOW TO ACCESS USING WWW

    Go to the home page: http://www.microsoft.com
    select "7. Access the Microsoft Knowledge Base and Software
        Library"
    select "Access the Knowledge Base (KB) for Developer Tools"
    select "Search the Macro Assembler (MASM) KB"

At this point you will be dropped to the gopher interface to conduct
the searches and read the responses.

Another www site for this knowledge base also is available.  It is:
    http://emwac.ed.ac.uk/html/kb/masm.html

4.7  SOME EXAMPLE FILES FROM THE MICROSOFT KNOWLEDGE BASE

Q86815  Mixed C and MASM with MASM Main Language, No C Run-Time
Q86816  Mixed C and MASM with MASM Main Language, C Run-Time
Q101264 Assembling Code Developed for MASM 5.x with MASM 6.x
Q106399 Using the Visual Workbench with MASM
Q110598 Spontaneous Assembly and MASM 6.11 Errors
Q123729 Accessing Command Line Arguments

    I have found Q106399 particularly helpful since I am really upset
    that Microsoft did not include direct support of MASM from within
    the Visual Workbench.

Contributor: Raymond Moon, raymoon@dgs.dgsys.com
Last Changed: 19 Feb 95

------------------------------

Subject 5. Pentium Instruction Macros

Macros that implement the new instructions available with the Pentium
processor is available from intel.

    ftp ftp.intel.com
    anonymous log on
    cd put/IAL/Pentium
    get p5masm.mac

The new macros are:
    CMPXCHG8B   - Compare and exchange eight bytes 
    CPUID       - CPU Identification
    RDTSC       - Read Time Stamp Counter
    MOVTOCR4    - Move reg to CR4
    MOVFROMCR4  - Move CR4 to reg
    RDMSR       - Read Model Specific Register
    WRMSR       - Write Model Specific Register
    RSM         - Resume from SMM

Contributor: Raymond Moon, raymoon@dgs.dgsys.com
Last Changed: 8 Jan 95

------------------------------

Subject: 6. Acknowledgments

I would like to acknowledge all the people who have assisted me or any
of the contributors.  For their time and effort, this FAQ is a better
product.

Kevin Weinrich 
 



