{"id":15945835,"url":"https://github.com/bgourlie/asm6502","last_synced_at":"2025-08-04T15:34:14.679Z","repository":{"id":15757072,"uuid":"78711031","full_name":"bgourlie/asm6502","owner":"bgourlie","description":"A simple 6502 assembler written in Rust","archived":false,"fork":false,"pushed_at":"2022-08-26T01:32:42.000Z","size":75,"stargazers_count":19,"open_issues_count":1,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-29T08:11:18.925Z","etag":null,"topics":["assembler","retrocomputing","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bgourlie.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}},"created_at":"2017-01-12T05:14:49.000Z","updated_at":"2024-06-07T14:58:52.000Z","dependencies_parsed_at":"2022-08-19T04:12:09.692Z","dependency_job_id":null,"html_url":"https://github.com/bgourlie/asm6502","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgourlie%2Fasm6502","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgourlie%2Fasm6502/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgourlie%2Fasm6502/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgourlie%2Fasm6502/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bgourlie","download_url":"https://codeload.github.com/bgourlie/asm6502/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237073124,"owners_count":19251032,"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","retrocomputing","rust"],"created_at":"2024-10-07T09:07:29.870Z","updated_at":"2025-02-04T06:31:20.248Z","avatar_url":"https://github.com/bgourlie.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# asm6502\n[![Build Status](https://travis-ci.org/bgourlie/asm6502.svg?branch=master)](https://travis-ci.org/bgourlie/asm6502)\n[![Crates.io](https://img.shields.io/crates/v/asm6502.svg)](https://crates.io/crates/asm6502)\n\nA work-in-progress 6502 assembler.\n\nThis assembler currently serves the immediate needs of my [NES emulator](https://github.com/bgourlie/rs-nes). As such,\nit doesn't do anything except translate literal 6502 assembly into machine code. Not even labels are supported, and\nrelative addresses must specify a numeric offset. Any contributions are welcome, however. I'd love for this to \nbecome a more fully-featured assembler.\n\n### Usage\n\n```rust\nuse asm6502::assemble;\n\nlet asm = \"LDA #1\\nADC #1\\nCMP #2\".as_bytes();\nlet mut buf = Vec::\u003cu8\u003e::new();\nif let Err(msg) = assemble(asm, \u0026mut buf) {\n     panic!(\"Failed to assemble: {}\", msg);\n}\n \nassert_eq!(\u0026[0xa9, 0x1, 0x69, 0x1, 0xc9, 0x2], \u0026buf[..]);\n```\n\nThe input and output parameters of the `assemble` function are generic over the \n[`Read`](https://doc.rust-lang.org/stable/std/io/trait.Read.html) and \n[`Write`](https://doc.rust-lang.org/stable/std/io/trait.Write.html) traits, \nrespectively. A more typical usage of this function would accept an input file and an output file.\n\n### Known Issues\n\nIf the assembly ends with an implied instruction, it will need to be followed by a newline in order to be parsed\ncorrectly, and will fail to parse otherwise. See my StackOverflow question \n[here](http://stackoverflow.com/q/41658386/547365) documenting the issue and the work-in-progress nom\n[pull request](https://github.com/Geal/nom/pull/413) addressing the underlying issue.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbgourlie%2Fasm6502","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbgourlie%2Fasm6502","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbgourlie%2Fasm6502/lists"}