Skip to content

About

A collection of essential x86 MASM Assembly code snippets and algorithms, covering factorials, array manipulation, sorting, and core student homework solutions.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Multi-Functional x86 MASM Assembly Portfolio

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.


📁 Project Chronology & Directory

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.

2. Large String Addition Algorithm (big_number_addition.asm)

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.

3. Modular Factorial Procedure (factorial_procedure.asm)

A clean implementation of mathematical factorials utilizing independent function interfaces.

  • Procedure Isolation: Uses standard CALL and RET semantics to detach numerical logic from the main application loop.
  • Dynamic Registries: Uses EAX as a flexible input/output accumulator and ECX as a zero-flag controlled multiplier.

4. Maximum Value Discovery (find_maximum_procedure.asm)

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 EAX registry slot.

5. Minimum Value Discovery (find_minimum_procedure.asm)

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.

6. In-Register Sorting via XOR Swap (register_sort_xor.asm)

The most optimized algorithmic routine in the portfolio, showcasing zero-memory data reorganization.

  • Zero-Memory Footprint: Operates completely inside EAX, EBX, ECX, and EDX. 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.

🛠️ Environment & Toolchain Requirements

  • 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).

About

A collection of essential x86 MASM Assembly code snippets and algorithms, covering factorials, array manipulation, sorting, and core student homework solutions.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages