{"id":34647191,"url":"https://github.com/neuschaefer/jzforth","last_synced_at":"2026-05-26T22:08:01.037Z","repository":{"id":209083407,"uuid":"723129672","full_name":"neuschaefer/jzforth","owner":"neuschaefer","description":"Jazelle forth","archived":false,"fork":false,"pushed_at":"2023-11-24T19:08:35.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-11-25T00:21:23.270Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Assembly","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/neuschaefer.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}},"created_at":"2023-11-24T19:06:32.000Z","updated_at":"2023-11-25T00:21:26.390Z","dependencies_parsed_at":"2023-11-25T00:21:26.073Z","dependency_job_id":"aac12c8a-5f39-4bd1-9517-5b0af4401c4d","html_url":"https://github.com/neuschaefer/jzforth","commit_stats":null,"previous_names":["neuschaefer/jzforth"],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/neuschaefer/jzforth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuschaefer%2Fjzforth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuschaefer%2Fjzforth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuschaefer%2Fjzforth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuschaefer%2Fjzforth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neuschaefer","download_url":"https://codeload.github.com/neuschaefer/jzforth/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuschaefer%2Fjzforth/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33540823,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"ssl_error","status_checked_at":"2026-05-26T15:22:15.568Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":[],"created_at":"2025-12-24T17:48:19.499Z","updated_at":"2026-05-26T22:08:01.029Z","avatar_url":"https://github.com/neuschaefer.png","language":"Assembly","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A terrible idea: JZFORTH\n\n- A FORTH for ARM Jazelle\n  - it will be inspired by jonesforth\n- A handcrafted ELF\n  - a few pages of ARM code for initialization and opcode handlers\n    - a handler for syscall instructions\n  - \"JVM\" code for the static forth dictionary\n    - assembled with a jvm assembler\n    - implements a runtime forth compiler\n    - special functionality to write the current process to a file and to\n      undefine words / free memory\n\n## Implementation details\n\n- Syscalls use the impdep1 JVM instruction\n  - fe 01  syscall1\n    arg0, sysnr -\u003e ret\n  - fe 00  syscall0\n    sysnr -\u003e ret\n- Memory layout\n  - Base image\n    - ELF header and Program header\n      - Forth entry word in `e_ident`\n    - ARM initialization code\n    - hello world in jvm code\n    - basic forth dictionary in jvm code\n  - Stack\n    - Jazelle handler table\n    - Locals table\n- JVM locals: important forth state\n  - space for temporaries\n  - base image start and end\n  - return address\n  - return stack pointer\n- calls\n  - call: jsr foo\n  - leaf functions\n    - prologue: `astore #5` - save RA to local\n    - epilogue: `ret #5`\n  - functions that call other functions\n    - prologue: push RA to return stack\n    - epilogue: pop RA from return stack, write to local, `ret`\n\n\n## Hello world\n\nA _hello world_ in JVM assembly:\n(the numbers on the left are the current stack depth)\n\n```\n        // write the well-known message\n        .byte 0x10, 13                  // 0  bipush length\n        .byte 0x1a                      // 1  iload_0 = load BASE from locals\n        .byte 0x10, 0x10                // 2  bipush offset of string\n        .byte 0x60                      // 3  iadd\n        .byte 0x04                      // 2  iconst_1 = stdout\n        .byte 0x07                      // 3  iconst_4 = SYS_write\n        .byte 0xfe, 3                   // 4  syscall3 (fe 03)\n        .byte 0x57                      // 1  pop\n\n        // exit\n        .byte 0x10, 42                  // 0  bipush 42\n        .byte 0x04                      // 1  iconst_1 = SYS_exit\n        .byte 0xfe, 1                   // 2  syscall1 (fe 01)\n\n        .ascii  \"Hello World!\\n\"\n```\n\n\n## References\n\n- [Jonesforth](http://git.annexia.org/?p=jonesforth.git;a=blob;f=jonesforth.S;h=45e6e854a5d2a4c3f26af264dfce56379d401425;hb=HEAD) ([GitHub mirror](https://github.com/nornagon/jonesforth))\n- [A Whirlwind Tutorial on Creating Really Teensy ELF Executables for Linux](http://www.muppetlabs.com/~breadbox/software/tiny/teensy.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneuschaefer%2Fjzforth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneuschaefer%2Fjzforth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneuschaefer%2Fjzforth/lists"}