{"id":50679230,"url":"https://github.com/gerph/riscos-cmunge","last_synced_at":"2026-06-08T17:32:14.493Z","repository":{"id":358759923,"uuid":"1242945982","full_name":"gerph/riscos-cmunge","owner":"gerph","description":"CMunge (RISC OS CMHG replacement)","archived":false,"fork":false,"pushed_at":"2026-06-01T18:21:47.000Z","size":398,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-06-01T20:18:58.033Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/gerph.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-18T23:00:52.000Z","updated_at":"2026-06-01T18:22:10.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/gerph/riscos-cmunge","commit_stats":null,"previous_names":["gerph/riscos-cmunge"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/gerph/riscos-cmunge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerph%2Friscos-cmunge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerph%2Friscos-cmunge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerph%2Friscos-cmunge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerph%2Friscos-cmunge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gerph","download_url":"https://codeload.github.com/gerph/riscos-cmunge/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerph%2Friscos-cmunge/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34073778,"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":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":"2026-06-08T17:32:13.760Z","updated_at":"2026-06-08T17:32:14.488Z","avatar_url":"https://github.com/gerph.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CMunge\n\nCMunge is a tool for RISC OS developers that generates the glue code needed to write relocatable RISC OS modules in C or C++. It is a free, enhanced alternative to Acorn/Castle CMHG and is designed to process the same style of module description files.\n\nRather than emitting the final object file directly, CMunge generates assembly source for the veneer layer between the RISC OS kernel and C or C++ code, and can then drive an assembler to produce the module object. This keeps the module-facing boilerplate out of the application code while handling module headers, SWI dispatch, command parsing, service handling, and related low-level details.\n\n## Features\n\n- Compatible with CMHG-style input files.\n- Generates veneers for module initialisation, finalisation, SWIs, commands, services, vectors, and related entry points.\n- Supports 26-bit ARM, 32-bit ARM, and 64-bit AArch64 output.\n- Supports Norcroft, GCC, and legacy LCC toolchain modes.\n- Can preprocess description files with `-p` or `-px`.\n- Adds CMunge-specific features beyond classic CMHG, including:\n  - error base handling and generated error identifiers\n  - SWI-specific handlers in decoding tables\n  - vector trap handlers\n  - enhanced generic veneer support\n  - non-reentrant module support\n  - improved C++ module support\n  - 64-bit code generation\n\n## What CMunge Does\n\nCMunge reads a CMHG/CMunge description file and generates the veneer code needed to bridge RISC OS module interfaces to C or C++ functions. In practice that means it can generate support for:\n\n- module title and help strings\n- module initialisation and finalisation handlers\n- service call handlers\n- SWI dispatch tables and SWI decoding\n- `*Command` tables and handlers\n- generic veneers, vector handlers, and event handlers\n\nThe companion PRM-in-XML documentation in [`prminxml/cmunge.xml`](prminxml/cmunge.xml) and [`prminxml/cmhg-format.xml`](prminxml/cmhg-format.xml) documents both the tool and the input format in more detail.\n\n## Command Line\n\nThe basic form is:\n\n```text\nCMunge [options] \u003cinfile\u003e\n```\n\nCommon options:\n\n- `-o \u003cfile\u003e`: output object file\n- `-s \u003cfile\u003e`: output assembly file\n- `-d \u003cfile\u003e`: generated C header file\n- `-xhdr \u003cfile\u003e`: exported assembler SWI header\n- `-xh \u003cfile\u003e`: exported C SWI header\n- `-p`: preprocess input\n- `-px`: extended preprocess mode\n- `-depend \u003cfile\u003e`: write dependency information for AMU\n- `-throwback`: enable throwback error reporting\n- `-26bit`: generate 26-bit code\n- `-32bit`: generate 32-bit compatible code\n- `-64bit`: generate 64-bit AArch64 code\n- `-apcs \u003cvariant\u003e`: select APCS variant\n- `-tnorcroft`, `-tgcc`, `-tlcc`: select toolchain\n- `-blank`: generate a template input file\n- `-cmhg`: warn about CMHG-incompatible constructs\n- `-zoslib`, `-zoslibpath`: select OSLib header style\n- `-zerrors`: generate error and veneer definitions only\n\nExample:\n\n```text\nCMunge -32bit -d h.modhdr -o o.modhdr cmhg.ModDesc\n```\n\n## CMHG / CMunge Input Format\n\nCMunge uses the CMHG file format, a small domain-specific language for describing a RISC OS relocatable module.\n\nAt a high level:\n\n- the file is a sequence of directives\n- directives are written as `keyword: value`\n- keywords are case-insensitive\n- comments begin with `;`\n- a trailing comma continues a logical line onto the next physical line\n- strings are double-quoted\n- numbers may be decimal, `\u0026`-prefixed hexadecimal, or `0x`-prefixed hexadecimal\n\nTypical directives include:\n\n- `title-string`\n- `help-string`\n- `initialisation-code`\n- `finalisation-code`\n- `service-call-handler`\n- `swi-chunk-base-number`\n- `swi-handler-code`\n- `swi-decoding-table`\n- `command-keyword-table`\n- `generic-veneers`\n- `vector-handlers`\n- `event-handler`\n\nCMunge also extends the original format with directives and behaviours for modern development, including 32-bit and 64-bit support, error identifier generation, early initialisation, and more flexible veneer handling.\n\n## Building\n\nThis repository is set up for the RISC OS build environment and builds `CMunge` as an `aif` tool.\n\nRepository build entry points:\n\n- `Makefile`\n- `.robuild.yaml`\n- `crosscompile/`\n\nTypical build command in the RISC OS build environment:\n\n```text\namu -f Makefile install INSTDIR=Install\n```\n\nThe CI build configuration in [`.robuild.yaml`](.robuild.yaml) builds the tool and then runs `aif32.CMunge`.\n\n## Repository Layout\n\n- [`c/`](c/) - C source files\n- [`h/`](h/) - headers\n- [`prminxml/`](prminxml/) - PRM-in-XML documentation sources\n- [`testdata/`](testdata/) - test inputs and expected outputs\n- [`crosscompile/`](crosscompile/) - cross-compilation support files\n\n## Status\n\nThe source tree includes substantial work beyond older CMHG-compatible behaviour, notably 32-bit support, 64-bit AArch64 support, updated build integration, and regression test data for multiple output variants.\n\n## Documentation\n\nFull documentation is in the repository's PRM-in-XML sources:\n\n- [`prminxml/cmunge.xml`](prminxml/cmunge.xml)\n- [`prminxml/cmhg-format.xml`](prminxml/cmhg-format.xml)\n\nWhich are built into documentation within the release archives.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgerph%2Friscos-cmunge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgerph%2Friscos-cmunge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgerph%2Friscos-cmunge/lists"}