{"id":21252566,"url":"https://github.com/cartercobb/assembler","last_synced_at":"2026-05-17T13:35:43.789Z","repository":{"id":130567584,"uuid":"483135200","full_name":"CarterCobb/Assembler","owner":"CarterCobb","description":"A simple and dynamic assembler for common assembly mnemonics","archived":false,"fork":false,"pushed_at":"2024-07-02T13:46:20.000Z","size":37,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-21T21:07:19.664Z","etag":null,"topics":["assembler","assembly"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CarterCobb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-04-19T07:08:51.000Z","updated_at":"2024-07-02T13:46:26.000Z","dependencies_parsed_at":"2023-07-03T04:31:37.263Z","dependency_job_id":null,"html_url":"https://github.com/CarterCobb/Assembler","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/CarterCobb%2FAssembler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CarterCobb%2FAssembler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CarterCobb%2FAssembler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CarterCobb%2FAssembler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CarterCobb","download_url":"https://codeload.github.com/CarterCobb/Assembler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243690126,"owners_count":20331725,"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","assembly"],"created_at":"2024-11-21T03:47:57.847Z","updated_at":"2026-05-17T13:35:38.748Z","avatar_url":"https://github.com/CarterCobb.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dynamic Assembler\n\nThis assembler is writed in python. It takes common assembly commands and creates a `kernel7.img` that can be run on a [raspberry pi](https://www.raspberrypi.com/). This assembler has more potential as is collects and stores more data than is used to create that file.\n\n## Supported Opperation Codes\n\nA list of supported OpCodes is as follows:\n\n| Code | Code | Code | Code |\n| ---- | ---- | ---- | ---- |\n| AND  | ADC  | CMP  | MVN  |\n| EOR  | SBC  | CMN  | B    |\n| SUB  | RSC  | ORR  | LDR  |\n| RSB  | TST  | MOV  | STR  |\n| ADD  | TEQ  | BIC  | MOVW |\n| MOVT | BL   | BX   | --   |\n\nThe assembler is capable of more. It follows dynamic rules to parse the commands.\n\n## Supported Condition Codes\n\n| Code | Code | Code |\n| ---- | ---- | ---- |\n| EQ   | PL   | GE   |\n| NE   | VS   | LT   |\n| CS   | VC   | GT   |\n| CC   | HI   | LS   |\n| MI   | LS   | AL   |\n\n## Assembly Command Syntax\n\n`\u003cop_code\u003e\u003ccond_code\u003e\u003cs?\u003e \u003crd?\u003e, \u003crn?\u003e, \u003chex value up to 3 bytes\u003e`\n\n### Example\n\n`SUBS R5, R5 0x1`\n\nRules:\n\n- `\u003c\u003e` means descriptive item; dont include the angle brackets\n- `?` means the item is optional\n- Spaces are mandatory\n- Commas are not mandatory\n\nHelp:\n\n- `op_code` = the opperation to execute. e.g `ADD`\n- `cond_code` = the condition code. e.g `PL`. Defaults to `AL` if not specified\n- `s` = the s bit when applicable. Defaults to `0` if not specified\n- `rd` = destination register\n- `rn` = orign register\n- `hex value` = a hex value up to 3 bytes e.g. 0xFFFFFF (some commands max at 1-2 bytes)\n\n## Running The Program\n\nPlease ensure you have at least Python V3 installed. `f` strings are used and will not compile on older versions of Python.\n\n- In the project root run the `assembler.py` file with `python3`\n- You will be promted for a file path to your assembly command file; enter that. e.g `./assembly.txt`\n\n### Example Output\n\n```text\nSaved to kernel7.img\n\n-----Parsed Data-----\n{'binary': '11100011000000000100000000000000', 'hex': 'e3004000', 'encode': '0004003e', 'cond_code': 'AL', 's': False, 'op_code': 'MOVW', 'assembly': 'MOVW R4 0x0'}\n{'binary': '11100011010000110100111100100000', 'hex': 'e3434f20', 'encode': '02f4343e', 'cond_code': 'AL', 's': False, 'op_code': 'MOVT', 'assembly': 'MOVT R4 0x3F20'}\n{'binary': '11100010100001000010000000001000', 'hex': 'e2842008', 'encode': '8002482e', 'cond_code': 'AL', 's': False, 'op_code': 'ADD',  'assembly': 'ADD R2 R4 0x08'}\n{'binary': '11100100000100100011000000000000', 'hex': 'e4123000', 'encode': '0003214e', 'cond_code': 'AL', 's': False, 'op_code': 'LDR',  'assembly': 'LDR R3 R2'}\n{'binary': '11100011100000110011000000001000', 'hex': 'e3833008', 'encode': '8003383e', 'cond_code': 'AL', 's': False, 'op_code': 'ORR',  'assembly': 'ORR R3 R3 0x000008'}        \n{'binary': '11100100000000100011000000000000', 'hex': 'e4023000', 'encode': '0003204e', 'cond_code': 'AL', 's': False, 'op_code': 'STR',  'assembly': 'STR R3 R2'}\n{'binary': '11100010100001000011000000011100', 'hex': 'e284301c', 'encode': 'c103482e', 'cond_code': 'AL', 's': False, 'op_code': 'ADD',  'assembly': 'ADD R3 R4 0x1c'}\n{'binary': '11100011000000000010000000000000', 'hex': 'e3002000', 'encode': '0002003e', 'cond_code': 'AL', 's': False, 'op_code': 'MOVW', 'assembly': 'MOVW R2 0x0000'}\n{'binary': '11100011010000000010000000100000', 'hex': 'e3402020', 'encode': '0202043e', 'cond_code': 'AL', 's': False, 'op_code': 'MOVT', 'assembly': 'MOVT R2 0x0020'}\n{'binary': '11100100000000110010000000000000', 'hex': 'e4032000', 'encode': '0002304e', 'cond_code': 'AL', 's': False, 'op_code': 'STR',  'assembly': 'STR R2 R3'}\n{'binary': '11100011000001000101001001000000', 'hex': 'e3045240', 'encode': '0425403e', 'cond_code': 'AL', 's': False, 'op_code': 'MOVW', 'assembly': 'MOVW R5 0x4240'}\n{'binary': '11100011010000000101000000001111', 'hex': 'e340500f', 'encode': 'f005043e', 'cond_code': 'AL', 's': False, 'op_code': 'MOVT', 'assembly': 'MOVT R5 0x000F'}\n{'binary': '11100010010101010101000000000001', 'hex': 'e2555001', 'encode': '1005552e', 'cond_code': 'AL', 's': True,  'op_code': 'SUB',  'assembly': 'SUBS R5 R5 0x1'}\n{'binary': '01011010111111111111111111111101', 'hex': '5afffffd', 'encode': 'dfffffa5', 'cond_code': 'PL', 's': False, 'op_code': 'B',    'assembly': 'BPL 0xFFFFFD'}\n{'binary': '11100010100001000011000000101000', 'hex': 'e2843028', 'encode': '8203482e', 'cond_code': 'AL', 's': False, 'op_code': 'ADD',  'assembly': 'ADD R3 R4 0x28'}\n{'binary': '11100011000000000010000000000000', 'hex': 'e3002000', 'encode': '0002003e', 'cond_code': 'AL', 's': False, 'op_code': 'MOVW', 'assembly': 'MOVW R2 0x0000'}\n{'binary': '11100011010000000010000000100000', 'hex': 'e3402020', 'encode': '0202043e', 'cond_code': 'AL', 's': False, 'op_code': 'MOVT', 'assembly': 'MOVT R2 0x0020'}\n{'binary': '11100100000000110010000000000000', 'hex': 'e4032000', 'encode': '0002304e', 'cond_code': 'AL', 's': False, 'op_code': 'STR',  'assembly': 'STR R2 R3'}\n{'binary': '11100011000001000101001001000000', 'hex': 'e3045240', 'encode': '0425403e', 'cond_code': 'AL', 's': False, 'op_code': 'MOVW', 'assembly': 'MOVW R5 0x4240'}\n{'binary': '11100011010000000101000000001111', 'hex': 'e340500f', 'encode': 'f005043e', 'cond_code': 'AL', 's': False, 'op_code': 'MOVT', 'assembly': 'MOVT R5 0x000F'}\n{'binary': '11100010010101010101000000000001', 'hex': 'e2555001', 'encode': '1005552e', 'cond_code': 'AL', 's': True,  'op_code': 'SUB',  'assembly': 'SUBS R5 R5 0x1'}\n{'binary': '01011010111111111111111111111101', 'hex': '5afffffd', 'encode': 'dfffffa5', 'cond_code': 'PL', 's': False, 'op_code': 'B',    'assembly': 'BPL 0xFFFFFD'}\n{'binary': '11101010111111111111111111101110', 'hex': 'eaffffee', 'encode': 'eeffffae', 'cond_code': 'AL', 's': False, 'op_code': 'B',    'assembly': 'B 0xFFFFEE'}\n```\n\n## Example Assembly File\n\nFor testing purposes and proof of concept, an assembly command file is provided in this repo. It can be found [here](https://github.com/CarterCobb/Assembler/blob/master/assembly.txt).\n\nThis assembly will create output on the 21st GPIO pin on a raspberry pi and blink an LED bulb connected to that with a resistor.\n\n## Roadmap\n\nCurrently this parser does not support register values pared with opperations. It currenlty only will handle immediate values. A plan to add register support is in place.\n\nSee the [development branch](https://github.com/CarterCobb/Assembler/tree/development) for features currently being added.\n\n## Additional Details\n\nThis was built as an assignment for a college class at [Neumont College of Computer Science](https://www.neumont.edu/). Please do not use any part of this project in any way that would be considered plagiarism.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcartercobb%2Fassembler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcartercobb%2Fassembler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcartercobb%2Fassembler/lists"}