	.globl	mesg
	sys	open; f.index; 0
	mov	r0,ri
	clr	r1			/keeps track of used slots
	clr	r2			/keeps track of empty slots
	clr	r3			/keeps track of current slot
					/offset
0:
	jsr	r5,mesg
	<\n\n\nINDEX(REAL,EXPECTED)>
	<   JOB NO.    FLAGS    FILE>
	<  OFFSET  LENGTH\0>
	.even
0:
	mov	ri,r0
	sys	read; j.index; 12.	/read index entry
	tst	r0
	bne	1f
	jmp	9f
1:
	jsr	r5,mesg			/skip to next line
	<\n     \0>
	.even
	clr	temp
	mov	r3,temp+2
	mov	$5,r0
	jsr	r5,itoa			/print real index offset
	temp
	jsr	r5,mesg
	<    \0>
	.even
	tst	j.number+2
	bne	1f
	tst	j.number
	bne	1f
	inc	r2			/inc empty slot count
	add	$12.,r3
	jsr	r5,mesg
	<EMPTY\0>
	.even
	br	0b
1:
	clr	temp
	mov	j.index+2,temp+2
	mov	$5,r0
	jsr	r5,itoa			/print expected offset
	temp
	jsr	r5,mesg
	<   \0>
	.even
	mov	j.number,temp
	bic	$177776,temp
	mov	j.number+2,temp+2
	mov	$5,r0
	jsr	r5,itoa			/print job no.
	temp
	bitb	$2,j.number		/"-S" no.?
	beq	1f
	jsr	r5,mesg
	<-S   \0>
	.even
	br	2f
1:
	jsr	r5,mesg
	<     \0>
	.even
2:
	mov	$"00,flags
	mov	$"00,flags+2
	mov	$"00,flags+4
	mov	$"00,flags+6
	bitb	$200,j.number+1
	beq	1f
	movb	$'1,flags
1:
	bitb	$100,j.number+1
	beq	1f
	movb	$'1,flags+1
1:
	bitb	$40,j.number+1
	beq	1f
	movb	$'1,flags+2
1:
	bitb	$20,j.number+1
	beq	1f
	movb	$'1,flags+3
1:
	bitb	$10,j.number+1
	beq	1f
	movb	$'1,flags+4
1:
	bitb	$4,j.number+1
	beq	1f
	movb	$'1,flags+5
1:
	bitb	$2,j.number+1
	beq	1f
	movb	$'1,flags+6
1:
	bitb	$1,j.number+1
	beq	1f
	movb	$'1,flags+7
1:
	mov	$1,r0
	sys	write; flags; 8.	/print flags
	jsr	r5,mesg
	<     \0>
	.e