;;;-*-Midas-*-

title UPTIME - Chaosnet UPTIME server.

a=:1
b=:2
c=:3

neti=:15
neto=:16

quit=:.logout 1,

.insrt dsk:system;chsdef >

.vector pkt(%cpmxw)

loc 42
	jsr tsint
loc 100

go:	.close 1,
	.suset [.smask,,[%piioc]]
	.call [	setz
		sixbit /chaoso/
		movei neti
		setzi neto]
	 quit
	movei a,%colsn
	dpb a,[pkt+$cpkop]
	move a,[.byte 8 ? "U ? "P ? "T ? "I]
	movem a,pkt+%cpkdt
	move a,[.byte 8 ? "M ? "E]
	movem a,pkt+%cpkdt+1
	movei a,6
	dpb a,[pkt+$cpknb]
	.call pktout
	 quit
	movei a,%cslsn
	movei b,30.*30.
	.call [	setz
		sixbit /netblk/
		movei neto
		move a
		move b
		setzm c]
	 quit
	caie c,%csrfc
	 quit
	movei a,%coans
	dpb a,[pkt+$cpkop]
	.rdtime a,
	lsh a,1
	move b,[440800,,pkt+%cpkdt]
	idpb a,b
repeat 3,[
	lsh a,-8
	idpb a,b
]
	movei a,4
	dpb a,[pkt+$cpknb]
	.call pktout
	 quit
	.call [	setz
		sixbit /finish/
		setzi neto]
	 quit
	quit

tsint:	0
	0
	quit

pktout:	setz
	sixbit /pktiot/
	movei neto
	setzi pkt

end go
