{"id":18245818,"url":"https://github.com/yxnan/arm2gas","last_synced_at":"2025-04-04T14:31:08.552Z","repository":{"id":40451093,"uuid":"316311907","full_name":"yxnan/arm2gas","owner":"yxnan","description":"Migrate legacy ARM syntax assembly to GNU syntax (GAS)","archived":false,"fork":false,"pushed_at":"2022-05-07T19:30:15.000Z","size":941,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-04T00:05:11.957Z","etag":null,"topics":["arm","arm-assembly","armasm","armclang","assembler","assembly","gnu-assembly"],"latest_commit_sha":null,"homepage":"","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yxnan.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":"2020-11-26T18:42:42.000Z","updated_at":"2024-12-29T22:14:16.000Z","dependencies_parsed_at":"2022-08-09T20:51:07.529Z","dependency_job_id":null,"html_url":"https://github.com/yxnan/arm2gas","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/yxnan%2Farm2gas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yxnan%2Farm2gas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yxnan%2Farm2gas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yxnan%2Farm2gas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yxnan","download_url":"https://codeload.github.com/yxnan/arm2gas/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247193948,"owners_count":20899400,"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":["arm","arm-assembly","armasm","armclang","assembler","assembly","gnu-assembly"],"created_at":"2024-11-05T09:23:03.454Z","updated_at":"2025-04-04T14:31:08.225Z","avatar_url":"https://github.com/yxnan.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# arm2gas\n\n\u003cdiv align=\"center\"\u003e\n\u003cp\u003e\n      \u003ca href=\"https://github.com/typowritter/arm2gas\"\u003e\u003cimg src=\"https://img.shields.io/badge/arm2gas-v1.0-brightgreen\"\u003e\u003c/a\u003e\n      \u003ca href=\"https://github.com/typowritter/arm2gas/blob/main/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/License-GPLv3.0-blue\" alt=\"LICENSE\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003c/div\u003e\nMigrate legacy ARM syntax assembly to GNU syntax (GAS)\n\n## Usage\n\n`arm2gas.pl [options] file1 [file2...]`\n\n### Options\n\n| Switch                  | Descriptions                                            |\n| :---------------------- | :------------------------------------------------------ |\n| `-c, --compatible`      | Keeps compatibility with armclang assembler             |\n| `-h, --help`            | Show this help text                                     |\n| `-i, --verbose`         | Show a message on every non-trivial convertions         |\n| `-n, --no-comment`      | Discard all the comments in output                      |\n| `-o, --output=\u003cfile\u003e`   | Specify the output filename                             |\n| `-r, --return-code`     | Print return code definitions                           |\n| `-s, --strict`          | Error on directives that have no equivalent counterparts |\n| `-v, --version`         | Show version info                                       |\n| `-w, --no-warning`      | Suppress all warning messages                           |\n| `-x, --suffix=\u003cstring\u003e` | Suffix of the output filename [default: '.out']         |\n\n## Supported conversions\n\n- [X] [Comments](https://developer.arm.com/documentation/dui0742/g/Migrating-ARM-syntax-assembly-code-to-GNU-syntax/Comments?lang=en)\n- [X] [Labels\\*](https://developer.arm.com/documentation/dui0742/g/Migrating-ARM-syntax-assembly-code-to-GNU-syntax/Labels?lang=en)\n- [X] [Numeric local labels](https://developer.arm.com/documentation/dui0742/g/Migrating-ARM-syntax-assembly-code-to-GNU-syntax/Numeric-local-labels?lang=en)\n- [X] [Functions](https://developer.arm.com/documentation/dui0742/g/Migrating-ARM-syntax-assembly-code-to-GNU-syntax/Functions?lang=en)\n- [X] [Sections](https://developer.arm.com/documentation/dui0742/g/Migrating-ARM-syntax-assembly-code-to-GNU-syntax/Sections?lang=en)\n- [X] [Symbols with special characters](https://developer.arm.com/documentation/dui0742/g/Migrating-ARM-syntax-assembly-code-to-GNU-syntax/Symbol-naming-rules?lang=en)\n- [X] [Numeric literals](https://developer.arm.com/documentation/dui0742/g/Migrating-ARM-syntax-assembly-code-to-GNU-syntax/Numeric-literals?lang=en)\n- [X] [Operators](https://developer.arm.com/documentation/dui0742/g/Migrating-ARM-syntax-assembly-code-to-GNU-syntax/Operators?lang=en)\n- [X] [Aligment](https://developer.arm.com/documentation/dui0742/g/Migrating-ARM-syntax-assembly-code-to-GNU-syntax/Alignment?lang=en)\n- [X] [PC-relative addressing](https://developer.arm.com/documentation/dui0742/g/Migrating-ARM-syntax-assembly-code-to-GNU-syntax/PC-relative-addressing?lang=en)\n- [X] [Directives: Conditional](https://developer.arm.com/documentation/dui0742/g/Migrating-ARM-syntax-assembly-code-to-GNU-syntax/Conditional-directives?lang=en)\n- [X] [Directives: Data definition](https://developer.arm.com/documentation/dui0742/g/Migrating-ARM-syntax-assembly-code-to-GNU-syntax/Data-definition-directives?lang=en)\n- [X] [Directives: Instruction set](https://developer.arm.com/documentation/dui0742/g/Migrating-ARM-syntax-assembly-code-to-GNU-syntax/Instruction-set-directives?lang=en)\n- [X] [Directives: Symbol definition](https://developer.arm.com/documentation/dui0742/g/Migrating-ARM-syntax-assembly-code-to-GNU-syntax/Symbol-definition-directives?lang=en)\n- [X] [Directives: Miscellaneous](https://developer.arm.com/documentation/dui0742/g/Migrating-ARM-syntax-assembly-code-to-GNU-syntax/Miscellaneous-directives?lang=en)\n\n[\\*] *inline label is not supported yet.*\n\n## Demo\n\nConversion result of `demo.s` (with option `-i -c`)\n\n![](./demo/demo.png)\n\nCommand-line output:\n\n```bash\n$ ./arm2gas.pl -i -c test.s\nWARN: test.s:6 -\u003e test.s.out:6: Numeric local label with scope '2routA' is not supported in GAS, converting to '2'\nWARN: test.s:7 -\u003e test.s.out:7: Scope of numeric local label is not supported in GAS, removing ROUT directives\nWARN: test.s:8 -\u003e test.s.out:8: Numeric local label with scope '3routB' is not supported in GAS, converting to '3'\nWARN: test.s:12 -\u003e test.s.out:12: Can't specify label's search level 't' in GAS, dropping\nWARN: test.s:13 -\u003e test.s.out:13: Can't specify label's search level 'a' in GAS, dropping\nWARN: test.s:14 -\u003e test.s.out:14: Can't specify label's search level 't' in GAS, dropping\nWARN: test.s:14 -\u003e test.s.out:14: Can't specify label's scope 'routC' in GAS, dropping\nWARN: test.s:23 -\u003e test.s.out:25: Not all AREA attributes are supported, need a manual check\nWARN: test.s:24 -\u003e test.s.out:27: Not all AREA attributes are supported, need a manual check\nWARN: test.s:27 -\u003e test.s.out:30: Implicit shift is not supported in GAS, converting to explicit shift\nWARN: test.s:28 -\u003e test.s.out:32: Implicit shift is not supported in GAS, converting to explicit shift\nINFO: test.s:29 -\u003e test.s.out:34: Converting hexidecimal '\u002610AF' to '0x10AF'\nINFO: test.s:30 -\u003e test.s.out:35: Converting '2_11001010' to hexidecimal literal '0xCA'\nINFO: test.s:31 -\u003e test.s.out:36: Converting '-2_1101' to hexidecimal literal '-0x0D'\nINFO: test.s:32 -\u003e test.s.out:37: Converting '8_27' to hexidecimal literal '0x17'\nWARN: test.s:46 -\u003e test.s.out:51: Unsupported operator :ROR:, need a manual check\nWARN: test.s:54 -\u003e test.s.out:59: Conversion containing strings needs a manual check\nWARN: test.s:55 -\u003e test.s.out:60: Conversion containing strings needs a manual check\nWARN: test.s:68 -\u003e test.s.out:73: Conversion containing strings needs a manual check\nWARN: test.s:75 -\u003e test.s.out:80: Local variable 'var1' is not supported, using static declaration\nWARN: test.s:76 -\u003e test.s.out:81: Local variable 'var2' is not supported, using static declaration\nWARN: test.s:81 -\u003e test.s.out:88: Conversion containing strings needs a manual check\n```\n\n\n\n## Cautions\n\nBy default (without `--strict`), for those directives that have no equivalent GNU format, `arm2gas` will try best to convert and generate warning information on the specific line. Therefore, a 'warning' does **NOT** necessarily mean no issue, please check the conversion result to ensure it works as expected.\n\nNote that `arm2gas` *assumes that the input file is in the **correct** syntax*, otherwise, the conversion result is **UNEXPECTED**\n\n## TODO\n\n- [ ] Macro\n- [ ] Inline label\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyxnan%2Farm2gas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyxnan%2Farm2gas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyxnan%2Farm2gas/lists"}