;
; This file and its contents are supplied under the terms of the
; Mozilla Public License (MPL) version 2.0.  You may only use this
; file in accordance with the terms of version 2.0 of the MPL.
;
; A full copy of the text of the MPL should have accompanied this
; source.  A copy of the MPL is also available via the Internet at
; https://www.mozilla.org/en-CA/MPL/2.0.
;
; This Source Code Form is "Incompatible With Secondary Licenses",
; as defined by the Mozilla Public License, v. 2.0.
;
; This file creates a big stack and uses it.
;
; (C) Copyright Rich Teer 1990, 2023, 2026.
;

	globl	_big_stack
	globl	_stack
	globl	_exit

_big_stack:
	MOVE.L	A7,A5				; Copy current stack pointer to A5
	MOVE.L	#_stack,A6			; Get base address of new stack
	MOVE.L	(A6),A7				; and move it to the Stack Pointer
	MOVE.L	#_exit,-(A7)		; Push address of exit function on to stack
	MOVE.L	#_exit,-(A7)		; Push any old shit onto stack for a6
	MOVE.L	A7,A6				; Set up frame pointer
	MOVE.L	(A5),-(A7)			; Copy return address to the new stack
	RTS							; and return
