How to map file and rank to a square number in TSCP? How can I map file and rank numbers (0-7) to a square number in Tom Kerrigan's Simple Chess Program?

I know how to do the conversion from square number to rank and file, but not the other way around.
The conversions from square to row and column are defined in defs.h as:

#define ROW(x) (x &gt;&gt; 3)
#define COL(x) (x &amp; 7)


so you can apply the inverse to generate the square number:

(row &lt;&lt; 3) | col