Full Code of ShiftMediaProject/VSNASM for AI

master 17e296350603 cached
8 files
64.0 KB
16.1k tokens
1 requests
Download .txt
Repository: ShiftMediaProject/VSNASM
Branch: master
Commit: 17e296350603
Files: 8
Total size: 64.0 KB

Directory structure:
gitextract_i1xg_j63/

├── .gitattributes
├── .gitignore
├── COPYING
├── README.md
├── install_script.bat
├── nasm.props
├── nasm.targets
└── nasm.xml

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitattributes
================================================
* text=auto
*.bat text eol=crlf
*.props text eol=crlf
*.targets text eol=crlf
*.xml text eol=crlf


================================================
FILE: .gitignore
================================================
*.exe
*.zip
/.vs


================================================
FILE: COPYING
================================================
                  GNU LESSER GENERAL PUBLIC LICENSE
                       Version 2.1, February 1999

 Copyright (C) 1991, 1999 Free Software Foundation, Inc.
 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

[This is the first released version of the Lesser GPL.  It also counts
 as the successor of the GNU Library Public License, version 2, hence
 the version number 2.1.]

                            Preamble

  The licenses for most software are designed to take away your
freedom to share and change it.  By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.

  This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it.  You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.

  When we speak of free software, we are referring to freedom of use,
not price.  Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.

  To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights.  These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.

  For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you.  You must make sure that they, too, receive or can get the source
code.  If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it.  And you must show them these terms so they know their rights.

  We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.

  To protect each distributor, we want to make it very clear that
there is no warranty for the free library.  Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.

  Finally, software patents pose a constant threat to the existence of
any free program.  We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder.  Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.

  Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License.  This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License.  We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.

  When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library.  The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom.  The Lesser General
Public License permits more lax criteria for linking other code with
the library.

  We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License.  It also provides other free software developers Less
of an advantage over competing non-free programs.  These disadvantages
are the reason we use the ordinary General Public License for many
libraries.  However, the Lesser license provides advantages in certain
special circumstances.

  For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard.  To achieve this, non-free programs must be
allowed to use the library.  A more frequent case is that a free
library does the same job as widely used non-free libraries.  In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.

  In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software.  For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.

  Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.

  The precise terms and conditions for copying, distribution and
modification follow.  Pay close attention to the difference between a
"work based on the library" and a "work that uses the library".  The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.

                  GNU LESSER GENERAL PUBLIC LICENSE
   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

  0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".

  A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.

  The "Library", below, refers to any such software library or work
which has been distributed under these terms.  A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language.  (Hereinafter, translation is
included without limitation in the term "modification".)

  "Source code" for a work means the preferred form of the work for
making modifications to it.  For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.

  Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope.  The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it).  Whether that is true depends on what the Library does
and what the program that uses the Library does.

  1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.

  You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.

  2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:

    a) The modified work must itself be a software library.

    b) You must cause the files modified to carry prominent notices
    stating that you changed the files and the date of any change.

    c) You must cause the whole of the work to be licensed at no
    charge to all third parties under the terms of this License.

    d) If a facility in the modified Library refers to a function or a
    table of data to be supplied by an application program that uses
    the facility, other than as an argument passed when the facility
    is invoked, then you must make a good faith effort to ensure that,
    in the event an application does not supply such function or
    table, the facility still operates, and performs whatever part of
    its purpose remains meaningful.

    (For example, a function in a library to compute square roots has
    a purpose that is entirely well-defined independent of the
    application.  Therefore, Subsection 2d requires that any
    application-supplied function or table used by this function must
    be optional: if the application does not supply it, the square
    root function must still compute square roots.)

These requirements apply to the modified work as a whole.  If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works.  But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.

Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.

In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.

  3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library.  To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License.  (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.)  Do not make any other change in
these notices.

  Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.

  This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.

  4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.

  If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.

  5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library".  Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.

  However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library".  The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.

  When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library.  The
threshold for this to be true is not precisely defined by law.

  If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work.  (Executables containing this object code plus portions of the
Library will still fall under Section 6.)

  Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.

  6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.

  You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License.  You must supply a copy of this License.  If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License.  Also, you must do one
of these things:

    a) Accompany the work with the complete corresponding
    machine-readable source code for the Library including whatever
    changes were used in the work (which must be distributed under
    Sections 1 and 2 above); and, if the work is an executable linked
    with the Library, with the complete machine-readable "work that
    uses the Library", as object code and/or source code, so that the
    user can modify the Library and then relink to produce a modified
    executable containing the modified Library.  (It is understood
    that the user who changes the contents of definitions files in the
    Library will not necessarily be able to recompile the application
    to use the modified definitions.)

    b) Use a suitable shared library mechanism for linking with the
    Library.  A suitable mechanism is one that (1) uses at run time a
    copy of the library already present on the user's computer system,
    rather than copying library functions into the executable, and (2)
    will operate properly with a modified version of the library, if
    the user installs one, as long as the modified version is
    interface-compatible with the version that the work was made with.

    c) Accompany the work with a written offer, valid for at
    least three years, to give the same user the materials
    specified in Subsection 6a, above, for a charge no more
    than the cost of performing this distribution.

    d) If distribution of the work is made by offering access to copy
    from a designated place, offer equivalent access to copy the above
    specified materials from the same place.

    e) Verify that the user has already received a copy of these
    materials or that you have already sent this user a copy.

  For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it.  However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.

  It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system.  Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.

  7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:

    a) Accompany the combined library with a copy of the same work
    based on the Library, uncombined with any other library
    facilities.  This must be distributed under the terms of the
    Sections above.

    b) Give prominent notice with the combined library of the fact
    that part of it is a work based on the Library, and explaining
    where to find the accompanying uncombined form of the same work.

  8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License.  Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License.  However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.

  9. You are not required to accept this License, since you have not
signed it.  However, nothing else grants you permission to modify or
distribute the Library or its derivative works.  These actions are
prohibited by law if you do not accept this License.  Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.

  10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions.  You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.

  11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all.  For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.

If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.

It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices.  Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.

This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.

  12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded.  In such case, this License incorporates the limitation as if
written in the body of this License.

  13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.

Each version is given a distinguishing version number.  If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation.  If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.

  14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission.  For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this.  Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.

                            NO WARRANTY

  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.

                     END OF TERMS AND CONDITIONS

           How to Apply These Terms to Your New Libraries

  If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change.  You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).

  To apply these terms, attach the following notices to the library.  It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.

    <one line to give the library's name and a brief idea of what it does.>
    Copyright (C) <year>  <name of author>

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

Also add information on how to contact you by electronic and paper mail.

