{"id":39898792,"url":"https://github.com/tsupplis/cpm86-crossdev","last_synced_at":"2026-05-25T00:01:56.452Z","repository":{"id":64521804,"uuid":"412101572","full_name":"tsupplis/cpm86-crossdev","owner":"tsupplis","description":"CP/M-86 cross development environment","archived":false,"fork":false,"pushed_at":"2026-05-23T16:47:38.000Z","size":212,"stargazers_count":12,"open_issues_count":3,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-05-23T18:18:43.791Z","etag":null,"topics":["asm","c","ccpm","cpm","cpm22","cpm86","os","vintage"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/tsupplis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-09-30T14:38:50.000Z","updated_at":"2026-05-23T16:32:02.000Z","dependencies_parsed_at":"2023-01-04T20:20:55.151Z","dependency_job_id":null,"html_url":"https://github.com/tsupplis/cpm86-crossdev","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/tsupplis/cpm86-crossdev","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsupplis%2Fcpm86-crossdev","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsupplis%2Fcpm86-crossdev/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsupplis%2Fcpm86-crossdev/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsupplis%2Fcpm86-crossdev/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tsupplis","download_url":"https://codeload.github.com/tsupplis/cpm86-crossdev/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsupplis%2Fcpm86-crossdev/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33455026,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-24T19:21:36.376Z","status":"ssl_error","status_checked_at":"2026-05-24T19:21:10.562Z","response_time":57,"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":["asm","c","ccpm","cpm","cpm22","cpm86","os","vintage"],"created_at":"2026-01-18T15:12:08.731Z","updated_at":"2026-05-25T00:01:56.444Z","avatar_url":"https://github.com/tsupplis.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CP/M-86 \u0026 MS-DOS Cross Development Environment\n\nThis project regroups a simple method to create a cross development environment for CP/M-86. It happens that all DOS based tools can also be used for building DOS programs.\nThis project was developed for myself in a nerdy spirit and for a lot of fun. Just sharing without any guarantees.\n\nLanguages supported are:\n- C (K\u0026R and almost ANSI)\n- Assembler\n- Basic \n\n## Where to find CP/M-86?\n\nThe source for CP/M-86 doc, sources and binaries is http://www.cpm.z80.de.\n\nA cleaned-up distribution and kernel is available at https://github.com/tsupplis/cpm86-kernel. This distribution is working well in virtual environments, patched with all known patches, 'y2k' friendly (it contains the version of tod which sources are in this project) and AT friendly.\n\n## Key tools for CP/M-86 development\n- aztec c compiler version 3.4/3.40a (K\u0026R, the CP/M-86 library is provided as c86.lib), patched\n- aztec c compiler version 4.2/4.10d (Almost ANSI, the code for the CP/M-86 library (c86.lib) is patched and recompiled from 3.4 sources, as it is not part of the default compiler package. a dos 1.1 library (d11.lib) is also provided in the same manner), the documentation can be found at (https://www.aztecmuseum.ca/docs/Aztec_C_MSDOS_4.10C_Commercial_Apr88.pdf)\n- rasm86/link86,lib86 DOS version from Digital Research \n- asm86.com  and gendef.com from Digital Research\n- cb86.exe and libraries from Digital Reasearch\n- nasm netwide assembler\n- masm, link, asm, exe2bin, hex2bin from Microsoft (the version of masm in this repository has been patched to work with emu2 and other emulators, see https://github.com/tsupplis/pcdos11-hacking for details). asm.com and hex2bin.com have been rebuilt for modified sources at https://github.com/tsupplis/pcdos11-hacking .\n\n- The Super Cool emu2 DOS emulator to run the DR tools on macOS and Linux (https://github.com/dmsc/emu2). This is an incredible way to bring dos command line development tools to a modern and up to date shell/make/whatever based dev environment. Another stunning emulator. Emu2 and PCE are an incredible pair.\n- We also need to run some cp/m-80 programs, for that, the tinylpo emulator is used (https://gitlab.com/gbrein/tnylpo). It works very well with asm86.com and gencmd.com programs\n\n## License Considerations\n\n- Microsoft MS-DOS tools are under MITS license (https://github.com/microsoft/MS-DOS/blob/master/LICENSE.md)\nThe following tools are not included and downloaded by the fetch tool but require you to understand the conditions of usage:\n- The Aztec C use coniditions is documented at (https://www.aztecmuseum.ca/intro.htm#intro)\n- The DR tools usage is documented at (http://www.cpm.z80.de/license.html) and (http://www.cpm.z80.de/faq.html)\n- The DR CBASIC compiler 2.0 for CP/M-86 and 2.1 for DOS is documented at (http://www.cpm.z80.de/license.html) and (http://www.cpm.z80.de/faq.html)\n- emu2 and tnylpo are open source with their licenses described respectively at (https://github.com/dmsc/emu2/blob/master/LICENSE) and (https://gitlab.com/gbrein/tnylpo/-/blob/master/LICENSE)\n- nasm license terms can be found at (https://www.nasm.us)\n- I am not guaranteeing in any ways the components mentioned above. You are of course free to use these at your own risk if you accept the conditions of usage given above.\n\n## Script Mapping\n\nAll the tools are wrapped in the bin directory for direct usage:\n\n| script name   | program     | quick description                  |\n|---------------|-------------|------------------------------------|\n| cpm_asm86     | asm86.cmd   | DR assembler (CP/M-80 tool)        | \n| cpm_gencmd    | gencmd.cmd  | DR H86 converter (CP/M-80 tool)    |\n| pcdev_rasm86  | rasm86.exe  | DR assembler (OBJ)                 |\n| pcdev_linkcmd | linkcmd.exe | DR linker for CP/M-86              |\n| pcdev_link86  | linkcmd.exe | \"  \"  \"  \"  \"  \"                   |\n| pcdev_linkexe | linkexe.exe | DR linker for DOS                  |\n| pcdev_lib86   | lib86.exe   | DR librarian                       |\n| pcdev_masm    | masm.exe    | Microsoft assembler                |\n| pcdev_link    | link.exe    | Microsoft linker                   |\n| pcdev_exe2bin | exe2bin.exe | Microsoft EXE converter            |\n| pcdev_hex2bin | hex2bin.com | Microsoft HEX converter            |\n| pcdev_asm     | asm.com     | Microsoft/86-DOS assembler         |\n| pcdev_cmdinfo | cmdinfo.com | CMD info tool                      |\n| pcdev_bin2cmd | bin2cmd.com | CMD converter                      |\n| aztec34_as    | as.exe      | Aztec Assembler.                   |\n| aztec34_cc    | cc.exe      | Aztec K\u0026R C compiler               |\n| aztec34_sqz   | sqz.exe     | Aztec C object optimizer           |\n| aztec34_link  | ln.exe      | Aztec C linker                     |\n| aztec34_lib   | lb.exe      | Aztec C lib                        |\n| aztec34_ord   | ord.exe     | Aztec C library ordering helper    |\n| aztec34_obd   | obd.exe     | Aztec C object dump                |\n| aztec34_hex86 | hex86.exe   | Aztec C H86 generator              |\n| aztec42_as    | as.exe      | Aztec Assembler.                   |\n| aztec42_cc    | cc.exe      | Aztec ANSI C compiler              |\n| aztec42_sqz   | sqz.exe     | Aztec C object optimizer           |\n| aztec42_link  | ln.exe      | Aztec C linker                     |\n| aztec42_lib   | lb.exe      | Aztec C lib                        |\n| aztec42_ord   | ord.exe     | Aztec C library ordering helper    |\n| aztec42_obd   | obd.exe     | Aztec C object dump                |\n| aztec42_hex86 | hex86.exe   | Aztec C H86 generator              |\n| drcbcpm_bc    | cb86.exe    | DR cbasic compiler for CP/M-86     |\n| drcbcpm_link  | link86.exe  | DR cbasic linker for CP/M-86       |\n| drcbdos_bc    | cb86.exe    | DR cbasic compiler for DOS         |\n| drcbdos_link  | linkexe.exe | DR cbasic linker for DOS           |\n| cpm86         | -           | CP/M-86 emulator                   |\n| hexcom        | -           | HEX to binary translation          |\n| doscat        | -           | Truncate files beyond ^Z           |\n| nasm          | -           | Netwide assembler                  |\n\n## Fetching the tools\n\nThe development environment can be assembled by using the following steps:\n```\n./fetch_tools\nexport PATH=`pwd`/bin\n```\nit pulls the following:\n- aztec 3.4 c compiler  (https://www.aztecmuseum.ca/az8634b.zip)\n- link86, lib86 and rasm86 (http://www.cpm.z80.de/download/tools86.zip)\n- asm86 and gencmd (http://www.cpm.z80.de/download/mpm862sr.zip)\n- cb86 2.0/2.1 and libraries (http://www.cpm.z80.de/download/cbasic86.zip) and (http://www.cpm.z80.de/download/cb86toys.zi)\n- masm, link, asm, exe2bin, hex2bin (local copies from https://github.com/microsoft/MS-DOS)\n- cmdtools (https://github.com/tsupplis/cpm86-cmdtools)\n- nasm (https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/nasm-2.15.05.tar.gz)\n- emu2 (https://github.com/dmsc/emu2)\n- tnylpo (https://gitlab.com/gbrein/tnylpo.git)\n\nClearing the directory is achieved by:\n```\n./clear_tools\n```\n\n### Download archive / offline rebuilds\n\nEvery file downloaded by `fetch_tools` (the Aztec, DR, CB86 and NASM archives,\nbut not the `git` checkouts) is cached under `archive/` instead of being deleted.\n\nThis keeps the build environment reproducible even if an upstream disappears:\n\n- If a download fails, `fetch_tools` falls back to the cached copy in `archive/`.\n- Set `ARCHIVE_FIRST=1` to rebuild entirely from `archive/` without touching the\n  network (e.g. offline, or to pin exact versions):\n  ```\n  ARCHIVE_FIRST=1 ./fetch_tools\n  ```\n- `clear_tools` will **not** remove the `archive/`, so a cleared tree can always\n  be rebuilt from the local cache.\n\n## Testing\n\nThe cpm86 tool is a cpm86 emulator for dos pulled with Aztec C.  We have reverse engineered it and patch it to fix a few bugs and add some new\nfeatures.  It should not be relied on fully as some bugs surely remain, but it can be experimented with and works for many programs.  For build\ntools DOS/CP/M-80 emulations and DOS/CP/M-80 cross compilations are far better options and proper emulation of CP/M-86 is the best option for\ntesting; PCE is a very good choice (http://www.hampa.ch/pce/).\n\nNote that the enhanced cpm86 emulator supports padding records with `EOF` instead of `NULL` which may make working with text files easier, but\nbecause this behavior does not match real CP/M-86, it's disabled by default and only enabled if you set `CPM86_EOF=1`, for example:\n```\nenv CPM86_EOF=1 cpm86 program.cmd\n```\n\nThis may be a next step: \n- automating pce, cpmtools\n- bootable/up-to-date CP/M-86 floppy ... \n\n## Docker image\n\nA Dockerfile is provided for this environment. To build the image from the docker directory, jusr run make, alternatively:\n```\ndocker build --rm=true -t cpm86:latest -f Dockerfile .\n```\n\nto user the created image, just ensure that the local path where the compilation happense ismounted properly:\n\n```\ndocker run -it --rm -h cpm86 -v `pwd`:/work -w /work cpm86 pcdev_rasm86 helloa.a86\ndocker run -it --rm -h cpm86 -v `pwd`:/work -w /work cpm86 aztec34_cc helloc.c\n```\nThe only difference on the command line happens with \\;\n```\npcdev_masm hellod \\; \n```\n... becomes ...\n```\ndocker run -it --rm -h cpm86 -v `pwd`:/work -w /work cpm86 pcdev_masm hellod '\\\\;' \n```\n\n## Using the tools\n\nFinally, a simple Makefile with a sample c, assembler for rasm86, assembler for asm86 is provided:\n```\n./build_demo\n```\n\n### Basic Programs\n\n```\ndrcbcpm_bc hellor.bas\ndrcbcpm_link hellor.cmd=hellor.o\npcdev_cmdinfo hellor.cmd\n```\n\n### C Programs\n\n```\naztec34_cc helloc.c\naztec34_sqz helloc.o\naztec34_link -o helloc.cmd helloc.o -lc86\npcdev_cmdinfo helloc.cmd\n```\nif the code is using ANSI syntax ...\n```\naztec42_cc helloc.c\naztec42_sqz helloc.o\naztec42_link -o helloc.cmd helloc.o -lc86\npcdev_cmdinfo helloc.cmd\n```\n\n#### C runtime startup\n\n`aztec34_link`/`aztec42_link` automatically prepend the matching C runtime\nstartup object, so the `$begin -\u003e Croot_ -\u003e main -\u003e exit` entry/exit code is\nalways present. The startup is selected from the C library you link against:\n\n| library            | target / model | startup     |\n|--------------------|----------------|-------------|\n| `-lc86`            | CP/M-86 small  | `begin86.o` |\n| `-lc`   / `-lclc`  | MS-DOS small   | `sbegin.o`  |\n| `-lcl`  / `-lcld`  | MS-DOS large   | `lbegin.o`  |\n\nThese startup objects are produced from the C libraries by `fetch_tools`\n(`src/fetch/buildstartups`). Without this, Aztec's single-pass `ln` only pulls\nthe startup from the library on demand, so a program that references no libc\nsymbol — e.g. `int main(void){ return 0; }` — would link with **no** startup and\ncrash on exit, and a program that references the startup indirectly (e.g.\n`exit()`) could fail to link (`Undefined symbol: _exit_`) unless the library was\nordered with `ord` or passed twice (`-lc86 -lc86`). Prepending the startup as a\ncommand-line object fixes all of these cases, so neither `ord` nor a doubled\nlibrary is needed. To restore the old behaviour set `AZTEC_NOSTARTUP=1`, or force\na specific startup with `AZTEC_STARTUP=\u003cobj-in-lib\u003e`.\n\n### Assembler Programs with rasm86\n```\npcdev_rasm86 helloa.a86 '$' pz sz\npcdev_linkcmd helloa '[$sz]'\npcdev_cmdinfo helloa.cmd\n```\n\n### Assembler Programs with asm86\n```\ncpm_asm86 hellob.a86\ncpm_gencmd hellob.h86\npcdev_cmdinfo hellob.cmd\n```\n\n### Assembler Programs with masm \n```\npcdev_masm hellod \\;\npcdev_link hellod \\;\npcdev_exe2bin hellod.exe\npcdev_bin2cmd hellod.bin hellod.cmd\n```\n\n### Assembler Programs with nasm \n```\nnasm hellon.asm -fbin -o hellon.bin \npcdev_bin2cmd hellon.bin hellon.cmd\n```\nYou can build a native unix/dos version of bin2cmd/cmdinfo from (https://github.com/tsupplis/cpm86-cmdtools)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsupplis%2Fcpm86-crossdev","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftsupplis%2Fcpm86-crossdev","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsupplis%2Fcpm86-crossdev/lists"}