News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

Problems with CP/M+

Started by litwr, 18:04, 31 December 15

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

litwr

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! :)

arnoldemu

Do you have an AMSDOS header or not?
I can't remember if you need an AMSDOS header for the .com file.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Nich

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
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.

FloppySoftware

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, '$'

floppysoftware.es < NEW URL!!!
cpm-connections.blogspot.com.es

litwr

Thanks to all!  Yes it was AMSDOS header - it causes the problem.  It was created automatically by iDSK so I am using cpcxfs now.

AMSDOS

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.
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

Powered by SMFPacks Menu Editor Mod