You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary.  Here is a sample; alter the names:

  Yoyodyne, Inc., hereby disclaims all copyright interest in the
  library `Frob' (a library for tweaking knobs) written by James Random Hacker.

  <signature of Ty Coon>, 1 April 1990
  Ty Coon, President of Vice

That's all there is to it!


================================================
FILE: README.md
================================================
VSNASM
=============

[![Github All Releases](https://img.shields.io/github/downloads/ShiftMediaProject/VSNASM/total.svg)](https://github.com/ShiftMediaProject/VSNASM/releases)
[![GitHub release](https://img.shields.io/github/release/ShiftMediaProject/VSNASM.svg)](https://github.com/ShiftMediaProject/VSNASM/releases/latest)
[![GitHub issues](https://img.shields.io/github/issues/ShiftMediaProject/VSNASM.svg)](https://github.com/ShiftMediaProject/VSNASM/issues)
[![license](https://img.shields.io/github/license/ShiftMediaProject/VSNASM.svg)](https://github.com/ShiftMediaProject/VSNASM)
[![donate](https://img.shields.io/badge/donate-link-brightgreen.svg)](https://shiftmediaproject.github.io/8-donate/)

## About

This project provides a set of build customisations that can be used within Visual Studio to compile assembly code using NASM.
Provides Visual Studio integration for the NASM assembler.
Supports Visual Studio 2010, 2012, 2013, 2015, 2017, 2019, 2022 and 2026.

## NASM

The Netwide Assembler (NASM) is an assembler and disassembler for the Intel x86 architecture. It can be used to write 16-bit, 32-bit (IA-32) and 64-bit (x86-64) programs.
For more information on NASM refer to the official site: [www.nasm.us](https://www.nasm.us/).

## Installation

The project provides a basic installer script that can automatically detect any installed Visual Studio 2013, 2015, 2017, 2019, 2022 and 2026 installation and then install the required components.
To use this script simply run '**install_script.bat**' from an elevated (i.e administrator) command prompt.

## Usage

Once installed VSNASM adds an additional usable Build Customization into Visual Studio. To use VSNASM in a project you must enable the customization for any project requiring it by right clicking on the project in the Solution Explorer and selecting 'Build Dependencies -> Build Customisations..' and then selecting VSNASM from the available options.

## Manual Installation (optional)

Alternatively, to manually install the extension you will first need to download the required win32 or win64 binary (depending on your system) from the official NASM website [www.nasm.us](https://www.nasm.us/).

From the download archive you will need to extract nasm.exe into a location that Visual Studio can see.
To tell Visual Studio where to find nasm.exe you have several options:

1. Find the directory where the Visual Studio C++ compiler is installed.
This can be determined from within Visual Studio by checking the contents of the VCInstallDir macro.
For example the location for Visual Studio 2015 would be:

    1. C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\         -- For a 64 bit system
    2. C:\Program Files\Microsoft Visual Studio 14.0\VC\               -- For a 32 bit system

2. You can install nasm to any directory and then set environment variable NASMPATH to point to the absolute directory of the installed nasm.exe (this path should include the final backslash).

To use the build customisation in Visual Studio you need to copy the 3 provided files (nasm.props, nasm.xml, nasm.targets) into a location where they can be found by the Visual Studio build customisation processes.
There are several ways to do this:

1. Copy these files to the MSBuild customisations directory.
This can be determined from within Visual Studio by checking the contents of the VCTargetsPath macro.
For example the location for various Visual Studio Community Edition versions on a 64 bit system would be:

    1. Visual Studio 2013: C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\BuildCustomizations
    2. Visual Studio 2015: C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\BuildCustomizations
    3. Visual Studio 2017: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\BuildCustomizations
    4. Visual Studio 2019: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\BuildCustomizations
    5. Visual Studio 2022: C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\BuildCustomizations
    6. Visual Studio 2026: C:\Program Files\Microsoft Visual Studio\18\Community\MSBuild\Microsoft\VC\v180\BuildCustomizations

2. Copy these files to a convenient location and set that path in the 'Build Customisations Search Path' in the Visual Studio 'Projects and Solutions|VC++ Project Settings' item in the 'Tools|Options' menu.

3. Copy these files to a convenient location and set this path in the 'Build Customisation dialogue (discussed later).

To use NASM in a project you must enable the customisation by right clicking on the project in the Solution Explorer and select 'Build Customisations..'. This will give you a dialog box that allows you to select NASM as an assembler (note that your assembly files need to have the extension '.asm').  If you have used option **3** above, you will need to let the dialogue find them using the 'Find Existing' button below the dialogue.

To assemble a file with NASM, select the Property Page for the file and ensure that 'Nasm Assembler' is selected in the Tool dialog entry.
The additional NASM property page can then be used to change various options supported by NASM.


================================================
FILE: install_script.bat
================================================
@echo OFF
setlocal

REM Defined script variables
set NASMDL=http://www.nasm.us/pub/nasm/releasebuilds
set NASMVERSION=3.01
set VSWHEREDL=https://github.com/Microsoft/vswhere/releases/download
set VSWHEREVERSION=3.1.7

REM Store current directory and ensure working directory is the location of current .bat
set CALLDIR=%CD%
set SCRIPTDIR=%~dp0

REM Initialise error check value
set ERROR=0
REM Check if being called from another instance
if not "%~1"=="" (
    set MSVC_VER=%~1
    set ISINSTANCE=1
    echo Installing VS%~1 customisations into %2
    goto MSVCCALL
)

REM Check what architecture we are installing on
if "%PROCESSOR_ARCHITECTURE%"=="AMD64" (
    echo Detected 64 bit system...
    set SYSARCH=64
) else if "%PROCESSOR_ARCHITECTURE%"=="x86" (
    if "%PROCESSOR_ARCHITEW6432%"=="AMD64" (
        echo Detected 64 bit system running 32 bit shell...
        set SYSARCH=64
    ) else (
        echo Detected 32 bit system...
        set SYSARCH=32
    )
) else (
    echo Error: Could not detect current platform architecture!"
    goto Terminate
)

REM Check if already running in an environment with VS setup
if defined VCINSTALLDIR (
    if defined VisualStudioVersion (
        if "%VisualStudioVersion%"=="18.0" (
            echo Existing Visual Studio 2026 environment detected...
            set MSVC_VER=18
            goto MSVCVarsDone
        ) else if "%VisualStudioVersion%"=="17.0" (
            echo Existing Visual Studio 2022 environment detected...
            set MSVC_VER=17
            goto MSVCVarsDone
        ) else if "%VisualStudioVersion%"=="16.0" (
            echo Existing Visual Studio 2019 environment detected...
            set MSVC_VER=16
            goto MSVCVarsDone
        ) else if "%VisualStudioVersion%"=="15.0" (
            echo Existing Visual Studio 2017 environment detected...
            set MSVC_VER=15
            goto MSVCVarsDone
        ) else if "%VisualStudioVersion%"=="14.0" (
            echo Existing Visual Studio 2015 environment detected...
            set MSVC_VER=14
            goto MSVCVarsDone
        ) else if "%VisualStudioVersion%"=="12.0" (
            echo Existing Visual Studio 2013 environment detected...
            set MSVC_VER=12
            goto MSVCVarsDone
        ) else (
            echo Unknown Visual Studio environment detected '%VisualStudioVersion%', Creating a new one...
        )
    )
)

REM Get vswhere to detect VS installs
if exist "%SCRIPTDIR%\vswhere.exe" (
    echo Using existing vswhere binary...
    goto VSwhereDetection
)
set VSWHEREDOWNLOAD=%VSWHEREDL%/%VSWHEREVERSION%/vswhere.exe
echo Downloading required vswhere release binary...
powershell.exe -Command "(New-Object Net.WebClient).DownloadFile('%VSWHEREDOWNLOAD%', '%SCRIPTDIR%\vswhere.exe')" >nul 2>&1
if not exist "%SCRIPTDIR%\vswhere.exe" (
    echo Error: Failed to download required vswhere binary!
    echo    The following link could not be resolved "%VSWHEREDOWNLOAD%"
    echo    Now trying fallback detection..."
    goto MSVCRegDetection
)

:VSwhereDetection
REM Use vswhere to list detected installs
for /f "usebackq tokens=* delims=" %%i in (`"%SCRIPTDIR%\vswhere.exe" -prerelease -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do (
    for /f "delims=" %%a in ('echo %%i ^| find "18"') do (
        if not "%%a"=="" (
            echo Visual Studio 2026 environment detected...
            call "%~0" "18" "%%i"
            if not ERRORLEVEL 1 (
                set MSVC18=1
                set MSVCFOUND=1
            )
        )
    )
    for /f "delims=" %%a in ('echo %%i ^| find "2022"') do (
        if not "%%a"=="" (
            echo Visual Studio 2022 environment detected...
            call "%~0" "17" "%%i"
            if not ERRORLEVEL 1 (
                set MSVC17=1
                set MSVCFOUND=1
            )
        )
    )
    for /f "delims=" %%a in ('echo %%i ^| find "2019"') do (
        if not "%%a"=="" (
            echo Visual Studio 2019 environment detected...
            call "%~0" "16" "%%i"
            if not ERRORLEVEL 1 (
                set MSVC16=1
                set MSVCFOUND=1
            )
        )
    )
    for /f "delims=" %%a in ('echo %%i ^| find "2017"') do (
        if not "%%a"=="" (
            echo Visual Studio 2017 environment detected...
            call "%~0" "15" "%%i"
            if not ERRORLEVEL 1 (
                set MSVC15=1
                set MSVCFOUND=1
            )
        )
    )
)

REM Try and use vswhere to detect legacy installs
for /f "usebackq tokens=* delims=" %%i in (`"%SCRIPTDIR%\vswhere.exe" -legacy -property installationPath`) do (
    for /f "delims=" %%a in ('echo %%i ^| find "2015"') do (
        if not "%%a"=="" (
            echo Visual Studio 2015 environment detected...
            call "%~0" "13" "%%i"
            if not ERRORLEVEL 1 (
                set MSVC13=1
                set MSVCFOUND=1
            )
        )
    )
    for /f "delims=" %%a in ('echo %%i ^| find "2013"') do (
        if not "%%a"=="" (
            echo Visual Studio 2013 environment detected...
            call "%~0" "12" "%%i"
            if not ERRORLEVEL 1 (
                set MSVC12=1
                set MSVCFOUND=1
            )
        )
    )
)
if not defined MSVCFOUND (
    echo Error: Failed to detect VS installations using vswhere!
    echo    Now trying fallback detection...
) else (
    goto Exit
)

:MSVCRegDetection
if "%SYSARCH%"=="32" (
    set MSVCVARSDIR=
    set WOWNODE=
) else if "%SYSARCH%"=="64" (
    set MSVCVARSDIR=\amd64
    set WOWNODE=\WOW6432Node
) else (
    goto Terminate
)
REM First check for a environment variable to help locate the VS installation
if defined VS140COMNTOOLS (
    if exist "%VS140COMNTOOLS%\..\..\VC\bin%MSVCVARSDIR%\vcvars%SYSARCH%.bat" (
        echo Visual Studio 2015 environment detected...
        call "%~0" "14" "%VS140COMNTOOLS%\..\..\"
        if not ERRORLEVEL 1 (
            set MSVC14=1
            set MSVCFOUND=1
        )
    )
)
if defined VS120COMNTOOLS (
    if exist "%VS120COMNTOOLS%\..\..\VC\bin%MSVCVARSDIR%\vcvars%SYSARCH%.bat" (
        echo Visual Studio 2013 environment detected...
        call "%~0" "12" "%VS120COMNTOOLS%\..\..\"
        if not ERRORLEVEL 1 (
            set MSVC12=1
            set MSVCFOUND=1
        )
    )
)

REM Check for default install locations based on current system architecture
if not defined MSVC15 (
    reg.exe query "HKLM\SOFTWARE%WOWNODE%\Microsoft\VisualStudio\SxS\VS7" /v 15.0 >nul 2>&1
    if not ERRORLEVEL 1 (
        echo Visual Studio 2017 installation detected...
        for /f "skip=2 tokens=2,*" %%i in ('reg.exe query "HKLM\SOFTWARE%WOWNODE%\Microsoft\VisualStudio\SxS\VS7" /v 15.0') do (
            call "%~0" "15" "%%j"
            if not ERRORLEVEL 1 (
                set MSVC15=1
                set MSVCFOUND=1
            )
        )
    )
)
if not defined MSVC14 (
    reg.exe query "HKLM\Software%WOWNODE%\Microsoft\VisualStudio\14.0" /v "InstallDir" >nul 2>&1
    if not ERRORLEVEL 1 (
        echo Visual Studio 2015 installation detected...
        for /f "skip=2 tokens=2,*" %%i in ('reg.exe query "HKLM\Software%WOWNODE%\Microsoft\VisualStudio\14.0" /v "InstallDir"') do (
            call "%~0" "14" "%%j"
            if not ERRORLEVEL 1 (
                set MSVC14=1
                set MSVCFOUND=1
            )
        )
    )
)
if not defined MSVC12 (
    reg.exe query "HKLM\Software%WOWNODE%\Microsoft\VisualStudio\12.0" /v "InstallDir" >nul 2>&1
    if not ERRORLEVEL 1 (
        echo Visual Studio 2013 installation detected...
        for /f "skip=2 tokens=2,*" %%i in ('reg.exe query "HKLM\Software%WOWNODE%\Microsoft\VisualStudio\12.0" /v "InstallDir"') do (
            call "%~0" "12" "%%j"
            if not ERRORLEVEL 1 (
                set MSVC12=1
                set MSVCFOUND=1
            )
        )
    )
)
if not defined MSVCFOUND (
    echo Error: Could not find valid Visual Studio installation!
    goto Terminate
)
goto Exit

