I want to use cp/m+ because it provides 61 KB of free memory. However it looks very uneasy. I was stopped even with "Hello world program". :( All known to me sources say that CP/M programs start at 100h.
I makes this code.
org $180
ld hl,message
loop
xor a
ld e,(hl)
or e
jr nz, cont
ld c,0
call 5 ;bdos
cont
push hl
ld c,2
call 5 ;bdos
pop hl
inc hl
jr loop
message db "Hello CP/M",13,10,0
It works but starts at 180h! It works wrong with ORG 100h. :( Is Amstrad cp/m 3 so different? It is also impossible to use just RET or RST 0 to end the program. Is there any information about the specific details of Amstrad CP/M+? A lot of thanks in advance.
BTW Happy New Year to All! :)
Do you have an AMSDOS header or not?
I can't remember if you need an AMSDOS header for the .com file.
Quote from: litwr on 18:04, 31 December 15
Is there any information about the specific details of Amstrad CP/M+? A lot of thanks in advance.
I have no experience of CP/M programming at all, but there are two books which could be of use to you if you can find them (links to CPCWiki below):
The Amstrad CP/M Plus (http://www.cpcwiki.eu/index.php/The_Amstrad_CP/M_Plus)
The CP/M Plus Handbook: Operator's and Programmer's Guide for the Amstrad CPC6128 and PCW8256 (http://www.cpcwiki.eu/index.php/The_CP/M_Plus_Handbook:_Operator's_and_Programmer's_Guide_for_the_Amstrad_CPC6128_and_PCW8256)
They both contain a lot of useful information for programmers.
The Amstrad CP/M Plus is the easier of the two to find.
Standard CP/M COM files start always at 0100h, and have no headers at all (with the exception of CP/M 3 COM files with attached RSX, or PRL files).
What assembler are you using? I suspect you are using an assembler for AMSDOS.
For Z80 mnemonics I recommend to you Z80ASMUK (also known as ZSM, available in my website), M80 from Micro$oft, or ZMAC.
For 8080 mnemonics you can use ASM, MAC or RMAC, all from Digital Research, already in your system disks.
You can write your program as:
org 0100h
ld c,9
ld de,msg
jp 5
msg:
defb 'Hello CP/M', 13, 10, '$'
Thanks to all! Yes it was AMSDOS header - it causes the problem. It was created automatically by iDSK so I am using cpcxfs now.
When I was writing COM files from MAXAM I'm pretty sure a:
write"filename.com"
would produce a COM file without the header. It should be the same with the Winape Assembler if you use it. Just locate your program to &100 and it should be fine.