
;Entry which sets stack frame pointer and allocates up to 127 bytes of
;local space, which is passed in accum.

	PUBLIC	?nenss
?nenss:	POP	DE	;get RET addr
	PUSH	IX	;save stack frame pointer
	LD	IX,-2	;set new stack frame pointer
	ADD	IX,SP
	EXTS		;extend accum. into HL to get amount of local space
	ADD	HL,SP
	LD	SP,HL	;reserve local space
	EX	DE,HL	;retrieve return address
	JP	(HL)


;Exit which restores stack frame pointer
;and deallocates local space <= 127 bytes.
;This must preserve HL and the Z flag.

	PUBLIC	?nexss
?nexss:	EX	DE,HL	;save function's return value (if any)
	EXTS		;extend accum. into HL to get amount of local space
	ADD	HL,SP
	LD	SP,HL	;deallocate local space
	EX	DE,HL	;restore return value
	POP	IX	;  and stack frame pointer
	RET

