| Preamble for APM .mob files

_cbeg:	.long	0xfdcc0002		| extension magic number
_dpos:	.long	_cend-_cbeg		| offset to static data
_dlen:	.long	_dend-_dbeg		| length of static data
_inoff:	.long	_init-_cbeg		| offset to initialisation code

_reset:	lea	[_cbeg,.a4],.a0		| base of code
	addl	[_dpos,.a4],.a0		| offset may be > 32K
	movl	.a4,.a1			| destination of own data
	movl	[_dlen,.a4],.d0		| length in bytes
	asrl	#2,.d0			| length in longs
	beqs	2$			| nothing to move
	subql	#1,.d0			| adjust count for dbra
1$:	movl	.a0@+,.a1@+		| move it
	dbra	.d0,1$			| finished ?
2$:	lea	[_cbeg,.a4],.a0		| base of code
	addl	[_inoff,.a4],.a0	| point to _init
	jmp	.a0@			| do initialisation and return
	
_dmain:	rts				| dummy in case there's no _main
