This repository contains my CS118 MASM assignments configured to build & debug from VS Code on Windows using the Irvine32 library.
✅ This repo includes an
irvine/
folder for convenience so you can build immediately in VS Code.
📎 Attribution: The Irvine32 materials included here originate from Kip R. Irvine’s site: https://www.asmirvine.com/.
🛡️ Rights: The Irvine32 materials remain the property of their respective rightsholder(s). See the site for terms and conditions.
-
Install the toolchain
- Install Visual Studio 2022 Build Tools with the workload “Desktop development with C++” (provides
ml.exe
andlink.exe
).
- Install Visual Studio 2022 Build Tools with the workload “Desktop development with C++” (provides
-
Open the project in VS Code
- This repo ships with:
.vscode/tasks.json
(build/run tasks).vscode/launch.json
(F5 debugging).vscode/build_asm.bat
(auto-loads the MSVC x86 environment, then callsml
/link
)irvine/
(required Irvine files placed for convenience)
- This repo ships with:
-
Build & run
- Open any
*.asm
file and press Ctrl+Shift+B → builds tobuild\<name>.exe
. - Press F5 to build and start the debugger (cppvsdbg).
- Or run the task “Run ASM — ACTIVE FILE” to execute without the debugger.
- Open any
No PATH edits needed. The build script calls the Visual Studio vcvars32.bat (x86) for you.
You can obtain the Irvine package directly from the author (recommended for latest updates) and drop the files into irvine/
:
- Project home: https://www.asmirvine.com/
- Getting Started (MASM + VS2022): https://www.asmirvine.com/gettingStartedVS2022/index.htm
Expected files in irvine/
: Irvine32.inc
, Irvine32.lib
, Kernel32.lib
, User32.lib
.
- Build (active file): open a
.asm
file → Ctrl+Shift+B → producesbuild\<name>.exe
- Run (active file): use Run ASM — ACTIVE FILE task, or just F5 to debug
- Pick a file to build: run Build ASM — PICK FILE (task), then Run ASM — PICK FILE
- Set a breakpoint on the first instruction inside
main PROC
(not on labels/directives). - Step with F10 (over) / F11 (into) / Shift+F11 (out).
- Use Irvine helpers like
DumpRegs
,Crlf
,WriteString
to inspect state.
-
SubtractInt — Integer arithmetic & registers
Subtracts/combines integer values, moves data between registers/memory, prints results via Irvine routines. -
ReverseStringCopy — Reverse copy (strings & addressing)
Copies a string in reverse order using a counted loop and indirect addressing (index/pointer usage). -
SumTwoInt — Console I/O + control flow
Clears screen / positions cursor, prompts for two integers, computes their sum, repeats a few times. -
TempStatsValidation — Arrays, validation, modular procs
Reads a fixed number of values with range validation; computes average, min, max, and counts values matching a predicate, split across procedures. -
EuclideanGCD — Greatest Common Divisor
Reads two integers, validates input, computes GCD (Euclidean-style), and displays the result. -
ArrayNearMatch — Array comparison (near matches)
Compares two arrays with a tolerance rule; demonstrates passing pointers/sizes and returning results inEAX
. -
TxtFlipcaseVowelCount — String analytics
For a user-provided string, counts words, flips case of all letters, and counts vowels, organized into separate procedures.
The programs use the standard 32-bit MASM pattern:
.386
,.model flat, stdcall
,.stack 4096
,INCLUDE Irvine32.inc
, andEND main
.
- The build and debug setup is path-agnostic for this project. You can move/rename the folder and it will still work.
- The batch script auto-locates a VS 2022 C++ toolchain (Build Tools / Community / Pro / Enterprise). On a machine without VS 2022 C++ tools, install that workload first.
- Irvine32: The
irvine/
contents are sourced from https://www.asmirvine.com/ (Kip R. Irvine). All rights remain with the original author/publisher; see the site for licensing/usage terms. - This repo’s source code: © 2022–present by Rahim Siddiq (unless otherwise noted).
If you’re a rightsholder and would like the included Irvine files removed from this repository, please reach out and they will be taken down promptly.