Number of solutions $X$ to $AX=XB$ in $\mathbb F_2$ It is a well-known theorem that in an arbitrary field $F$, if $A$ is an $m\times m$ square matrix and $B$ is an $n\times n$ square matrix, then there is a unique $m\times n$ solution $X$ to the equation 
$$AX=XB$$
if and only if $A$ and $B$ share no eigenvalues.
My question is this: what can be said about the number of solutions $X\in \mathbb F_2$ to the above equation? Is the number of nonzero solutions equal to the number of common eigenvalues? If so, how can one prove this?

$X$ maps each eigenvector of $B$ to either $0$ or an eigenvector of the same eigenvalue of $A$, since if $Bv = \lambda v$, $AX v = X B v = \lambda X v$.
Let's suppose for simplicity that $B$ is diagonalizable, with a basis $b_j$ of eigenvectors corresponding to eigenvalues $\lambda_j$ that may or may not be eigenvalues of $A$.
For each $j$, we can choose $X b_j$ to be any member of the eigenspace of $A$ for $\lambda_j$, and once we have done that we have specified a solution $X$.  Thus the number of solutions for $X$ is the product over $j$ of the cardinalities of the eigenspaces of $A$ for $\lambda_j$ (note that this is $1$ if $\lambda_j$ is not an eigenvalue of $A$).
