6. Given that $A$ is a subset of $S=\{1,2,3,4,5,6\}$ with at least 2 elements, and $a, b$ are two distinct elements in $A$. When $A$ ranges over $S$ and $a, b$ range over $A$, the total sum of the product $ab$ is $M=$ $\qquad$
6.2800 .

For any $\{a, b\} \subset S$ (assuming $a<b$), the number of $A$ that satisfies $\{a, b\} \subseteq A \subseteq S$ is $2^{6-2}=2^{4}$. Therefore, the contribution of $\{a, b\}$ to the total sum $M$ is $a b \times 2^{4}$.
When $a$ takes all values of $1,2,3,4,5$ and $b$ takes all values of $2,3,4,5,6$, we have
$$
\begin{aligned}
M= & 2^{4}(1 \times 2+1 \times 3+1 \times 4+1 \times 5+1 \times 6+2 \times 3+ \\
& 2 \times 4+2 \times 5+2 \times 6+3 \times 4+3 \times 5+3 \times 6+ \\
& 4 \times 5+4 \times 6+5 \times 6) \\
= & 2^{4}(2+9+24+50+90)=2800 .
\end{aligned}
$$