9.7. A diagonal of eight squares on a chessboard is called a "fence". A rook starts from a square outside the fence on the chessboard and moves, satisfying the following conditions:
(1) It stays on any square of the chessboard at most once;
(2) It never stays on a square of the fence.

Find the maximum number of times the rook can cross the fence.
9.7.47 times.

Let the square at the $i$-th row and $j$-th column be denoted as $(i, j)$. Suppose the eight squares occupied by the fence are $(i, i) (i=1,2, \cdots, 8)$. The non-fence squares are divided into four categories $A, B, C, D$:
$$
\begin{aligned}
A= & \{(i, j) \mid 2 \leqslant j+1 \leqslant i \leqslant 4\} \cup \\
& \{(i, j) \mid 5 \leqslant j \leqslant i-1 \leqslant 7\}, \\
B= & \{(i, j) \mid 2 \leqslant i+1 \leqslant j \leqslant 4\} \cup \\
& \{(i, j) \mid 5 \leqslant i \leqslant j-1 \leqslant 7\}, \\
C= & \{(i, j) \mid 5 \leqslant i \leqslant 8,1 \leqslant j \leqslant 4\}, \\
D= & \{(i, j) \mid 1 \leqslant i \leqslant 4,5 \leqslant j \leqslant 8\} .
\end{aligned}
$$

Since the car crosses the fence at least once in either an $A$ or $B$ square before and after each crossing, each square in $A$ or $B$ can contribute to at most two crossings. Since there are 24 squares in $A$ and $B$, the maximum number of crossings is 48.

We call the crossing between $A$ and $D$ squares an $AD$ type, and the crossing between $B$ and $C$ squares a $BC$ type.

If exactly 48 crossings are completed, then each $A$ or $B$ square corresponds to two crossings. This means that each stop before and after a crossing is exactly once in a $C$ or $D$ square, and each stop in an $A(B)$ square is followed by an $AD(BC)$ type crossing. Since it is impossible to reach a $D(C)$ square from a $C(D)$ square without crossing, the car can only complete one type of crossing, hence at most 24 crossings. This is a contradiction.
Therefore, the car can complete at most 47 crossings.
An example is as follows:
$$
\begin{array}{l}
(8,2) \xrightarrow{1}(1,2) \xrightarrow{2}(7,2) \xrightarrow{3}(7,8) \xrightarrow{4} \\
(7,3) \xrightarrow{5}(1,3) \xrightarrow{6}(8,3) \xrightarrow{7}(2,3) \xrightarrow{8} \\
(6,3) \xrightarrow{9}(6,8) \xrightarrow{10}(6,2) \xrightarrow{11}(6,7) \xrightarrow{12} \\
(6,4) \xrightarrow{13}(1,4) \xrightarrow{14}(8,4) \xrightarrow{15}(2,4) \xrightarrow{16}
\end{array}
$$
$$
\begin{array}{l}
(7,4) \xrightarrow{17}(3,4) \xrightarrow{18}(5,4) \xrightarrow{19}(5,8) \xrightarrow{20} \\
(5,3) \xrightarrow{21}(5,7) \xrightarrow{22}(5,2) \xrightarrow{23}(5,6) \xrightarrow{24} \\
(8,6) \xrightarrow{25}(1,6) \xrightarrow{26}(7,6) \xrightarrow{27}(2,6) \xrightarrow{28} \\
(2,1) \xrightarrow{29}(2,7) \xrightarrow{30}(8,7) \xrightarrow{31}(3,7) \xrightarrow{32} \\
(3,1) \xrightarrow{33}(3,6) \xrightarrow{34}(3,2) \xrightarrow{35}(3,5) \xrightarrow{36} \\
(8,5) \xrightarrow{37}(2,5) \xrightarrow{38}(7,5) \xrightarrow{39}(1,5) \xrightarrow{40} \\
(6,5) \xrightarrow{41}(4,5) \xrightarrow{42}(4,1) \xrightarrow{43}(4,6) \xrightarrow{44} \\
(4,2) \xrightarrow{45}(4,7) \xrightarrow{46}(4,3) \xrightarrow{47}(4,8) .
\end{array}
$$