{"id":15220451,"url":"https://github.com/davidbuchanan314/p65a","last_synced_at":"2025-10-30T06:31:57.493Z","repository":{"id":44724246,"uuid":"512935161","full_name":"DavidBuchanan314/p65a","owner":"DavidBuchanan314","description":"Pythonic 6502 Assembler: An experimental alternative to traditional assemblers.","archived":false,"fork":false,"pushed_at":"2022-07-12T14:39:25.000Z","size":12,"stargazers_count":17,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-03-14T16:22:56.399Z","etag":null,"topics":["6502","6502-assembler","6502-assembly","assembler","python3","python310"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/p65a/","language":"Python","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/DavidBuchanan314.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":"2022-07-11T23:19:18.000Z","updated_at":"2024-02-27T12:51:30.000Z","dependencies_parsed_at":"2022-07-15T08:51:28.819Z","dependency_job_id":null,"html_url":"https://github.com/DavidBuchanan314/p65a","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidBuchanan314%2Fp65a","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidBuchanan314%2Fp65a/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidBuchanan314%2Fp65a/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidBuchanan314%2Fp65a/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DavidBuchanan314","download_url":"https://codeload.github.com/DavidBuchanan314/p65a/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219856579,"owners_count":16556082,"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":["6502","6502-assembler","6502-assembly","assembler","python3","python310"],"created_at":"2024-09-28T13:10:01.156Z","updated_at":"2025-10-30T06:31:57.188Z","avatar_url":"https://github.com/DavidBuchanan314.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# p65a\nPythonic 6502 Assembler: An experimental alternative to traditional assemblers.\n\nAt this point I'm unsure whether it's a useful concept or not, but I quite enjoy\nwriting code this way. Consider the API to be unstable.\n\nSee the `examples/` directory for examples of code written using this library.\n\nHere's a snippet from `examples/bootloader.py`, which showcases a few nice features:\n\n```python\n[...,\n\tlbl.CRC_LUT_HI,\n\t\tDb([crc16(bytes([i])) \u003e\u003e 8 for i in range(0x100)]),\n\tlbl.CRC_LUT_LO,\n\t\tDb([crc16(bytes([i])) \u0026 0xff for i in range(0x100)]),\n\n\tlbl.crc_update, # input: A, clobbers: A, Y\n\t\tA \u003c= A ^ zp.crc_hi,\n\t\tY \u003c= A,\n\t\tA \u003c= zp.crc_lo,\n\t\tA \u003c= A  ^ lbl.CRC_LUT_HI[Y],\n\t\tzp.crc_hi \u003c= A,\n\t\tA \u003c= lbl.CRC_LUT_LO[Y],\n\t\tzp.crc_lo \u003c= A,\n\t\tRTS(),\n...]\n```\n\nThis snippet implements a CRC16 checksum function. The lookup tables are generated\nautomagically by Python list comprehensions.\nEach \"line\" of assembly is an expression contained within a Python list. The\n`\u003c=` operator is overloaded to express assignment.\n\nIt is possible to make forward-references to labels. They are treated as symbolic\nexpressions until the layout of code is known (and thus, their concrete value),\nand then the machine code can finally be finally emitted.\n\n## TODO\n\n- Refactor - there's a lot of code in places it shouldn't be\n- Documentation\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidbuchanan314%2Fp65a","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidbuchanan314%2Fp65a","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidbuchanan314%2Fp65a/lists"}