.ifdef RKBOOT
BOOTTYPE=0
.else
.error "Specify the boot type"
.endif

.org 0
br start
.byte 0x7f, 'S', 'T'
.ascii "BOOTSTOS"
.even
start:
	mov $1, r1
	clr r0
	div $12, r0
	ash $4, r0
	bis r1, r0
	mov $0177412, r1
	mov r0, (r1)
	mov $02000, -(r1)
	mov $-1024, -(r1)
	mov $5, -(r1)
loop:
	tstb (r1)
	bpl loop
	mov $02000, r1
	mov $02000, sp
	mov $0, -(sp)
	mov $BOOTTYPE, -(sp)
	jmp (r1)
