This shows you the differences between two versions of the page.
— |
platform:cpm [2017/04/27 11:32] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ======= CP/M Hints And Tools ======= | ||
+ | |||
+ | {{platform: | ||
+ | |||
+ | |||
+ | The CP/M platform is a surprisingly useful port when used in combination with [[http:// | ||
+ | |||
+ | ZXCC is trivial to extend, and you can easily permit access to serial ports, host system calls, advanced paging techniques etc testing out many areas of your code. | ||
+ | |||
+ | ===== Quick Start ====== | ||
+ | |||
+ | < | ||
+ | zcc +cpm -lm -o adventure.com adv_a.c | ||
+ | </ | ||
+ | |||
+ | Without specifying a '' | ||
+ | |||
+ | < | ||
+ | zxcc a.com | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== Library Support ===== | ||
+ | |||
+ | Besides the standard library routines, the **'' | ||
+ | |||
+ | ===== Optimization ===== | ||
+ | |||
+ | There are a couple of #pragma commands which might be used to cut down the size of the resultant executable: | ||
+ | |||
+ | **#pragma output nostreams** | ||
+ | |||
+ | **#pragma output nofileio** | ||
+ | |||
+ | **#pragma output noprotectmsdos** - strip the [[platform: | ||
+ | |||
+ | **#pragma output noredir** | ||
+ | |||
+ | **#pragma output nogfxglobals** | ||
+ | |||
+ | ===== Hardware specific extensions ===== | ||
+ | |||
+ | Some hardware specific functions have been adapted to run on both native platorm and generic CP/M environment (the ' | ||
+ | |||
+ | |||
+ | * **-laussie** ([[platform: | ||
+ | * **-lcpccpm** ([[platform: | ||
+ | * **-lc128cpm**, | ||
+ | * **-leinstein** ([[platform: | ||
+ | * **-lpx4** ([[platform: | ||
+ | * **-lmicrobee** ([[platform: | ||
+ | * **-lnbcpm** ([[platform: | ||
+ | * **-ltiki100**, | ||
+ | * **-ltrs80cpm**, | ||
+ | * **-startup=3 -lzxcpm** ([[platform: | ||
+ | * **-lgfxzcn** ([[platform: | ||
+ | * (untested) **-lgfxep**, | ||
+ | * (untested) **-lgfx9001**, | ||
+ | |||
+ | |||
+ | NOTE: for [[platform: | ||
+ | |||
+ | ===== Program boot protection ===== | ||
+ | |||
+ | The code generated for CP/M based computers is protecting by default the MS-DOS environment. | ||
+ | |||
+ | In a similar way we can extend the protection to the 8080 based systems (which would crash otherwise). | ||
+ | |||
+ | " | ||
+ | |||
+ | |||
+ | start: | ||
+ | IF !DEFINED_noprotectmsdos | ||
+ | defb $eb, | ||
+ | ex de,hl | ||
+ | jp ckz80-start+$100 | ||
+ | defb $b4, | ||
+ | defb $ba | ||
+ | defw dosmessage ; | ||
+ | defb $cd, | ||
+ | defb $cd, | ||
+ | |||
+ | dosmessage: | ||
+ | defm " | ||
+ | defb 13, | ||
+ | |||
+ | ckz80: | ||
+ | ld a, | ||
+ | inc a ; make it overflow ie. 10000000 | ||
+ | jp pe, | ||
+ | ld de, | ||
+ | ld c,9 | ||
+ | jp 5 ; BDOS | ||
+ | |||
+ | z80message: | ||
+ | defm " | ||
+ | defb 13, | ||
+ | |||
+ | begin: | ||
+ | ENDIF | ||
+ | |||
+ | |||
+ | ===== CP/M related Links ===== | ||
+ | |||
+ | http:// | ||
+ | |||
+ | http:// | ||
+ | |||