librasm 0.0.0

Library for using RASM.
<!-- This file tells about the library "rasm" on crates.io -->

<div align="center">

# `LibRASM`


<img src="../logo/rasm.png" width="300"/>

[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)
[![Rust version](https://img.shields.io/badge/rust-1.96.0%2B-orange.svg)](https://www.rust-lang.org)

</div>

**RASM** — assembly language compiler. **LibRASM** — library for using **RASM**.

## How to use it


1. Add `librasm` to your Cargo.toml
    ```bash
    cargo add librasm

    ```
    or
    ```toml
    librasm = "0.0.0" # Or latest version
    ```

2. You can use it! Example:
    ```rust
    use librasm::{RASM, SourceASM};

    fn main() {
        // Простой код:
        // ```x86asm
        // _start:
        //     mov rax, 0
        //     ret
        // ```
        let code = SourceASM::Slice("_start:
    mov rax, 0
    ret");

        let mut rasm = RASM::new(code);

        // tokens will appear in the `rasm` structure themselves.
        let _tokens = rasm.tokenize().unwrap();

        let _ast = rasm.parse().unwrap();

        let machine_code = rasm.compile().unwrap();

        // This:
        // ```x86asm
        // _start:
        //     mov rax, 0
        //     ret
        // ```
        // Equal to:
        //
        //      0x48, 0xB8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC3
        assert_eq!(machine_code.code, vec![0x48, 0xB8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC3]);
    }
    ```