File:  [HATARI the Atari ST Emulator] / hatari / tests / startup.s
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 9 08:58:37 2019 UTC (7 years, 3 months ago) by root
Branches: hatari, MAIN
CVS tags: hatari02210, hatari02200, HEAD
hatari 2.2.0

; Start up code for AHCC based test programs

.extern _main

	movea.l	4(SP),A5	; Get pointer to basepage
	move.l	$0C(A5),D0	; Text segment length
	add.l	$14(A5),D0	; Data segment length
	add.l	$1C(A5),D0	; BSS segment length
	add.l	#$2000,D0	; Space for the stack

	move.l	D0,D1
	add.l	A5,D1
	and.l	#-2,D1

	movea.l	D1,SP
	move.l	D0,-(SP)
	move.l	A5,-(SP)
	clr.w	-(SP)
	move.w	#$4A,-(SP)
	trap	#1		; Mshrink
	lea	12(SP),SP

	jsr	main

	move.w	D0,-(SP)
	move.w	#$4C,-(SP)
	trap	#1		; Pterm

.bss

.global errno
errno:	ds.l	1

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.