mirror of
https://github.com/KarolS/millfork.git
synced 2024-11-19 13:31:23 +00:00
Preliminary CP/M support
This commit is contained in:
parent
2046f94b55
commit
f929e396df
1
.gitignore
vendored
1
.gitignore
vendored
@ -35,6 +35,7 @@ examples/lunix/
|
||||
*.inf
|
||||
*.tap
|
||||
*.d88
|
||||
*.com
|
||||
HELLO
|
||||
|
||||
|
||||
|
@ -39,6 +39,8 @@ For binary releases, see: https://github.com/KarolS/millfork/releases
|
||||
|
||||
* NEC PC-88
|
||||
|
||||
* CP/M
|
||||
|
||||
* inline assembly
|
||||
|
||||
* simple macros
|
||||
|
@ -61,6 +61,10 @@ Read [the Apple 2 programming guide](./apple2-programming-guide.md) for more inf
|
||||
|
||||
* `zxspectrum_8080` – Sinclair ZX Spectrum 48k, using only Intel 8080 instructions
|
||||
|
||||
* `cpm` – CP/M on Intel 8080
|
||||
|
||||
* `cpm_z80` – CP/M on Z80
|
||||
|
||||
The primary and most tested platform is Commodore 64.
|
||||
|
||||
Currently, targets that assume that the program will be loaded from disk or tape are better tested.
|
||||
|
25
include/cpm.ini
Normal file
25
include/cpm.ini
Normal file
@ -0,0 +1,25 @@
|
||||
;a single-load CP/M program
|
||||
[compilation]
|
||||
arch=i8080
|
||||
encoding=ascii
|
||||
modules=default_panic,stdlib,cpm_bdos
|
||||
|
||||
[allocation]
|
||||
segment_default_start=$100
|
||||
segment_default_datastart=after_code
|
||||
segment_default_end=$ffff
|
||||
; TODO: actual end?
|
||||
|
||||
[define]
|
||||
CPM=1
|
||||
WIDESCREEN=1
|
||||
KEYBOARD=1
|
||||
JOYSTICKS=0
|
||||
HAS_BITMAP_MODE=0
|
||||
|
||||
[output]
|
||||
style=single
|
||||
format=allocated
|
||||
extension=com
|
||||
|
||||
|
62
include/cpm_bdos.mfk
Normal file
62
include/cpm_bdos.mfk
Normal file
@ -0,0 +1,62 @@
|
||||
|
||||
inline asm void exit() {
|
||||
? ld c, 0
|
||||
call 5
|
||||
? ret
|
||||
}
|
||||
inline asm void putchar (byte e) {
|
||||
? ld c, 2
|
||||
call 5
|
||||
? ret
|
||||
}
|
||||
|
||||
inline asm byte getchar() {
|
||||
? ld c, 1
|
||||
call 5
|
||||
? ret
|
||||
}
|
||||
|
||||
#if 0
|
||||
inline asm void putstr_cpm(pointer de) {
|
||||
? ld c, 9
|
||||
call 5
|
||||
? ret
|
||||
}
|
||||
#endif
|
||||
|
||||
inline asm byte readychar() {
|
||||
? ld c, 11
|
||||
call 5
|
||||
? ret
|
||||
}
|
||||
|
||||
inline asm word cpm_version() {
|
||||
? ld c, 12
|
||||
call 5
|
||||
? ret
|
||||
}
|
||||
inline asm void reset_disk_system() {
|
||||
? ld c, 13
|
||||
call 5
|
||||
? ret
|
||||
}
|
||||
inline asm byte current_disk() {
|
||||
? ld c,25
|
||||
call 5
|
||||
? ret
|
||||
}
|
||||
|
||||
#if 0
|
||||
inline asm word console_mode(word de) {
|
||||
? ld c, 109
|
||||
call 5
|
||||
? ret
|
||||
}
|
||||
inline word get_console_mode() {
|
||||
return console_mode($ffff)
|
||||
}
|
||||
inline asm void set_console_mode(word de) {
|
||||
console_mode(mode)
|
||||
}
|
||||
#endif
|
||||
|
25
include/cpm_z80.ini
Normal file
25
include/cpm_z80.ini
Normal file
@ -0,0 +1,25 @@
|
||||
;a single-load CP/M program for Z80-based machines
|
||||
[compilation]
|
||||
arch=z80
|
||||
encoding=ascii
|
||||
modules=default_panic,stdlib,cpm_bdos
|
||||
|
||||
[allocation]
|
||||
segment_default_start=$100
|
||||
segment_default_datastart=after_code
|
||||
segment_default_end=$ffff
|
||||
; TODO: actual end?
|
||||
|
||||
[define]
|
||||
CPM=1
|
||||
WIDESCREEN=1
|
||||
KEYBOARD=1
|
||||
JOYSTICKS=0
|
||||
HAS_BITMAP_MODE=0
|
||||
|
||||
[output]
|
||||
style=single
|
||||
format=allocated
|
||||
extension=com
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user