{"id":15060076,"url":"https://github.com/afonsofaria20s/assembly-simulator","last_synced_at":"2025-03-15T04:13:04.552Z","repository":{"id":251535960,"uuid":"837698584","full_name":"AfonsoFaria20s/assembly-simulator","owner":"AfonsoFaria20s","description":"This is a basic assembly language simulator written in Java. It supports basic arithmetic, logical, and memory operations, simulating the behavior of a simple processor.","archived":false,"fork":false,"pushed_at":"2024-10-06T16:28:01.000Z","size":204,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-15T04:13:00.338Z","etag":null,"topics":["algorithms","assembly","datastructures","java","simulator"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AfonsoFaria20s.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-08-03T18:43:11.000Z","updated_at":"2024-10-06T16:28:04.000Z","dependencies_parsed_at":"2024-09-10T13:30:40.511Z","dependency_job_id":null,"html_url":"https://github.com/AfonsoFaria20s/assembly-simulator","commit_stats":null,"previous_names":["afonsofaria20s/assemblysimulator"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AfonsoFaria20s%2Fassembly-simulator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AfonsoFaria20s%2Fassembly-simulator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AfonsoFaria20s%2Fassembly-simulator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AfonsoFaria20s%2Fassembly-simulator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AfonsoFaria20s","download_url":"https://codeload.github.com/AfonsoFaria20s/assembly-simulator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243681081,"owners_count":20330155,"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":["algorithms","assembly","datastructures","java","simulator"],"created_at":"2024-09-24T22:52:10.449Z","updated_at":"2025-03-15T04:13:04.522Z","avatar_url":"https://github.com/AfonsoFaria20s.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FonSim\n\n## Simple Assembly Language Simulator\n\nFonSim is a basic assembly language simulator written in Java. It simulates the behavior of a simple processor with features including arithmetic, logical, and memory operations.\n\n## Features\n\n- **Arithmetic Operations**: Addition, subtraction, multiplication, and division.\n- **Logical Operations**: Bitwise AND and OR.\n- **Memory Operations**: Loading from and storing to memory.\n- **Control Flow**: Jump instructions to alter the sequence of execution.\n- **Graphical User Interface (GUI)**: Provides a user-friendly interface for interacting with the simulator.\n- **Conditional Jumps**: Conditional jumps based on equality, inequality, and relational operators.\n\n## Instructions\n\n- **MOV r1, imm** (0x01): Move an immediate value to register `r1`.\n- **ADD r1, r2, addr** (0x02): Add the value of register `r2` to the value from memory at address `addr` and store the result in `r1`.\n- **SUB r1, r2, addr** (0x03): Subtract the value from memory at address `addr` from the value of register `r2` and store the result in `r1`.\n- **MUL r1, r2, addr** (0x04): Multiply the value of register `r2` by the value from memory at address `addr` and store the result in `r1`.\n- **DIV r1, r2, addr** (0x05): Divide the value of register `r2` by the value from memory at address `addr` and store the result in `r1`.\n- **AND r1, r2, addr** (0x06): Perform a bitwise AND on the values of registers `r2` and `addr` and store the result in `r1`.\n- **OR r1, r2, addr** (0x07): Perform a bitwise OR on the values of registers `r2` and `addr` and store the result in `r1`.\n- **STR r1, addr** (0x08): Store the value of register `r1` into memory at the specified address `addr`.\n- **LD r1, addr** (0x09): Load the value from memory at the specified address `addr` into register `r1`.\n- **JMP addr** (0x0A): Jump to the specified address `addr` in the program.\n- **JMPE r1, r2, addr** (0x0B): Conditional jump to address `addr` if the value of register `r1` equals the value of register `r2`.\n- **JMPN r1, r2, addr** (0x0C): Conditional jump to address `addr` if the value of register `r1` does not equal the value of register `r2`.\n- **JMPG r1, r2, addr** (0x0D): Conditional jump to address `addr` if the value of register `r1` is greater than the value of register `r2`.\n- **JMPL r1, r2, addr** (0x0E): Conditional jump to address `addr` if the value of register `r1` is less than the value of register `r2`.\n- **JMPR r1** (0x0F): Relative jump to address `current + r1`, basically add a number to jump as many relative to the current address.\n\n## Usage\n\n1. **Download the Executable:**\n   - Download the `.exe` file from the [releases page](https://github.com/AfonsoFaria20s/assembly-simulator/releases).\n   - Make sure that you have latest version of JRE and JDK-22 installed.\n\n2. **Create a Program File:**\n   - Create a file (for example) `myProgram.txt` with your instructions, each on a new line. For example:\n     ```\n     MOV R1, 10\n     MOV R2, 5\n     ADD R1, R2, 0\n     STORE R1, 0\n     LOAD R1, 0\n     JMP 0\n     ```\n\n3. **Run the Simulator:**\n   - Double-click the `.exe` file to start the simulator.\n\n## Notes\n\n- The simulator uses a busy-wait loop to simulate delays; you can adjust or remove this as needed.\n- Feel free to modify and extend the simulator according to your needs. Happy coding!\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafonsofaria20s%2Fassembly-simulator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fafonsofaria20s%2Fassembly-simulator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafonsofaria20s%2Fassembly-simulator/lists"}