{"id":20283847,"url":"https://github.com/nanochess/gasm80","last_synced_at":"2025-04-11T08:23:12.030Z","repository":{"id":225744868,"uuid":"766738579","full_name":"nanochess/gasm80","owner":"nanochess","description":"Gasm80: Generic assembler for Z80/6502","archived":false,"fork":false,"pushed_at":"2025-02-01T18:59:36.000Z","size":284,"stargazers_count":24,"open_issues_count":0,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-25T05:51:24.198Z","etag":null,"topics":["6502","6502-assembler","z80","z80-asm","z80-assembler","z80asm"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nanochess.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2024-03-04T03:01:36.000Z","updated_at":"2025-02-01T18:59:40.000Z","dependencies_parsed_at":"2025-02-01T19:28:15.785Z","dependency_job_id":"28361955-0e84-4568-b62a-c2a4edcc8f3d","html_url":"https://github.com/nanochess/gasm80","commit_stats":null,"previous_names":["nanochess/gasm80"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanochess%2Fgasm80","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanochess%2Fgasm80/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanochess%2Fgasm80/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanochess%2Fgasm80/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nanochess","download_url":"https://codeload.github.com/nanochess/gasm80/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248361031,"owners_count":21090802,"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","z80","z80-asm","z80-assembler","z80asm"],"created_at":"2024-11-14T14:17:21.811Z","updated_at":"2025-04-11T08:23:12.007Z","avatar_url":"https://github.com/nanochess.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gasm80: Generic Z80/6502 assembler\r\n### by Oscar Toledo G. Mar/03/2024\r\n\r\n[https://nanochess.org/](https://nanochess.org/)\r\n\r\n[https://github.com/nanochess/gasm80](https://github.com/nanochess/gasm80)\r\n\r\nGasm80 is a small assembler for Z80/6502 programs. It was developed to support my new CVBasic compiler for Colecovision, in order to have a complete toolchain that can work in macOS and Linux.\r\n\r\nIt was developed in a single day based on my tinyasm 8088 assembler available at [https://github.com/nanochess/tinyasm](https://github.com/nanochess/tinyasm)\r\n\r\nIt uses a command line syntax similar to nasm:\r\n\r\n    gasm80 game.asm -o game.rom -l game.lst -s game.sym\r\n\r\nThere is also the -d option for defining labels:\r\n\r\n    -dLABEL\r\n    -dANOTHER_LABEL=1\r\n\r\nIt returns a non-zero error code when the assembled file generates errors.\r\n\r\n### Supported directives\r\n\r\nLabels are started with letter, number sign, underscore or period. Case is insensitive.\r\n\r\nLocal labels are supported, and should start with period. The local labels final name is derived from concatenation of the last global label (not starting with period) and the local label.\r\n\r\nThere is only support for Z80 and 6502 processors, and only are implemented the following directives:\r\n\r\n    IFDEF\r\n    IFNDEF\r\n    IF\r\n    ELSE\r\n    ENDIF\r\n    INCLUDE\r\n    INCLINE\r\n    INCBIN\r\n    TIMES\r\n    CPU Z80\r\n    CPU 6502\r\n    EQU\r\n    DB\r\n    DW\r\n    RB\r\n\r\nThe following operators are implemented:\r\n\r\n\t|\tBinary OR\r\n\t^\tBinary XOR\r\n\t\u0026\tBinary AND\r\n\t\u003c\u003c\tShift to left\r\n\t\u003e\u003e\tShift to right\r\n\t+\tAddition \r\n\t-\tSubtraction \r\n\t* \tMultiplication \r\n\t/\tDivision (unsigned 16-bit)\r\n\t%\tModulo operator\r\n\t(expr)\tParenthesis\r\n\t-\tUnary negation\r\n\r\nThe following numbers are implemented:\r\n\r\n\t0b0000_0100\tBinary, you can use underscore (it will be ignored)\r\n\t0xabcd\t\tHexadecimal.\r\n\t$0abcd\t\tHexadecimal (after $ the first digit must be a number)\r\n\t'a'\t\tCharacter constant.\r\n\t10\t\tDecimal.\r\n\t$$\t\tStart address.\r\n\t$\t\tCurrent address.\r\n\r\nThis assembler won't win a speed test ;) because the internal implementation uses a linear search for the instruction set, and it is also implemented as a kind of regular expression subset for easier coding.\r\n\r\nThe assembler also supports the undocumented Z80 instructions (IXH/IXL/IYH/IYL and the SLL instruction), and the undocumented 6502 instructions.\r\n\r\nThe symbol file generated is compatible with the format accepted by the OpenMSX debugger.\r\n\r\n### Building the assembler\r\n\r\nThe assembler is easily built in any platform because it uses standard C:\r\n\r\n    gcc gasm80.c -o gasm80\r\n\r\nI've included test cases in the 'test' subdirectory that includes the complete Z80 and 6502 instruction set.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnanochess%2Fgasm80","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnanochess%2Fgasm80","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnanochess%2Fgasm80/lists"}