# KASM
[](https://github.com/newcomb-luke/kOS-KASM)
[](https://crates.io/crates/kasm)
[]()
[]()
[](https://deps.rs/repo/github/newcomb-luke/kOS-KASM)
[]()
The 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.
Object files generated by KASM and KLinker can be viewed using the related project [KDump](https://github.com/newcomb-luke/KDump)
Any custom programming language for kOS can be implemented on top of KASM and that is what this project aims to help with.
## Features
* Extensive [preprocessor directives](https://newcomb-luke.github.io/kOS-KASM/chapter_3/kasm_preprocessor.html)
* Easy to use functions and labels
* Some small size optimizations over compiled KerboScript
## Documentation
For documentation on how to use KASM, see [the guide](https://newcomb-luke.github.io/kOS-KASM/)
## Support
There is now a new Visual Studio Code [Extension](https://marketplace.visualstudio.com/items?itemName=LukeNewcomb.kasm-kerbal-os) for KASM which enables syntax highlighting.
Besides 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).
## Installation
The 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.
#### Windows
If you have previously installed KLinker and KDump "standalone" through their own installers, when running the Windows
installer, deselect KDump and KLinker from the "features" menu.
* Download the .msi file from Releases on the right
* Run the installer
* **kasm** and associated tools should now be added to your PATH and available from any CMD or Powershell window
#### Arch Linux
- Download the PKGBUILD from Releases on the right
- Copy it to a temporary folder
- Run `makepkg -si` to install **kasm** and all of its dependencies.
- **kasm** should now be added to your PATH and available from any terminal
#### Standalone Executables
* Download and extract the .zip file from Releases on the right
* Place the executable in the desired location
* Run the executable through the terminal, Powershell on Windows or the default terminal on Mac OS or Linux.
#### Cargo
```
cargo install kasm
```
**kasm** should then be added to your shell's PATH, and can be run from any terminal
You will need to install KLinker or KDump separately using
```
cargo install klinker
cargo install kdump
```
## Usage
The Kerbal Assembler can be invoked after installation as **kasm**
Help can be accessed from the program itself by running:
```
kasm --help
```
The basic format for kasm arguments is:
```
kasm [FLAGS] [OPTIONS] --output