{"id":18469778,"url":"https://github.com/valen-h/jsa","last_synced_at":"2026-05-09T14:07:21.400Z","repository":{"id":143795686,"uuid":"188895588","full_name":"Valen-H/JSA","owner":"Valen-H","description":"An (esolang) javascript assembly implementation.","archived":false,"fork":false,"pushed_at":"2023-02-25T20:27:33.000Z","size":85,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-08T23:51:57.145Z","etag":null,"topics":["assembly","esolang","goto","jsa","node","typescript"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/Valen-H.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":"2019-05-27T19:02:19.000Z","updated_at":"2022-01-14T18:20:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"4996df4b-04bb-4d13-8bdf-60ee78fc343b","html_url":"https://github.com/Valen-H/JSA","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Valen-H%2FJSA","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Valen-H%2FJSA/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Valen-H%2FJSA/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Valen-H%2FJSA/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Valen-H","download_url":"https://codeload.github.com/Valen-H/JSA/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253166465,"owners_count":21864469,"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","esolang","goto","jsa","node","typescript"],"created_at":"2024-11-06T10:11:42.295Z","updated_at":"2026-05-09T14:07:21.358Z","avatar_url":"https://github.com/Valen-H.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JSA\n\nAn esolang pseudoassembly implemented in JS.\n\n* Strings start with \" (ex. `\"this is a string`).\n* You should use strings only as last operand.\n* By negating a GT you get a LTE etc.\n* Whitespace is `\\\\s`.\n\n## Usage\n\n```js\njsa = JSA.parse(text) # or JSA.parseBinary(TypedArray)\n\nfor (const c of jsa.execute(\"args\")) {\n    console.log(c);\n}\n```\n\nor you can use the NodeJS binary\n\n```bash\njsa compile file [output]  - Compile (.jsa -\u003e .jsae)\njsa run file               - Execute program (.jsa or .jsae)\n```\n\n## Opcodes (jsa)\n\n```asm\n* #                            - comment\n* NOP - NOP                    - nothing...\n* BRK - BRK                    - break execution\n* CAL - CAL x, [a=x, [params]] - Syscall [system command names are passed as strings]\n* EVAL - EVAL x, code          - Evaluate JS code, `\"arg` gives env params\n* LAB - LAB x, [a=line]        - label x = a\n* JMP - JMP x                  - jmp x\n* IF  - IF  x, [a]             - if(x) jmp a\n* IFN - IFN x, [a]             - if(!x) jmp a\n* SET - SET x, a               - x = a\n* ADD - ADD x, [a=x[, b=1]]    - x = a + b   | x = x + a\n* SUB - SUB x, [a=x[, b=1]]    - x = a - b   | x = x - a\n* MUL - MUL x, [a=x[, b=-1]]   - x = a * b   | x = x * a\n* DIV - DIV x, a[, b=x]        - x = a / b\n* MOD - MOD x, a[, b]          - x = a % b   | x = x % a\n* POW - POW x, a[, b]          - x = a ** b  | x = x ** a\n* SHL - SHL x, [a=x, [b=1]]    - x = a \u003c\u003c b  | x = x \u003c\u003c a\n* SHR - SHR x, [a=x, [b=1]]    - x = a \u003e\u003e b  | x = x \u003e\u003e a\n* USH - USH x, [a=x, [b=1]]    - x = a \u003e\u003e\u003e b | x = x \u003e\u003e\u003e a\n* OR  - OR  x, [a=x, [b=x]]    - x = a || b  | x = x || a\n* BOR - BOR x, a=x, [b]        - x = a | b   | x = x | a\n* XOR - XOR x, [a=x, [b=x]]    - x = a ^ b   | x = x ^ a\n* AND - AND x, a=x, [b]        - x = a \u0026\u0026 b  | x = x \u0026\u0026 a\n* BND - BND x, [a=x, [b=x]]    - x = a \u0026 b   | x = x \u0026 a\n* NOT - NOT x, [a=x]           - x = !a\n* BNT - BNT x, [a=x]           - x = ~a\n* GT  - GT  x, [a=x, [b]]      - x = a \u003e b   | x = x \u003e a\n* GTE - GTE x, [a=x, [b]]      - x = a \u003e= b  | x = x \u003e= a\n* LT  - LT  x, [a=x, [b]]      - x = a \u003c b   | x = x \u003c a\n* LTE - LTE x, [a=x, [b]]      - x = a \u003c= b  | x = x \u003c= a\n* ARR - ARR x                  - x = [ ]\n* ARG - ARG x, a=x, [b]        - x = a[b]    | x = x[a]\n* ARS - ARS x, a, b            - a[b] = x\n* ARL - ARL x, a=x             - x = a.length\n* PSH - PSH x, a               - a.push(x)\n* UNS - UNS x, a               - a.unshift(x)\n* POP - POP x, a               - x = a.pop()\n* SHF - SHF x, a               - x = a.shift()\n* OBJ - OBJ x                  - x = { }\n* OBG - OBG x, a=x, [b]        - x = a[b]    | x = x[a]\n* OBS - OBS x, a, b            - a[b] = x\n* OBK - OBK x, a=x             - x = a.keys()\n* TYP - TYP x, [a=x]           - x = typeof x\n* OUT - OUT x                  - console.log(x)\n```\n\n## Executable Format (jsae)\n\n```asm\n137 - magic number\n1|0 - fixed length or extensible syntax\n...data{  }\n138 - magic number\n...code{ OPC [DST[, OP2[, OP3]]] } where DST,OP2,OP3 are { 0|1|2|3 0-255 } where 0 is registers and 1 is datastore and 2 is immediate and 3 is system\nNOP\n```\n\n* 255 defines extension.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalen-h%2Fjsa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvalen-h%2Fjsa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalen-h%2Fjsa/lists"}