proc write_cpt
	filen	writecpt.icn
	local	0,001000,output
	local	1,001000,carpet
	local	2,000020,min
	local	3,000020,max
	local	4,000020,i
	local	5,000020,j
	local	6,000020,width
	local	7,000020,height
	local	8,000000,matrix_width
	local	9,000000,matrix_height
	local	10,000000,write
	local	11,000000,write_matrix
	con	0,010000,6,167,151,144,164,150,075
	con	1,010000,8,040,150,145,151,147,150,164,075
	declend
	line	28
	colm	11
	mark	L1
	pnull
	var	6
	var	8
	var	1
	line	31
	colm	25
	invoke	1
	line	31
	colm	10
	asgn
	unmark
lab L1
	mark	L2
	pnull
	var	7
	var	9
	var	1
	line	32
	colm	27
	invoke	1
	line	32
	colm	11
	asgn
	unmark
lab L2
	mark	L3
	var	10
	var	0
	str	0
	var	6
	str	1
	var	7
	line	34
	colm	9
	invoke	5
	unmark
lab L3
	mark	L4
	var	11
	var	0
	var	1
	line	36
	colm	16
	invoke	2
	unmark
lab L4
	mark	L5
	mark	L6
	pnull
	line	38
	colm	4
	pret
lab L6
	pfail
	unmark
lab L5
	pnull
	line	40
	colm	1
	pfail
	end
