{"id":24374573,"url":"https://github.com/cschladetsch/cppasmlcd","last_synced_at":"2026-04-19T03:02:00.126Z","repository":{"id":272928617,"uuid":"918199333","full_name":"cschladetsch/CppAsmLcd","owner":"cschladetsch","description":"LCM Calculator with C++ and NASM A modern C++23 project demonstrating integration with NASM assembly to compute the Least Common Multiple (LCM) of two 64-bit integers. Features optimized GCD calculation in x86-64 assembly and a cross-platform CMake build system.","archived":false,"fork":false,"pushed_at":"2025-01-17T14:17:04.000Z","size":55,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-19T04:35:53.003Z","etag":null,"topics":["asm","cmake","cpp"],"latest_commit_sha":null,"homepage":"","language":"Assembly","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cschladetsch.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-17T12:55:16.000Z","updated_at":"2025-01-17T14:17:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"0f7879b3-38a0-49c7-802a-b13f33f18e48","html_url":"https://github.com/cschladetsch/CppAsmLcd","commit_stats":null,"previous_names":["cschladetsch/cppasmgcd"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cschladetsch/CppAsmLcd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cschladetsch%2FCppAsmLcd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cschladetsch%2FCppAsmLcd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cschladetsch%2FCppAsmLcd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cschladetsch%2FCppAsmLcd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cschladetsch","download_url":"https://codeload.github.com/cschladetsch/CppAsmLcd/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cschladetsch%2FCppAsmLcd/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31992822,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asm","cmake","cpp"],"created_at":"2025-01-19T05:40:44.646Z","updated_at":"2026-04-19T03:02:00.121Z","avatar_url":"https://github.com/cschladetsch.png","language":"Assembly","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LCM Calculator with C++ and NASM\n\nThis project demonstrates the integration of a NASM (x86-64 Assembly) function with a modern C++23 program to compute the Least Common Multiple (LCM) of two 64-bit integers. The project is built using GCC, NASM, and CMake.\n\nReally shows that python is based on C and the cost is is in translation and interpretation.\n\nAnd that ultra-customised manual Assembly is not much faster than C++.\n\nBut it is still faster!\n\n## Features\n- **LCM Calculation**: Uses the Euclidean algorithm to compute the Greatest Common Divisor (GCD) in assembly, which is then used to compute the LCM in C++.\n- **Efficient Assembly Code**: The GCD function is implemented in optimized x86-64 NASM assembly for high performance.\n- **C++23 Integration**: The main program is written in modern C++23 for readability and performance.\n- **Cross-Platform Build System**: Uses CMake to ensure seamless building on different systems.\n\n## Performance\n\n![Image](/resources/Untitled.png)\n\n## Requirements\n- **Compiler**: GCC with C++23 support\n- **Assembler**: NASM\n- **Build System**: CMake\n\n## Directory Structure\n```\nlcm_project/\n├── CMakeLists.txt    # Build configuration\n├── gcd.asm           # NASM assembly file for GCD computation\n├── main.cpp          # C++ source file for LCM calculation\n```\n\n## Usage\n1. Run the program:\n   ```bash\n   $ ./r A B\n   $ # will retrurn the LCM of A and B\n   ```\n\n2. Enter two 64-bit integers when prompted. Example:\n   ```\n   Enter two 64-bit integers: 123123 5345345\n   The LCM of 123123 and 5345345 is: 658134912435\n   ```\n\n## Technical Details\n- **LCM Calculation**:\n  The LCM is calculated using the formula:\n  \\[\n  \\text{LCM}(a, b) = \\frac{a \\cdot b}{\\text{GCD}(a, b)}\n  \\]\n- **NASM GCD Function**:\n  The assembly function uses the Euclidean algorithm to efficiently compute the GCD of two numbers.\n- **CMake Configuration**:\n  - The `CMakeLists.txt` ensures correct compilation and linking of the NASM and C++ components.\n\n## Contribution\nFeel free to fork the repository, make improvements, and submit pull requests. All contributions are welcome!\n\n## License\nThis project is open-source and distributed under the MIT License. See the `LICENSE` file for details.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcschladetsch%2Fcppasmlcd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcschladetsch%2Fcppasmlcd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcschladetsch%2Fcppasmlcd/lists"}