:MSVCCALL
if "%SYSARCH%"=="32" (
    set MSVCVARSDIR=
) else if "%SYSARCH%"=="64" (
    set MSVCVARSDIR=\amd64
) else (
    goto Terminate
)
REM Call the required vcvars file in order to setup up build locations
if "%MSVC_VER%"=="18" (
    set VCVARS=%2\VC\Auxiliary\Build\vcvars%SYSARCH%.bat
) else if "%MSVC_VER%"=="17" (
    set VCVARS=%2\VC\Auxiliary\Build\vcvars%SYSARCH%.bat
) else if "%MSVC_VER%"=="16" (
    set VCVARS=%2\VC\Auxiliary\Build\vcvars%SYSARCH%.bat
) else if "%MSVC_VER%"=="15" (
    set VCVARS=%2\VC\Auxiliary\Build\vcvars%SYSARCH%.bat
) else if "%MSVC_VER%"=="14" (
    set VCVARS=%2\VC\bin%MSVCVARSDIR%\vcvars%SYSARCH%.bat
) else if "%MSVC_VER%"=="12" (
    set VCVARS=%2\VC\bin%MSVCVARSDIR%\vcvars%SYSARCH%.bat
) else (
    echo Error: Invalid MSVC version!
    goto Terminate
)
if exist %VCVARS% (
    call %VCVARS% >nul 2>&1
) else (
    echo Error: Invalid VS install location detected!
    goto Terminate
)

:MSVCVarsDone
REM Get the location of the current msbuild
powershell.exe -Command ((Get-Command msbuild.exe)[0].Path ^| Split-Path -parent) > "%SCRIPTDIR%\msbuild.txt"
findstr /C:"Get-Command" "%SCRIPTDIR%\msbuild.txt" >nul 2>&1
if not ERRORLEVEL 1 (
    echo Error: Failed to get location of msbuild!
    del /F /Q "%SCRIPTDIR%\msbuild.txt" >nul 2>&1
    goto Terminate
)
set /p MSBUILDDIR=<"%SCRIPTDIR%\msbuild.txt"
del /F /Q "%SCRIPTDIR%\msbuild.txt" >nul 2>&1
if "%MSVC_VER%"=="18" (
    set VCTargetsPath="..\..\..\Microsoft\VC\v180\BuildCustomizations"
) else if "%MSVC_VER%"=="17" (
    set VCTargetsPath="..\..\..\Microsoft\VC\v170\BuildCustomizations"
) else if "%MSVC_VER%"=="16" (
    set VCTargetsPath="..\..\Microsoft\VC\v160\BuildCustomizations"
) else if "%MSVC_VER%"=="15" (
    set VCTargetsPath="..\..\..\Common7\IDE\VC\VCTargets\BuildCustomizations"
) else (
    if "%MSBUILDDIR%"=="%MSBUILDDIR:amd64=%" (
        set VCTargetsPath="..\..\Microsoft.Cpp\v4.0\V%MSVC_VER%0\BuildCustomizations"
    ) else (
        set VCTargetsPath="..\..\..\Microsoft.Cpp\v4.0\V%MSVC_VER%0\BuildCustomizations"
    )
)

REM Convert the relative targets path to an absolute one
set CURRDIR=%CD%
pushd %MSBUILDDIR% 2>nul
if %ERRORLEVEL% neq 0 (
    echo Error: Failed to get correct msbuild path!
    goto Terminate
)
pushd %VCTargetsPath% 2>nul
if %ERRORLEVEL% neq 0 (
    echo Error: Unknown VCTargetsPath path!
    goto Terminate
)
set VCTargetsPath=%CD%
popd
popd
if not "%CURRDIR%"=="%CD%" (
    echo Error: Failed to resolve VCTargetsPath!
    goto Terminate
)

REM copy the BuildCustomizations to VCTargets folder
echo Installing build customisations...
del /F /Q "%VCTargetsPath%\nasm.*" >nul 2>&1
copy /B /Y /V "%SCRIPTDIR%\nasm.*" "%VCTargetsPath%\" >nul 2>&1
if %ERRORLEVEL% neq 0 (
    echo Error: Failed to copy build customisations!
    echo    Ensure that this script is run in a shell with the necessary write privileges
    goto Terminate
)
REM Check if nasm is already found before trying to download it
echo Checking for existing NASM in NASMPATH...
if exist "%NASMPATH%\nasm.exe" (
    "%NASMPATH%\nasm.exe" -v >nul 2>&1
    if %ERRORLEVEL% equ 0 (
        echo Using existing NASM binary from "%NASMPATH%\nasm.exe"...
        goto SkipInstallNASM
    ) else (
        echo Warning: A suitable nasm was not found in NASMPATH="%NASMPATH%".
    )
)
REM Download the latest nasm binary for windows
if exist "%SCRIPTDIR%\nasm_%NASMVERSION%.zip" (
    echo Using existing NASM archive...
    goto InstallNASM
)
set NASMDOWNLOAD=%NASMDL%/%NASMVERSION%/win%SYSARCH%/nasm-%NASMVERSION%-win%SYSARCH%.zip
echo Downloading required NASM release binary...
powershell.exe -Command "(New-Object Net.WebClient).DownloadFile('%NASMDOWNLOAD%', '%SCRIPTDIR%\nasm_%NASMVERSION%.zip')" >nul 2>&1
if not exist "%SCRIPTDIR%\nasm_%NASMVERSION%.zip" (
    echo Error: Failed to download required NASM binary!
    echo    The following link could not be resolved "%NASMDOWNLOAD%"
    goto Terminate
)

:InstallNASM
powershell.exe -Command Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory('"%SCRIPTDIR%\nasm_%NASMVERSION%.zip"', '"%SCRIPTDIR%\TempNASMUnpack"') >nul 2>&1
if not exist "%SCRIPTDIR%\TempNASMUnpack" (
    echo Error: Failed to unpack NASM download!
    del /F /Q "%SCRIPTDIR%\nasm_.zip" >nul 2>&1
    goto Terminate
)

REM copy nasm executable to VC installation folder
echo Installing required NASM release binary...
del /F /Q "%VCINSTALLDIR%\nasm.exe" >nul 2>&1
copy /B /Y /V "%SCRIPTDIR%\TempNASMUnpack\nasm-%NASMVERSION%\nasm.exe" "%VCINSTALLDIR%" >nul 2>&1
if %ERRORLEVEL% neq 0 (
    echo Error: Failed to install NASM binary!
    echo    Ensure that this script is run in a shell with the necessary write privileges
    rd /S /Q "%SCRIPTDIR%\TempNASMUnpack" >nul 2>&1
    goto Terminate
)
rd /S /Q "%SCRIPTDIR%\TempNASMUnpack" >nul 2>&1
:SkipInstallNASM
echo Finished Successfully
goto Exit

:Terminate
set ERROR=1

:Exit
cd %CALLDIR%
if "%CI%"=="" (
    if not defined ISINSTANCE (
        pause
    )
)
endlocal & exit /b %ERROR%


================================================
FILE: nasm.props
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <NasmPath Condition= "'$(NASMPATH)' == ''">$(VCInstallDir)</NasmPath>
  </PropertyGroup>
  <ItemDefinitionGroup>
    <NASM>
      <Outputs>$(IntDir)%(FileName).obj</Outputs>
      <CommandLineTemplate Condition="'$(Platform)' == 'Win32'">"$(NasmPath)\nasm.exe" -Xvc -f win32 [AllOptions] [AdditionalOptions] "%(FullPath)"</CommandLineTemplate>
      <CommandLineTemplate Condition="'$(Platform)' == 'x64'">"$(NasmPath)\nasm.exe" -Xvc -f win64 [AllOptions] [AdditionalOptions] "%(FullPath)"</CommandLineTemplate>
      <CommandLineTemplate Condition="'$(Platform)' != 'Win32' and '$(Platform)' != 'x64'">echo NASM not supported on this platform &amp; exit 1</CommandLineTemplate>
      <ExecutionDescription>%(Identity)</ExecutionDescription>
      <Message                     Condition="'%(NASM.Message)'                     == ''">Performing NASM Compilation</Message>
      <LinkObjects                 Condition="'%(NASM.LinkObjects)'                 == ''">true</LinkObjects>
      <TreatOutputAsContent        Condition="'%(NASM.TreatOutputAsContent)'        == ''">false</TreatOutputAsContent>
      <TrackerLogDirectory         Condition="'%(NASM.TrackerLogDirectory)'         == ''">$(TLogLocation)</TrackerLogDirectory>
      <MinimalRebuildFromTracking  Condition="'%(NASM.MinimalRebuildFromTracking)'  == ''">true</MinimalRebuildFromTracking>
      <OutputItemType              Condition="'%(NASM.OutputItemType)'              == ''">Object</OutputItemType>
      <BuildInParallel             Condition="'%(NASM.BuildInParallel)'             == ''">true</BuildInParallel>
      <MaxProcesses                Condition="'%(NASM.MaxProcesses)'                == ''">0</MaxProcesses>
      <MaxItemsInBatch             Condition="'%(NASM.MaxItemsInBatch)'             == ''">1</MaxItemsInBatch>
      <VerifyInputsAndOutputsExist Condition="'%(NASM.VerifyInputsAndOutputsExist)' == ''">true</VerifyInputsAndOutputsExist>
    </NASM>
  </ItemDefinitionGroup>
</Project>


================================================
FILE: nasm.targets
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup>
    <PropertyPageSchema
      Include="$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml" />
    <AvailableItemName Include="NASM">
      <Targets>_NASM</Targets>
    </AvailableItemName>
  </ItemGroup>
  <PropertyGroup>
    <ComputeLinkInputsTargets>
      $(ComputeLinkInputsTargets);
      ComputeNASMOutput;
    </ComputeLinkInputsTargets>
  </PropertyGroup>
  <PropertyGroup>
    <ComputeLibInputsTargets>
      $(ComputeLibInputsTargets);
      ComputeNASMOutput;
    </ComputeLibInputsTargets>
  </PropertyGroup>
  <PropertyGroup>
    <ComputeImpLibInputsTargets>
      $(ComputeImpLibInputsTargets);
      ComputeNASMOutput;
    </ComputeImpLibInputsTargets>
  </PropertyGroup>
  <UsingTask
    TaskName="NASM"
    TaskFactory="XamlTaskFactory"
    AssemblyName="Microsoft.Build.Tasks.v4.0">
    <Task>$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml</Task>
  </UsingTask>
  <!-- *******************************************************************************************
        NASM
       ******************************************************************************************* -->
  <PropertyGroup Condition="'$(NASMAfterTargets)'!='' or '$(NASMBeforeTargets)'!=''">
    <NASMToolBeforeTargets>$(NASMBeforeTargets)</NASMToolBeforeTargets>
    <NASMToolAfterTargets>$(NASMAfterTargets)</NASMToolAfterTargets>
  </PropertyGroup>
  <!--If no before/after targets are set, then set the default-->
  <PropertyGroup Condition="'$(NASMAfterTargets)'=='' and '$(NASMBeforeTargets)'==''">
    <NASMToolBeforeTargets>Midl</NASMToolBeforeTargets>
    <NASMToolAfterTargets>PreBuildEvent</NASMToolAfterTargets>
    <NASMBeforeTargets>PostBuildEvent</NASMBeforeTargets>
    <NASMAfterTargets>BscMake</NASMAfterTargets>
  </PropertyGroup>
  <!--  If Selective File Build is enabled, then dont let custom interupt the build order-->
  <PropertyGroup Condition="'$(SelectedFiles)'!=''">
    <NASMToolBeforeTargets></NASMToolBeforeTargets>
    <NASMToolAfterTargets></NASMToolAfterTargets>
    <NASMBeforeTargets></NASMBeforeTargets>
    <NASMAfterTargets></NASMAfterTargets>
  </PropertyGroup>
  <Target Name="_NASM"
          BeforeTargets="$(NASMToolBeforeTargets)"
          AfterTargets="$(NASMToolAfterTargets)"
          DependsOnTargets="SelectNASM;ComputeNASMOutput">
    <PropertyGroup>
      <CustomBuildToolArchitecture Condition="'$(CustomBuildToolArchitecture)' == ''">Native32Bit</CustomBuildToolArchitecture>
    </PropertyGroup>
    <ItemGroup>
      <NASM Update="@(NASM)">
        <Inputs>%(NASM.FullPath);%(NASM.AdditionalDependencies);$(MSBuildProjectFile)</Inputs>
        <AdditionalInputs>%(NASM.FullPath);%(NASM.AdditionalDependencies);$(MSBuildProjectFile)</AdditionalInputs>
        <Message>%(NASM.ExecutionDescription)</Message>
        <!-- Option fragments used for [AllOptions] -->
        <_NasmOpt_Debug></_NasmOpt_Debug>
        <_NasmOpt_Prefix></_NasmOpt_Prefix>
        <_NasmOpt_Postfix></_NasmOpt_Postfix>
        <_NasmOpt_IncludePaths></_NasmOpt_IncludePaths>
        <_NasmOpt_PreIncludeFiles></_NasmOpt_PreIncludeFiles>
        <_NasmOpt_Defines></_NasmOpt_Defines>
        <_NasmOpt_Undefines></_NasmOpt_Undefines>
        <_NasmOpt_Werror></_NasmOpt_Werror>
        <_NasmOpt_Debug Condition="'%(NASM.GenerateDebugInformation)' == 'true'">-g</_NasmOpt_Debug>
        <_NasmOpt_Prefix Condition="'%(NASM.SymbolsPrefix)' != ''">--prefix %(NASM.SymbolsPrefix)</_NasmOpt_Prefix>
        <_NasmOpt_Postfix Condition="'%(NASM.SymbolsPostfix)' != ''">--postfix %(NASM.SymbolsPostfix)</_NasmOpt_Postfix>
        <_NasmOpt_IncludePaths Condition="'%(NASM.IncludePaths)' != ''">-I"$([System.String]::Copy('%(NASM.IncludePaths)').Trim(';').Replace(';', '/" -I"'))/"</_NasmOpt_IncludePaths>
        <_NasmOpt_PreIncludeFiles Condition="'%(NASM.PreIncludeFiles)' != ''">-P"$([System.String]::Copy('%(NASM.PreIncludeFiles)').Trim(';').Replace(';', '" -P"'))"</_NasmOpt_PreIncludeFiles>
        <_NasmOpt_Defines Condition="'%(NASM.PreprocessorDefinitions)' != ''">-D$([System.String]::Copy('%(NASM.PreprocessorDefinitions)').Trim(';').Replace(';', ' -D'))</_NasmOpt_Defines>
        <_NasmOpt_Undefines Condition="'%(NASM.UndefinePreprocessorDefinitions)' != ''">-U$([System.String]::Copy('%(NASM.UndefinePreprocessorDefinitions)').Trim(';').Replace(';', ' -U'))</_NasmOpt_Undefines>
        <_NasmOpt_Werror Condition="'%(NASM.TreatWarningsAsErrors)' == 'true'">-Werror</_NasmOpt_Werror>
      </NASM>
    </ItemGroup>
    <ItemGroup>
      <NASM Update="@(NASM)">
        <_NasmAllOptions>-o "%(NASM.Outputs)" %(NASM._NasmOpt_Debug) %(NASM._NasmOpt_Prefix) %(NASM._NasmOpt_Postfix) %(NASM._NasmOpt_IncludePaths) %(NASM._NasmOpt_PreIncludeFiles) %(NASM._NasmOpt_Defines) %(NASM._NasmOpt_Undefines) %(NASM._NasmOpt_Werror)</_NasmAllOptions>
      </NASM>
    </ItemGroup>
    <ItemGroup>
      <NASM Update="@(NASM)">
        <Command>$([System.String]::Copy('%(NASM.CommandLineTemplate)').Replace('[AllOptions]', '%(NASM._NasmAllOptions)').Replace('[AdditionalOptions]', '%(NASM.AdditionalOptions)'))</Command>
      </NASM>
    </ItemGroup>
    <!-- Delete old ParallelCustomBuild tlogs, same as CustomBuild -->
    <GetOutOfDateItems
      Sources                   ="@(_EmptyItemGroup)"
      OutputsMetadataName       ="Outputs"
      DependenciesMetadataName  ="AdditionalInputs"
      CommandMetadataName       ="Command"
      TLogDirectory             ="$(TLogLocation)"
      TLogNamePrefix            ="ParallelNasmBuild"
      TrackFileAccess           ="$(TrackFileAccess)"
      />
    <!-- Get out of date items for NASM (full build case) -->
    <GetOutOfDateItems
      Condition                 ="'$(SelectedFiles)' == ''"
      Sources                   ="@(NASM)"
      OutputsMetadataName       ="Outputs"
      DependenciesMetadataName  ="AdditionalInputs"
      CommandMetadataName       ="Command"
      TLogDirectory             ="$(TLogLocation)"
      TLogNamePrefix            ="NasmBuild"
      TrackFileAccess           ="$(TrackFileAccess)"
      CheckForInterdependencies ="true">
      <Output TaskParameter="OutOfDateSources" ItemName="_NasmBuild" />
    </GetOutOfDateItems>
    <!-- Selected-files build: just take all NASM items -->
    <ItemGroup Condition ="'$(SelectedFiles)' != ''">
      <_NasmBuild Include="@(NASM)" />
    </ItemGroup>
    <!-- Build items which can be built in parallel (ignored for selected-files build) -->
    <ItemGroup Condition="'$(SelectedFiles)' == ''">
      <_ParallelNasmBuild Include="@(_NasmBuild)"
                          Condition="'%(_NasmBuild.BuildInParallel)' == 'true' and '%(_NasmBuild.DependsOnAnotherItemOutput)' != 'true'" />
    </ItemGroup>
    <ParallelCustomBuild
      Condition       ="'@(_ParallelNasmBuild)' != ''"
      Sources         ="@(_ParallelNasmBuild)"
      MaxProcesses    ="%(_ParallelNasmBuild.MaxProcesses)"
      MaxItemsInBatch ="%(_ParallelNasmBuild.MaxItemsInBatch)"
      AcceptableNonZeroExitCodes  ="%(_ParallelNasmBuild.AcceptableNonZeroExitCodes)"
      StdOutEncoding  ="%(_ParallelNasmBuild.StdOutEncoding)"
      StdErrEncoding  ="%(_ParallelNasmBuild.StdErrEncoding)"
      UseMsbuildResourceManager ="$(UseMsbuildResourceManager)"
    />
    <!-- Build the remaining items sequentially -->
    <ItemGroup Condition="'@(_ParallelNasmBuild)' != ''">
      <_NasmBuild Remove="@(_ParallelNasmBuild)" />
      <_ParallelNasmBuild Remove="@(_ParallelNasmBuild)" />
    </ItemGroup>
    <CustomBuild Condition ="'@(_NasmBuild)' != ''"
      Sources                     ="@(_NasmBuild)"
      BuildSuffix                 ="$(_BuildSuffix)"
      MinimalRebuildFromTracking  ="false"
      AcceptableNonZeroExitCodes  ="%(_NasmBuild.AcceptableNonZeroExitCodes)"
      StdOutEncoding              ="%(_NasmBuild.StdOutEncoding)"
      StdErrEncoding              ="%(_NasmBuild.StdErrEncoding)">
    </CustomBuild>
    <ItemGroup Condition="'@(_NasmBuild)' != ''">
      <_NasmBuild Remove="@(_NasmBuild)" />
    </ItemGroup>
  </Target>
  <Target Name="SelectNASM" DependsOnTargets="_SelectedFiles">
    <ItemGroup Condition="'@(SelectedFiles)'!=''">
      <NASM Remove="@(NASM)" Condition="'%(Identity)'!='@(SelectedFiles)'"/>
      <NASM>
        <MinimalRebuildFromTracking>false</MinimalRebuildFromTracking>
      </NASM>
    </ItemGroup>
    <ItemGroup>
      <NASM Update="@(NASM)">
        <Outputs Condition="'%(NASM.ObjectFileName)' != ''">%(NASM.ObjectFileName)</Outputs>
      </NASM>
    </ItemGroup>
  </Target>
  <Target Name="ComputeNASMOutput" DependsOnTargets="SelectNASM" >
    <ItemGroup >
      <NASMOutputs Include="@(NASM->Metadata('Outputs'))" Condition="'@(NASM)' != ''"/>
      
      <NASMOutputs Condition="'%(NASMOutputs.ExcludedFromBuild)'!='true'
                                 and '%(NASMOutputs.OutputItemType)'==''
                                 and '%(NASMOutputs.LinkObjects)'=='true'
                                 and ('%(Extension)'=='.obj' or '%(Extension)'=='.res' or '%(Extension)'=='.rsc' or '%(Extension)'=='.lib')">
        <OutputItemType Condition="'$(ConfigurationType)'=='StaticLibrary'">Lib</OutputItemType>
        <OutputItemType Condition="'$(ConfigurationType)'!='StaticLibrary'">Link</OutputItemType>
      </NASMOutputs>
    </ItemGroup>
    <!-- Add NASM Outputs to lib, link or other tools -->
    <CreateItem
        Include="@(NASMOutputs)"
        Condition="'%(NASMOutputs.OutputItemType)'!=''">
      <Output
          TaskParameter="Include"
          ItemName="%(NASMOutputs.OutputItemType)"/>
      <Output
          TaskParameter="Include"
          Condition="'%(NASMOutputs.OutputItemType)' == 'Link' and '$(GenerateImportLib)'=='true'"
          ItemName="ImpLib"/>
    </CreateItem>
    <MakeDir Directories="@(NASMOutputs->'%(RootDir)%(Directory)')" />
    <!-- Cleanup -->
    <ItemGroup>
      <NASMOutputs Remove="@(NASMOutputs)" />
    </ItemGroup>
  </Target>
