{"id":22072541,"url":"https://github.com/broxus/tycho-asm","last_synced_at":"2025-07-24T11:30:39.851Z","repository":{"id":203357279,"uuid":"705051095","full_name":"broxus/everscale-asm","owner":"broxus","description":"Rust implementation of TVM Assembler","archived":false,"fork":false,"pushed_at":"2024-09-23T13:34:49.000Z","size":313,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-15T00:48:21.039Z","etag":null,"topics":["blockchain","everscale","tvm","venom-blockchain","venom-developer-program","vm"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/broxus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","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":"2023-10-14T22:28:41.000Z","updated_at":"2024-06-27T14:18:17.000Z","dependencies_parsed_at":"2024-06-22T14:08:26.592Z","dependency_job_id":null,"html_url":"https://github.com/broxus/everscale-asm","commit_stats":null,"previous_names":["broxus/everscale-asm"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/broxus%2Feverscale-asm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/broxus%2Feverscale-asm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/broxus%2Feverscale-asm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/broxus%2Feverscale-asm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/broxus","download_url":"https://codeload.github.com/broxus/everscale-asm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227432007,"owners_count":17775893,"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":["blockchain","everscale","tvm","venom-blockchain","venom-developer-program","vm"],"created_at":"2024-11-30T21:13:37.737Z","updated_at":"2025-07-24T11:30:39.828Z","avatar_url":"https://github.com/broxus.png","language":"Rust","readme":"# tycho-asm \u0026emsp; [![crates-io-batch]][crates-io-link] [![docs-badge]][docs-url] [![rust-version-badge]][rust-version-link] [![workflow-badge]][workflow-link]\n\n[crates-io-batch]: https://img.shields.io/crates/v/tycho-asm.svg\n[crates-io-link]: https://crates.io/crates/tycho-asm\n[docs-badge]: https://docs.rs/tycho-asm/badge.svg\n[docs-url]: https://docs.rs/tycho-asm\n[rust-version-badge]: https://img.shields.io/badge/rustc-1.85+-lightgray.svg\n[rust-version-link]: https://blog.rust-lang.org/2025/02/20/Rust-1.85.0/\n[workflow-badge]: https://img.shields.io/github/actions/workflow/status/broxus/tycho-asm/master.yaml?branch=master\n[workflow-link]: https://github.com/broxus/tycho-asm/actions?query=workflow%3Amaster\n\n\u003e Status: WIP\n\n## About\n\nRust implementation of TVM Assembler.\n\n## LSP Server/Client\n\n- Install [TVM Assembler](https://marketplace.visualstudio.com/items?itemName=Rexagon.tvmasm-lsp) VSCode extension\n- Install CLI\n  ```bash\n  cargo install --locked tvmasm\n  ```\n\n## How to use\n\n### Building a contract using CLI\n```bash\ntvmasm build ./src/tests/walletv3.tvm -o walletv3.boc\n```\nOutput:\n```\nCode path:      walletv3.boc\nCode hash:      84dafa449f98a6987789ba232358072bc0f76dc4524002a5d0918b9a75d2d599\nUnique cells:   1\nUnique bits:    888\n```\n\n### Building a contract from Rust\n\nRuntime:\n```rust\nuse tycho_asm::Code;\nuse tycho_types::prelude::Cell;\n\nlet code: Cell = Code::assemble(r#\"\n    PUSHINT 1\n    SWAP DUP\n    PUSHCONT {\n        TUCK\n        MUL\n        SWAP\n        DEC\n    }\n    REPEAT\n    DROP\n\"#)?;\n```\n\nCompile time:\n```rust\nuse tycho_asm_macros::tvmasm;\nuse tycho_types::prelude::{Boc, Cell};\n\nconst CODE: \u0026[u8] = tvmasm!(\n    \"PUSHINT 1\",\n    \"PUSHCONT { INC PUSHINT 10 LESS }\",\n    \"PUSHCONT { DUMPSTK }\",\n    \"WHILE\",\n);\n\nlet code: Cell = Boc::decode(CODE)?;\n```\n\n## Syntax\n\n```\n// Single-line comments\n\n// Opcodes must be in uppercase, can start with a digit or minus,\n// and can contain '#' or '_'\nNOP\n2DROP\n-ROT\nSTREF_L\n\n// Opcodes with number as an argument\nPUSHINT 12\nPUSHINT -0xded\nPUSHINT 0b10110101\n\n// Opcodes with stack register as an argument\nPUSH s1\nXCHG s10, s100\nPU2XC s1, s(-1), s(-2)\n\n// Opcodes with control registers (c0, .., c5, c7)\nPUSH c3\nPUSHCTR c7\n\n// Opcodes with slice or continuation\nPUSHSLICE x{123123_}\nPUSHSLICE b{10001001}\nIFREFELSEREF {\n  PUSHINT 1\n}, {\n  PUSHINT 2\n}\n\n// Insert raw slices into code\n@inline x{a924}\n```\n\n[Full opcodes list](https://test.ton.org/tvm.pdf)\n\n## Contributing\n\nWe welcome contributions to the project! If you notice any issues or errors, feel free to open an issue or submit a pull request.\n\n## License\n\nLicensed under either of\n\n* Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or \u003chttps://www.apache.org/licenses/LICENSE-2.0\u003e)\n* MIT license ([LICENSE-MIT](LICENSE-MIT) or \u003chttps://opensource.org/licenses/MIT\u003e)\n\nat your option.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbroxus%2Ftycho-asm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbroxus%2Ftycho-asm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbroxus%2Ftycho-asm/lists"}