{"id":16975410,"url":"https://github.com/a11ce/esasm","last_synced_at":"2025-03-21T21:15:07.734Z","repository":{"id":57745704,"uuid":"192636822","full_name":"a11ce/esAsm","owner":"a11ce","description":"toy assembly-ish language","archived":false,"fork":false,"pushed_at":"2023-04-15T22:00:49.000Z","size":47,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-21T21:15:02.710Z","etag":null,"topics":["assembly"],"latest_commit_sha":null,"homepage":"","language":"Racket","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/a11ce.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}},"created_at":"2019-06-19T01:32:16.000Z","updated_at":"2023-03-13T04:48:55.000Z","dependencies_parsed_at":"2024-11-28T05:02:46.377Z","dependency_job_id":null,"html_url":"https://github.com/a11ce/esAsm","commit_stats":{"total_commits":27,"total_committers":2,"mean_commits":13.5,"dds":0.03703703703703709,"last_synced_commit":"ff7d465105c8b415fe46facd66b1989729561666"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a11ce%2FesAsm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a11ce%2FesAsm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a11ce%2FesAsm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a11ce%2FesAsm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/a11ce","download_url":"https://codeload.github.com/a11ce/esAsm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244868753,"owners_count":20523591,"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"],"created_at":"2024-10-14T01:10:59.961Z","updated_at":"2025-03-21T21:15:07.701Z","avatar_url":"https://github.com/a11ce.png","language":"Racket","funding_links":[],"categories":[],"sub_categories":[],"readme":"# esAsm\n\n\u003e esAsm is a toy assembly-like language \n\n## Installation\n\n`raco pkg install esAsm`\n\n## The esAsm language\n\n- Each line in an esAsm file may contain whitespace, a comment, a label, or an instruction.\n- Comment lines begin with `;` and are ignored. Lines starting with `#lang esAsm` are also ignored.\n- Labels are indicated with the suffix `:`. The `:` is not part of the label name when referenced elsewhere.\n- Literal integers are prefixed with `#`, and register references are prefixed with `r`. The registers are `r0`-`r11`.\n- Program execution is moved to the beginning of a file when the end is reached. It will continue looping until the `hlt` instruction.\n\n### Instructions\n\nIn this documentation, `val` means any literal or register, `reg` means a register, and `lab` means a label.\n\n- `shn val` prints the numeric value of `val`.\n- `sha val` prints the ascii character with the decimal value `val`.\n- `mov reg val` sets the value of `reg` to `val`.\n- `add reg val1 val2` sets the value of `reg` to `val1` + `val2`.\n- `sub reg val1 val2` sets the value of `reg` to `val1` - `val2`.\n- `jmp lab` moves the program execution to `lab`.\n- `jlt lab val1 val2` moves the program execution to `lab` if `val1` \u003c `val2`.\n- `jgt lab val1 val2` moves the program execution to `lab` if `val1` \u003e `val2`.\n- `jet lab val1 val2` moves the program execution to `lab` if `val1` == `val2`.\n- `inp reg` sets the value of `reg` to an integer from read from stdin.\n- `hlt` ends the execution of the program. \n- `mficofsr reg` sets the value of `reg` to the value of the \"Is Computer On Fire\" status register. See [here](https://twitter.com/ppcinstructions/status/559753895757742083).\n\n## Examples\n\nThere are a few examples in the `examples/` directory.\n\n- `read-six-numbers.es.rkt` reads six numbers and prints their sum.\n- `is-even.es.rkt` prints `Y` if the given number is even and `N` if it's odd. \n- `compare.es.rkt` prints `G`, `L`, or `E` if the first number is respectively greater, less, or equal to the second.\n- `fibonacci.es.rkt` prints the first 10 terms of the Fibonacci sequence. \n- `factors.es.rkt` prints the factors of a given number. \n- `no-jump.es.rkt` demonstrates the branchless sublanguage.\n\nFor testing purposes, `inp` is replaced (commented) in the examples.\n\n## Instruction reference\n\n|Name       | Summary                                          | Syntax\n|-----------|--------------------------------------------------|---\n|shn        | Show as number                                   | shn val\n|sha        | Show as ascii                                    | sha val\n|mov        | Move                                             | mov reg val\n|add        | Add                                              | add reg val1 val2\n|sub        | Subtract                                         | sub reg val1 val2\n|jmp        | Jump                                             | jmp lab\n|jlt        | Jump if less than                                | jlt lab val1 val2\n|jgt        | Jump if greater than                             | jgt lab val1 val2\n|jet        | Jump if equal to                                 | jet lab val1 val2\n|inp        | Input                                            | inp reg\n|hlt        | Halt                                             | hlt\n|mficofsr   | Move From Is Computer On Fire Status Register    | mficofsr reg\n\n---\n\nAll contributions are welcome by pull request or issue, especially new instructions.\n\nBehavior of esAsm is undefined if the computer is on fire.\n\nesAsm is licensed under the MIT license. See [LICENSE](../master/LICENSE) for full text.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa11ce%2Fesasm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fa11ce%2Fesasm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa11ce%2Fesasm/lists"}