{"id":22176936,"url":"https://github.com/newcomb-luke/kos-kasm","last_synced_at":"2025-07-26T16:31:11.883Z","repository":{"id":45604095,"uuid":"305424503","full_name":"newcomb-luke/kOS-KASM","owner":"newcomb-luke","description":"Kerbal Assembler, for use with Kerbal OS mod for Kerbal Space Program. Using this tool one can program their KSP rockets in assembly code, or generate this assembly code from a compiler. Assembles directly to kRISC with no need for KerboScript.","archived":false,"fork":false,"pushed_at":"2024-07-30T20:51:24.000Z","size":1713,"stargazers_count":13,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-07-31T01:08:59.938Z","etag":null,"topics":["assembler","compiler","kasm","kerbal-operating-system","kerbal-space-program","klinker","kos","krisc","ksp"],"latest_commit_sha":null,"homepage":"https://newcomb-luke.github.io/kOS-KASM/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/newcomb-luke.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2020-10-19T15:10:19.000Z","updated_at":"2023-07-01T18:13:44.000Z","dependencies_parsed_at":"2024-07-31T00:32:38.990Z","dependency_job_id":"53cb0bcd-b985-4826-961a-392c371ecd54","html_url":"https://github.com/newcomb-luke/kOS-KASM","commit_stats":{"total_commits":135,"total_committers":2,"mean_commits":67.5,"dds":0.2592592592592593,"last_synced_commit":"f9b8c2dc0fb055848a0f0266f5fe663c5ddce543"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newcomb-luke%2FkOS-KASM","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newcomb-luke%2FkOS-KASM/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newcomb-luke%2FkOS-KASM/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newcomb-luke%2FkOS-KASM/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/newcomb-luke","download_url":"https://codeload.github.com/newcomb-luke/kOS-KASM/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227693273,"owners_count":17805293,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["assembler","compiler","kasm","kerbal-operating-system","kerbal-space-program","klinker","kos","krisc","ksp"],"created_at":"2024-12-02T08:21:50.901Z","updated_at":"2024-12-02T08:21:53.215Z","avatar_url":"https://github.com/newcomb-luke.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KASM\n[\u003cimg src=\"https://img.shields.io/badge/github-newcomb--luke%2FkOS--KASM-8da0cb?style=for-the-badge\u0026logo=github\u0026labelColor=555555\" alt=\"github\" height=\"24\"\u003e](https://github.com/newcomb-luke/kOS-KASM)\n[\u003cimg src=\"https://img.shields.io/crates/v/kasm?color=fc8d62\u0026logo=rust\u0026style=for-the-badge\" alt=\"github\" height=\"24\"\u003e](https://crates.io/crates/kasm)\n[\u003cimg alt=\"License\" src=\"https://img.shields.io/github/license/newcomb-luke/kOS-KASM?style=for-the-badge\" height=\"24\"\u003e]()\n\n[\u003cimg alt=\"GitHub Workflow Status\" src=\"https://img.shields.io/github/actions/workflow/status/newcomb-luke/kOS-KASM/main.yml?style=for-the-badge\" height=\"24\"\u003e]()\n[\u003cimg alt=\"Libraries.io dependency status for GitHub repo\" src=\"https://img.shields.io/librariesio/github/newcomb-luke/kOS-KASM?style=for-the-badge\" height=\"24\"\u003e](https://deps.rs/repo/github/newcomb-luke/kOS-KASM)\n[\u003cimg alt=\"Crates.io Downloads\" src=\"https://img.shields.io/crates/d/kasm?style=for-the-badge\" height=\"24\"\u003e]()\n\nThe Kerbal Assembler, or KASM is a custom developed assembler designed to target the computers inside the Kerbal Operating System mod for Kerbal Space Program. KASM generates KerbalObject files which can then be linked using [KLinker](https://github.com/newcomb-luke/kOS-KLinker) to create KerboScript Machine code (.ksm) files which can be run inside kOS.\n\nObject files generated by KASM and KLinker can be viewed using the related project [KDump](https://github.com/newcomb-luke/KDump)\n\nAny custom programming language for kOS can be implemented on top of KASM and that is what this project aims to help with.\n\n## Features\n\n* Extensive [preprocessor directives](https://newcomb-luke.github.io/kOS-KASM/chapter_3/kasm_preprocessor.html)\n* Easy to use functions and labels\n* Some small size optimizations over compiled KerboScript\n\n## Documentation\n\nFor documentation on how to use KASM, see [the guide](https://newcomb-luke.github.io/kOS-KASM/)\n\n## Support\n\nThere is now a new Visual Studio Code [Extension](https://marketplace.visualstudio.com/items?itemName=LukeNewcomb.kasm-kerbal-os) for KASM which enables syntax highlighting.\n\nBesides reading the guide above, support on how to use and write KASM code can be found in the [KASM Discord Server](https://discord.gg/APETM2ceVZ).\n\n## Installation\n\nThe Kerbal Assembler can either be installed via [cargo](https://github.com/rust-lang/cargo) through [crates.io](https://crates.io/), or as a standalone binary.\n\n#### Windows\n\nIf you have previously installed KLinker and KDump \"standalone\" through their own installers, when running the Windows\ninstaller, deselect KDump and KLinker from the \"features\" menu.\n\n* Download the .msi file from Releases on the right\n* Run the installer\n* **kasm** and associated tools should now be added to your PATH and available from any CMD or Powershell window\n\n#### Arch Linux\n\n- Download the PKGBUILD from Releases on the right\n\n- Copy it to a temporary folder\n\n- Run `makepkg -si` to install **kasm** and all of its dependencies.\n\n- **kasm** should now be added to your PATH and available from any terminal\n\n#### Standalone Executables\n\n* Download and extract the .zip file from Releases on the right\n* Place the executable in the desired location\n* Run the executable through the terminal, Powershell on Windows or the default terminal on Mac OS or Linux.\n\n#### Cargo\n\n```\ncargo install kasm\n```\n\n**kasm** should then be added to your shell's PATH, and can be run from any terminal\n\nYou will need to install KLinker or KDump separately using\n\n```\ncargo install klinker\ncargo install kdump\n```\n\n## Usage\n\nThe Kerbal Assembler can be invoked after installation as **kasm**\n\nHelp can be accessed from the program itself by running:\n```\nkasm --help\n```\n\nThe basic format for kasm arguments is:\n```\nkasm [FLAGS] [OPTIONS] \u003cINPUT\u003e --output \u003cOUTPUT\u003e\n```\n\nWhen running **kasm**, the assembler cannot infer the output file name, so one must always be specified. This is accomplished by passing the **-o** flag to kasm:\n```\nkasm main.kasm -o myprogram.ko\n```\n\nThe **-w** flag can be used to suppress warnings generated by the assembler:\n```\nkasm -w\n```\n\nThe **-a** flag can be used to disable preprocessing in **kasm** when assembling a file. This is usually done if one is not using preprocessor directives because it can speed up processing time:\n```\nkasm -a\n```\n\nIn contrast, the **-p** flag can be used to tell **kasm** to only perform preprocessing if any must be done. The output file will then be **kasm** source code with all macros expanded, etc:\n```\nkasm -p\n```\n\nThe **-i** option can be passed to **kasm** in order to specify the include path for `.include` directives in the code:\n```\nkasm main.kasm -o myprogram.ko -i include/\n```\n\nThe **-f** option can be provided to **kasm** to specify the file name to be set in the generated KerbalObject file. This can be useful if using **kasm** as a second step down from a compiler.\n```\nkasm program.kasm -f program.ys\n```\n\nThe **-c** option can be specified in order to set the generated file's comment field. The default comment is something along the lines of \"Compiled by KASM ...\" and the version number. This can be overridden if a compiler sits on top of this:\n```\nkasm program.kasm -c \"Compiled by MyCompiler\"\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnewcomb-luke%2Fkos-kasm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnewcomb-luke%2Fkos-kasm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnewcomb-luke%2Fkos-kasm/lists"}