</Project>


================================================
FILE: nasm.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<ProjectSchemaDefinitions xmlns="http://schemas.microsoft.com/build/2009/properties" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=mscorlib">
  <Rule
    Name="NASM"
    PageTemplate="tool"
    DisplayName="Netwide Assembler"
    Order="200">
    <Rule.DataSource>
      <DataSource
        Persistence="ProjectFile"
        HasConfigurationCondition="true"
        ItemType="NASM" />
    </Rule.DataSource>
    <Rule.Categories>
      <Category Name="General" DisplayName="General" />
      <Category Name="Preprocessor" DisplayName="Preprocessing Options" />
      <Category Name="Assembler Options" DisplayName="Assembler Options" />
      <Category Name="All Options" DisplayName="All Options" Subtype="Search" />
      <Category Name="Command Line" DisplayName="Command Line" Subtype="CommandLine" />
    </Rule.Categories>
    <!-- General -->
    <StringListProperty
      Name="IncludePaths"
      Category="General"
      DisplayName="Include File Search Directories"
      Description="Sets path for include files."
      HelpUrl="http://www.nasm.us/doc/nasmdoc2.html#section-2.1.16"
      Switch="-I&quot;[value]/&quot;" />
    <StringListProperty
      Name="PreIncludeFiles"
      Category="General"
      DisplayName="Pre-Include a File"
      Description="Force files to be pre-included into source file."
      HelpUrl="http://www.nasm.us/doc/nasmdoc2.html#section-2.1.17"
      Switch="-P&quot;[value]&quot;" />
    <DynamicEnumProperty
        Name="NASMBeforeTargets"
        Category="General"
        EnumProvider="Targets"
        IncludeInCommandLine="False"
        DisplayName="Execute Before"
        Description="Specifies the targets for the custom build step and tool to run before."
        F1Keyword="VC.Project.VCCustomBuildStep.CustomBuildBeforeTargets">
      <DynamicEnumProperty.ProviderSettings>
        <NameValuePair
          Name="Exclude"
          Value="^NASM|^Compute" />
      </DynamicEnumProperty.ProviderSettings>
      <DynamicEnumProperty.DataSource>
        <DataSource
          Persistence="ProjectFile"
          ItemType=""
          HasConfigurationCondition="true" />
      </DynamicEnumProperty.DataSource>
    </DynamicEnumProperty>
    <DynamicEnumProperty
      Name="NASMAfterTargets"
      Category="General"
      EnumProvider="Targets"
      IncludeInCommandLine="False"
      DisplayName="Execute After"
      Description="Specifies the targets for the custom build step and tool to run after."
      F1Keyword="VC.Project.VCCustomBuildStep.CustomBuildAfterTargets">
      <DynamicEnumProperty.ProviderSettings>
        <NameValuePair
          Name="Exclude"
          Value="^NASM|^Compute" />
      </DynamicEnumProperty.ProviderSettings>
      <DynamicEnumProperty.DataSource>
        <DataSource
          Persistence="ProjectFile"
          ItemType=""
          HasConfigurationCondition="true" />
      </DynamicEnumProperty.DataSource>
    </DynamicEnumProperty>
    <BoolProperty
        Name="BuildInParallel"
        Category="General"
        DisplayName="Build In Parallel"
        F1Keyword="VC.Project.VCCustomBuildTool.BuildInParallel"
        Description="Specifies that this item can be built in parallel with other custom build tool items.">
    </BoolProperty>
    <IntProperty
        Name="MaxProcesses"
        Category="General"
        DisplayName="Maximum Processes"
        F1Keyword="VC.Project.VCCustomBuildTool.MaxProcesses"
        Description="Maximum number of CPU cores to use for parallel build. A value of 0 utilizes all available processors.">
    </IntProperty>
    <IntProperty
        Name="MaxItemsInBatch"
        Category="General"
        DisplayName="Maximum Batch Size"
        F1Keyword="VC.Project.VCCustomBuildTool.MaxProcesses"
        Description="Maximum number of items to execute together during parallel build. A value of 0 divides items evenly into parallel batches. A value of 1 disables batching. Larger batches will improve performance if the custom build tool processes items quickly.">
    </IntProperty>
    <!-- Assembler Options -->
    <StringProperty
      Name="Outputs"
      Category="Assembler Options"
      DisplayName="Output File Name"
      Description="Specify Output Filename."
      HelpUrl="http://www.nasm.us/doc/nasmdoc2.html#section-2.1.1"
      Switch="-o &quot;[value]&quot;" />
    <BoolProperty
      Name="GenerateDebugInformation"
      Category="Assembler Options"
      DisplayName="Generate Debug Information"
      Description="Generates Debug Information."
      HelpUrl="http://www.nasm.us/doc/nasmdoc2.html#section-2.1.12"
      Switch="-g" />
    <StringProperty
      Name="SymbolsPrefix"
      Category="Assembler Options"
      DisplayName="Symbols Prefix"
      Description="Prepend the given argument to all global or extern variables."
      HelpUrl="http://www.nasm.us/doc/nasmdoc2.html#section-2.1.27"
      IncludeInCommandLine="False"
      Switch="--prefix [value]" />
    <StringProperty
      Name="SymbolsPostfix"
      Category="Assembler Options"
      DisplayName="Symbols Postfix"
      Description="Append the given argument to all global or extern variables."
      HelpUrl="http://www.nasm.us/doc/nasmdoc2.html#section-2.1.27"
      IncludeInCommandLine="False"
      Switch="--postfix [value]" />
    <BoolProperty
      Name="TreatWarningsAsErrors"
      Category="Assembler Options"
      DisplayName="Treat Warnings As Errors"
      Description="Returns an error code if warnings are generated."
      HelpUrl="http://www.nasm.us/doc/nasmdoc2.html#section-2.1.24"
      IncludeInCommandLine="False"
      Switch="-Werror" />
    <!-- Preprocessor -->
    <StringListProperty
      Name="PreprocessorDefinitions"
      Category="Preprocessor"
      DisplayName="Preprocessor Definitions"
      Description="Defines a text macro with the given name."
      HelpUrl="http://www.nasm.us/doc/nasmdoc2.html#section-2.1.18"
      Switch="-D[value]" />
    <StringListProperty
      Name="UndefinePreprocessorDefinitions"
      Category="Preprocessor"
      DisplayName="Undefine Preprocessor Definitions"
      Description="Undefines a text macro with the given name."
      HelpUrl="http://www.nasm.us/doc/nasmdoc2.html#section-2.1.19"
      Switch="-U[value]" />
    <!-- Command Line -->
    <StringProperty
      Name="Inputs"
      Category="Command Line"
      IsRequired="true">
      <StringProperty.DataSource>
        <DataSource
          Persistence="ProjectFile"
          ItemType="NASM"
          SourceType="Item" />
      </StringProperty.DataSource>
    </StringProperty>
    <StringProperty
      Subtype="AdditionalOptions"
      Name="AdditionalOptions"
      Category="Command Line"
      DisplayName="Additional Options"
      Description="Additional Options">
    </StringProperty>
    <!-- Hidden -->
    <StringProperty
      Name="CommandLineTemplate"
      DisplayName="Command Line"
      Visible="False"
      IncludeInCommandLine="False" />
    <StringProperty
      Name="ExecutionDescription"
      DisplayName="Execution Description"
      IncludeInCommandLine="False"
      Visible="False" />
    <StringListProperty
      Name="AdditionalDependencies"
      DisplayName="Additional Dependencies"
      IncludeInCommandLine="False"
      Visible="False" />
  </Rule>
  <ItemType
    Name="NASM"
    DisplayName="Netwide Assembler" />
  <FileExtension
    Name="*.asm"
    ContentType="NASM" />
  <ContentType
    Name="NASM"
    DisplayName="Netwide Assembler"
    ItemType="NASM" />
