Z80 Computer - Part 6 The Stack & Subroutine Calls

In this part, I look at the concept of the stack and subroutine calls. After a quick overview of the Z80 registers, I start by explaining what a stack is and how it works. I look at the push and pop instructions and then show a small program. I step through it line by line, watching some of the registers and the area of memory where the stack resides. Next, I look at subroutine calls. I discuss the call and ret instructions and then look at another program. Finally, I show a third program that makes use of subroutine calls and I demonstrate this running on the hardware.