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?
CP/M BDOS Calls
Re: CP/M BDOS Calls
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.
Re: CP/M BDOS Calls
On 08/09/2023 12:30, J.G.Harston wrote (cross-posted from the Discussion Group):
Good spot, but if that was the cause I would expect it to crash when assembled (overwriting low memory), not when run.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