Below you will find pages that utilize the taxonomy term “CP/M”
Msx Assembly 101: 04 Stack
Stack in cartridges
According to MSX Technical Handbook, a cartridge software should initialize
stack pointer before using the stack. The common practice is to put 0xF380
into sp
register (see
this)
and remember that stack grows downwards.
It means that any cartridge program, which uses the stack, should near its
beginning do something like ld sp, 0f380h
.
Stack in CP/M programs
When a CP/M program starts execution, sp
points to the stack of 16 bytes.
Since any subroutine call puts a return address on the stack, you can do no
more than 7 nested calls if you do not use stack and do not call BDOS
routines (2 bytes are already consumed by the CP/M return address, used when
your program does final ret
). Due to this, it is a good practice to use own
stack space in CP/M program. Moreover, CP/M expects that the program preserves
stack pointer. It all means that the following should be done at the start of a
program:
Msx Assembly 101: 03 Using YAZE
Recently I found myself spending days (it will be one month with two weeks break in the middle) in a place, where I have an internet connection but not a computer. I do have an iPad with a keyboard, though, and it has SSH- and VNC-clients. Unfortunately, there are too many hops to home and too many hoops to jump (including port-forwarding over reverse SSH tunnel) to use VNC comfortably. This means that I cannot use MSX emulators. However, I wanted to continue my experiments with Z80 programming – over SSH.