A comprehensive collection of optimized 32-bit x86 Assembly programs and algorithms built using MASM. This portfolio showcases low-level programming capabilities ranging from complex file-based calculators to high-performance in-register sorting mechanisms.
1. High-Precision Calculator with File History & Search (main.asm, math.asm, searcher.asm, write.asm)
The foundational project of this portfolio. A modular, feature-rich 32-bit calculator designed for academic and practical implementation.
- 9-Digit Input Handling: Smoothly processes operations on integers up to 9 digits long.
- 32-Bit Factorial Engine: Computes exact factorials using a dedicated localized loop structure.
- File-Based Logging: Automatically saves and appends transaction histories directly to an external text file.
- History Search Engine: Built-in pattern matching routine to parse and look up past calculation logs instantly.
A specialized arithmetic pipeline built to handle values that exceed standard 32-bit/64-bit hardware integer boundaries.
- ASCII-to-Numeric Pipeline: Reads individual character bytes from string pointers, converts them to raw digits, and processes the math.
- Manual Carry Propagation: Implements precise look-ahead conditional logic to handle and transfer overflow bits across positions.
- Buffer Rewriting: Converts numerical outputs back to ASCII text and stores the final result in a third dedicated variable buffer.
A clean implementation of mathematical factorials utilizing independent function interfaces.
- Procedure Isolation: Uses standard
CALLandRETsemantics to detach numerical logic from the main application loop. - Dynamic Registries: Uses
EAXas a flexible input/output accumulator andECXas a zero-flag controlled multiplier.
A fast, low-latency conditional utility to evaluate magnitudes between hardware registers.
- Unsigned Check Automation: Employs the
JA(Jump if Above) execution branch to identify the dominant integer. - In-Place Preservation: Returns the highest verified integer smoothly into the
EAXregistry slot.
A signed comparator tool built to isolate smaller numerical integers inside the pipeline.
- Signed Boundary Evaluation: Employs the
JL(Jump if Less) mechanic to accurately compare positive and negative numbers. - Fallback Rewriting: Detects edge cases and overrides data slots dynamically via direct register overwrites.
The most optimized algorithmic routine in the portfolio, showcasing zero-memory data reorganization.
- Zero-Memory Footprint: Operates completely inside
EAX,EBX,ECX, andEDX. Requires no local stack allocations or scratch registers. - XOR Swap Mechanism: Swaps mismatched registers instantly using a three-step bitwise XOR sequence (
XOR reg1, reg2). - Cascading Bubble Checks: Implements cascading look-ahead jumps to dynamically sort all 4 registers in ascending order.
- Assembler: Microsoft Macro Assembler (MASM)
- Architecture: 32-bit x86 (Flat Memory Model, STDCALL)
- Linker Targets: Compatible with Microsoft Visual Studio IDE toolsets or manual linkers hooked to standard C Runtimes (
msvcrt.lib/ucrt.lib).