	title	Hoster - HOST bootstrap
	subttl	Phil Budne@DEC - March 16, 1984
.decsave

a==1
b==2
c==3
d==4

hlptxt:	asciz	`
[HELP FOR HOSTER]

Rename a copy of HOSTER.EXE to be NAME.EXE; Running NAME.EXE has the
effect of invoking HOST.EXE with "HOST NAME" in the RSCAN buffer.

hint:
Use the EXEC "set program NAME keep continue" command.
`

buffer:	ascii	"HOST "
	block	2

start:	jfcl
	RESET

	GETNM
	camn	a, [sixbit 'HOSTER']
	 jrst	givhlp
	move	b, a
	move	c, [440700,,buffer+1]
loop:	setz	a,
	lshc	a, 6
	addi	a, 40
	idpb	a, c
	jumpn	b, loop
	movei	a, ^m
	idpb	a, c
	movei	a, ^j
	idpb	a, c
	setz	a,
	idpb	a, c

	movsi	a, (gj%sht\gj%old)
	hrroi	b, [asciz 'sys:host.exe']
	GTJFN
	 jrst	lose
	movem	a, 17

	hrroi	a, buffer
	RSCAN
	 jrst	lose

	seto	a,		;Setup for PMAP
	hrlzi	b, .FHSLF
	move	c,[PM%CNT\1000]
	move	16, [bltcod,,acnum]
	blt	16, acend
	jrst	acnum

acnum==4
bltcod:	offset	acnum-.
	PMAP
	hrrz	a, 17
	hrli	a, .FHSLF
	GET
	movei	a, .FHSLF
	GEVEC
acend:	jrst	(b)
	offset	0

givhlp:	hrroi	a, hlptxt
	PSOUT
	jrst	dead

lose:	movei	a, "?
	BOUT
	movei	a, .PRIOU
	hlroi	b, .FHSLF
	setz	c,
	ERSTR
	 trna
	  nop
dead:	HALTF
	jrst	dead

	end	start
