pro medl,cl,out,value
;
; This procedure creates a 1024x1024 byte array (out) from  the medium-l
; list (cl).   The array is set to value at each address in the address lists
; if value is 0, the rest of the array is set to 255; otherwise the rest of
; the array is set to zero.

out = bytarr(1024,1024)
out(0:*) = 0
if (value eq 0) then out(0:*) = 255
l=n_elements(cl)
j = 0L
total_errs = 0
line_errs = 0
nal = cl(2)
print,nal
table_start = '88007000'XL
for i=0,nal-1  do begin
  nextal = (i)*10+22
  ix = long(cl(nextal) and 65535) + long(cl(nextal+1) * 65536L)
  ixr = ix - table_start
  nent = cl(nextal + 2)
  ixre = ixr + nent*2 - 1
;  print,"New List"
  print, nextal,ix,ixr,table_start,nent,ixre,format='(i6,5z10)'
  for j = ixr,ixre,2 do begin
    add = long(cl(j) and 65535) + long(cl(j+1) * 65535L)
     r = add / 1024
     c = add mod 1024
    ; print,r,c,format
    out(add) = value
  end
end
return
end
