procedure add(s1,s2,carry)
   local size, sum
   /carry := 0	# default carry
   if *s1 > *s2 then s1 :=: s2
   size := *s2
   if size <= segsize then return s1 + s2 + carry
   s1 := right(s1,size,"0")
   sum := right(s1,segsize) + right(s2,segsize) + carry
   return add(left(s1,size - segsize),
      left(s2,size - segsize),sum / base) ||
      right(sum % base,segsize,"0")
end
