CP/M BDOS Calls

Discussions related to using the integrated assembler
snake
Posts: 1
Joined: Thu 07 Sep 2023, 23:04

CP/M BDOS Calls

Post by snake »

10 REM BBC Basic for CP/M BDOS write an "A" to the screen
20 DIM code &100
30 [
40 OPT 0 ; Don't display assembled code
50 LD DE,65 ; Load A character into DE
60 LD C,&02 ; CALL BDOS function 2 (C_WRITE) - Console output
70 CALL &05 ; CALL BDOS
80 LD C,&100 ; BDOS function 0 (P_TERMCPM) - System Reset
90 CALL &05 ; CALL BDOS
100 RET
110 ]

This crashes at CALL &05, same thing if you use JP &05

Suggestions?
Hated Moron

Re: CP/M BDOS Calls

Post by Hated Moron »

snake wrote: Thu 07 Sep 2023, 23:07 This crashes at CALL &05, same thing if you use JP &05
Is this a real Z80 CP/M machine, or an emulation running on a PC or something? What version of CP/M is it?

If it's emulating CP/M properly, you should be able to make BDOS calls.
Hated Moron

Re: CP/M BDOS Calls

Post by Hated Moron »

On 08/09/2023 12:30, J.G.Harston wrote (cross-posted from the Discussion Group):
Where have you assembled it? Where is the P%=...?

Code: Select all

20 DIM code &100
30 P%=code
40 [OPT 0 ; Don't display assembled code
Good spot, but if that was the cause I would expect it to crash when assembled (overwriting low memory), not when run.