{"id":15519724,"url":"https://github.com/mertyildiran/dasm","last_synced_at":"2026-01-25T18:32:24.337Z","repository":{"id":136533480,"uuid":"63196365","full_name":"mertyildiran/DASM","owner":"mertyildiran","description":"Dragon Assembler, a simple assembler for a made-up microprocessor architecture","archived":false,"fork":false,"pushed_at":"2016-07-27T22:35:32.000Z","size":2479,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-05T09:58:00.421Z","etag":null,"topics":["architecture","assembler","assembly","assembly-language","microprocessor"],"latest_commit_sha":null,"homepage":"","language":"Groff","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/mertyildiran.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-07-12T22:23:38.000Z","updated_at":"2025-02-19T22:36:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"3ea051f4-7a62-4530-abc6-366d8421e264","html_url":"https://github.com/mertyildiran/DASM","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mertyildiran/DASM","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mertyildiran%2FDASM","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mertyildiran%2FDASM/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mertyildiran%2FDASM/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mertyildiran%2FDASM/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mertyildiran","download_url":"https://codeload.github.com/mertyildiran/DASM/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mertyildiran%2FDASM/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28756442,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T16:32:25.380Z","status":"ssl_error","status_checked_at":"2026-01-25T16:32:09.189Z","response_time":113,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["architecture","assembler","assembly","assembly-language","microprocessor"],"created_at":"2024-10-02T10:22:32.074Z","updated_at":"2026-01-25T18:32:24.331Z","avatar_url":"https://github.com/mertyildiran.png","language":"Groff","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DASM\n\nDragon Assembler, a simple assembler for a made-up microprocessor architecture\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/mertyildiran/DASM/master/docs/img/dasm.gif\" alt=\"Dragon Assembler\"/\u003e\n\u003c/p\u003e\n\n## Basic Architecture\n\n- 16-bit data bus.\n- 12-bit address bus. Processor can address 4K of memory.\n- 4 general purpose registers (GPR's). Will be expanded to 8 later.\n- 4 special purpose registers: Program Counter (PC), Address Register (AR), Instruction Register (IR), FLAGS register. Stack pointer (SP) and stack-related operations (PUSH, POP, CALL, RET) will be added later.\n\nTwo addressing modes will be used:\n\n- Register indirect: Uses the contents of a general purpose register as a pointer to a memory location(used by load/store instructions)\n- PC relative: Adds the offset contained in the instruction to the contents of PC to obtain a pointer to a memory location (used by jump instructions)\n\nPlease scroll down for diagrams of the architecture.\n\n## Instruction set\n\nOpcodes are 4 bits, and there are 16 different instruction types:\n\n| Opcode (in hexadecimal) |               Opcode Mnemonic               | Instruction        |\n|:-----------------------:|:-------------------------------------------:|--------------------|\n| 1                       | LDI                                         | Load Immediate     |\n| 2                       | LD                                          | Load               |\n| 3                       | ST                                          | Store              |\n| 4                       | JZ                                          | Jump if zero       |\n| 5                       | JMP                                         | Unconditional jump |\n| 6                       | Unused                                      | Unused             |\n| 7                       | ADD, SUB, AND, OR, NOT,  XOR, MOV, INC, DEC | ALU operations     |\n| 8                       | PUSH                                        | Push to stack      |\n| 9                       | POP                                         | Pop from stack     |\n| A                       | CALL                                        | Call a procedure   |\n| B                       | RET                                         | Return from a proc.|\n\nLater on, we will add the instructions PUSH, POP, CALL and RET to this list. Note that all these instructions require a stack, and therefore we have to implement a stack and a SP register before implementing them.\n\n\n### Version\n\n0.3.1\n\n### Installation\n\nOn the maintainer’s system(*Make sure you have automake installed*):\n\n```Shell\naclocal # Set up an m4 environment\nautoconf # Generate configure from configure.ac\nautomake --add-missing # Generate Makefile.in from Makefile.am\n./configure # Generate Makefile from Makefile.in\nmake distcheck # Use Makefile to build and test a tarball to distribute\n```\n\nOn the end-user’s system:\n\n```Shell\n./configure # Generate Makefile from Makefile.in\nmake # Use Makefile to build the program\nmake install # Use Makefile to install the program\ndasm example.asm\n```\n\n### Special Thanks to\n\nAsst. Prof. Mehmet Kadir Baran at Marmara University\n\nfor [this](http://marmara-cse-lectures.com/comparch/) magnificent educational material about Microprocessors and for giving Dragon Assembler a head start with his example source code for a simple assembler.\n\n## Diagrams\n\n![Main](https://raw.githubusercontent.com/mertyildiran/DASM/master/docs/img/logisim/main.png)\n\n![ALU](https://raw.githubusercontent.com/mertyildiran/DASM/master/docs/img/logisim/ALU.png)\n\n![GPRs](https://raw.githubusercontent.com/mertyildiran/DASM/master/docs/img/logisim/GPRs.png)\n\n![IR](https://raw.githubusercontent.com/mertyildiran/DASM/master/docs/img/logisim/IR.png)\n\n![PC](https://raw.githubusercontent.com/mertyildiran/DASM/master/docs/img/logisim/PC.png)\n\n![CU](https://raw.githubusercontent.com/mertyildiran/DASM/master/docs/img/logisim/CU.png)\n\n![Keypad](https://raw.githubusercontent.com/mertyildiran/DASM/master/docs/img/logisim/Keypad.png)\n\n### License\n\nThe MIT License (MIT)\n\nCopyright (c) 2016 Mehmet Mert Yıldıran mert.yildiran@bil.omu.edu.tr\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmertyildiran%2Fdasm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmertyildiran%2Fdasm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmertyildiran%2Fdasm/lists"}