</ProjectSchemaDefinitions>
Download .txt
gitextract_i1xg_j63/

├── .gitattributes
├── .gitignore
├── COPYING
├── README.md
├── install_script.bat
├── nasm.props
├── nasm.targets
└── nasm.xml
Condensed preview — 8 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (69K chars).
[
  {
    "path": ".gitattributes",
    "chars": 98,
    "preview": "* text=auto\n*.bat text eol=crlf\n*.props text eol=crlf\n*.targets text eol=crlf\n*.xml text eol=crlf\n"
  },
  {
    "path": ".gitignore",
    "chars": 17,
    "preview": "*.exe\n*.zip\n/.vs\n"
  },
  {
    "path": "COPYING",
    "chars": 26526,
    "preview": "                  GNU LESSER GENERAL PUBLIC LICENSE\n                       Version 2.1, February 1999\n\n Copyright (C) 19"
  },
  {
    "path": "README.md",
    "chars": 5229,
    "preview": "VSNASM\n=============\n\n[![Github All Releases](https://img.shields.io/github/downloads/ShiftMediaProject/VSNASM/total.svg"
  },
  {
    "path": "install_script.bat",
    "chars": 13454,
    "preview": "@echo OFF\r\nsetlocal\r\n\r\nREM Defined script variables\r\nset NASMDL=http://www.nasm.us/pub/nasm/releasebuilds\r\nset NASMVERSI"
  },
  {
    "path": "nasm.props",
    "chars": 2133,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <Proper"
  },
  {
    "path": "nasm.targets",
    "chars": 10229,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGr"
  },
  {
    "path": "nasm.xml",
    "chars": 7815,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<ProjectSchemaDefinitions xmlns=\"http://schemas.microsoft.com/build/2009/propert"
  }
]

About this extraction

This page contains the full source code of the ShiftMediaProject/VSNASM GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 8 files (64.0 KB), approximately 16.1k tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!