I know that TeX does not update the page number until it can decide where to break a page. And when I write
\number\count0 \number\count0 \number\count0 % ...
to fill two pages, the second page of the output begins with
1 1 2 2 2 ...
Therefore, if something appears on the top of a page, then I can't get the correct page number for it. In LaTeX we have
\pageref as a workaround. But is there a way to do this in plain TeX?