{"id":16574414,"url":"https://github.com/c71n93/processor","last_synced_at":"2026-04-17T15:02:02.110Z","repository":{"id":152075691,"uuid":"415394864","full_name":"c71n93/Processor","owner":"c71n93","description":"CPU emulator, assembler and disassembler","archived":false,"fork":false,"pushed_at":"2022-03-11T11:17:25.000Z","size":539,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-05T16:53:51.441Z","etag":null,"topics":["assembly","cpu-emulator"],"latest_commit_sha":null,"homepage":"","language":"C++","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/c71n93.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":"2021-10-09T18:47:51.000Z","updated_at":"2022-08-26T16:54:57.000Z","dependencies_parsed_at":"2023-09-15T22:18:12.667Z","dependency_job_id":null,"html_url":"https://github.com/c71n93/Processor","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/c71n93/Processor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c71n93%2FProcessor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c71n93%2FProcessor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c71n93%2FProcessor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c71n93%2FProcessor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/c71n93","download_url":"https://codeload.github.com/c71n93/Processor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c71n93%2FProcessor/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266135014,"owners_count":23881774,"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":["assembly","cpu-emulator"],"created_at":"2024-10-11T21:44:30.470Z","updated_at":"2026-04-17T15:01:57.051Z","avatar_url":"https://github.com/c71n93.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Processor\n\n## Processor architecture:\nProcessor has 8 registers: ```ax, bx, cx, dx, ex, fx, gx, hx```\n\nProcessor has acces to RAM: ```4k``` - if you using type ```int```; ```8k``` if you using type ```double```.\n\nThe default data type is double. To change type of data in processot you should use defines: ```#define INT_DATA``` or ```#define FLOAT_DATA```\n\n## Processor instructions:\n\n- ```hlt``` - End of program\n\n---\n\n- ```push``` - This command have one argument. It push argument value into *Stack*.\n```push 4``` \t\t- push constant value into *Stack*\n```push ax``` \t\t- push register value into *Stack*\n```push [bx + 5]``` - push value from address ```bx + 5``` into *Stack*\n\n- ```pop``` - This command have one or zero argument. It pop value from *Stack* into argument.\n```pop``` \t\t\t- pop from *Stack*\n```pop ax``` \t\t- pop value from *Stack* into register\n```push [cx]``` \t- pop value from *Stack* into address ```cx```\n\n---\n\n- ```add``` - adds two last values in *Stack* (```first + second```) and push result\n\n- ```sub``` - subtracts two last values in *Stack* (```first - second```) and push result\n\n- ```mul``` - multiplies two last values in *Stack* (```first * second```) and push result\n\n- ```div``` - divides two last values in *Stack* (```first / second```) and push result\n\n- ```sqrt``` - takes square root of value in *Stack* and push result.\n\n---\n\n- ```out``` - print last value from *Stack*\n\n- ```in``` - scan value and push it into *Stack*\n\n---\n```:lable_name``` - label must start with ```:```\n\n- ```jmp lable_name``` - jumps into the lable\n\n- ```ja lable_name``` - takes two last values from *Stack*, if ```first \u003e second``` jumps into the lable\n\n- ```jae lable_name``` - takes two last values from *Stack*, if ```first \u003e= second``` jumps into the lable\n\n- ```jb lable_name``` - takes two last values from *Stack*, if ```first \u003c second``` jumps into the lable\n\n- ```jbe lable_name``` - takes two last values from *Stack*, if ```first \u003c= second``` jumps into the lable\n\n- ```je lable_name``` - takes two last values from *Stack*, if ```first == second``` jumps into the lable\n\n- ```jne lable_name``` - takes two last values from *Stack*, if ```first != second``` jumps into the lable\n\n---\n\n```:function_name``` - name of function must start with ```:```\n\n- ```call function_name``` - call function\n\n- ```ret``` - returns from function to the place where it was called\n\n## How to use Processor:\nProject consists of thre programs: *Assembler*, *Processor* and *Disassembler*.\n\n- **Assembler**\nThis programm convert a program in special asm language into binary executable.\n\nInput of *Assembler* - is a program in special asm language. You should pass a path to asm file in the first argument of programm.\n\nOutput of *Assembler* is a binary executable. You should pass a path to place where you want to see your executable in the second argument of programm.\n\n- **Processor**\nThis programm execute a binary executable file received from *Assembler*.\n\nInput of *Processor* - is a binary executable. You should pass a path to binary executable file in the first argument of programm.\n\n- **Disassembler**\nThis programm convert binary executable file received from *Assembler* back into asm program.\n\nInput of *Disassembler* - is a binary executable. You should pass a path to binary executable file in the first argument of programm.\n\nOutput of *Disassembler* is a disassembled file. You should pass a path to place where you want to see your disassembled file in the second argument of programm.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fc71n93%2Fprocessor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fc71n93%2Fprocessor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fc71n93%2Fprocessor/lists"}