Here is a simple piece of Z80 code startup:
; Example for 32K system...
RAM_END equ 8400h ; Last byte is actually 83ffh.
; Start here on power up/reset.
;
org 0
RST0: ld sp,RAM_END ; Stack at the end of ram.
jp START
db 0, 0 ; Filler bytes...
RST8: db 0, 0, 0, 0, 0, 0, 0, 0
RST10H: db 0, 0, 0, 0, 0, 0, 0, 0
RST18H: db 0, 0, 0, 0, 0, 0, 0, 0
RST20H: db 0, 0, 0, 0, 0, 0, 0, 0
RST28H: db 0, 0, 0, 0, 0, 0, 0, 0
RST30H: db 0, 0, 0, 0, 0, 0, 0, 0
; Mode 1 Interrupt handler.
;
RST38H:
di ; Disable interrupts.
; Do interrupt stuff here.
ei ; Enable interrupts.
reti
db (0066H-$) dup (0)
; Non-maskable interrupt handler (NMI).
;
org 0066H
NMIINT:
; Do NMI stuff here.
retn
; Main monitor start,
;
START:
im 1 ; Interrupt mode 1.
ei ; Enable interrupts.
...
Notes:
Stack pointer is set to end of RAM (address is always even, 1 greater than actual last address as SP is always decremented just before push).
After setting up stack we jump to actual start (we skip all the area we may want to use for software restarts).
I've also added some default code for mode 1 interrupt and NMI handling.
At start I set interrupt mode and enable interrupts.
So, after this code I have the stack setup, basic interrupt setup etc. It's a good idea to go and look for code examples of actual Z80 monitors etc.