Let F-q be the finite field with q elements of characteristic p, F-qm be the extension of degree m > 1 and f (x) be a polynomial over F-qm. The maximum number of affine F-qm-rational points that a curve of the form y(q) - y = f(x) can have is q(m+1). We determine a necessary and sufficient condition for such a curve to achieve this maximum number. Then we study the weights of two-dimensional (2-D) cyclic codes. For this, we give a trace representation of the codes starting with the zeros of the dual 2-D cyclic code. This leads to a relation between the weights of codewords and a family of Artin-Schreier curves. We give a lower bound on the minimum distance for a large class of 2-D cyclic codes. Then we look at some special classes that are not covered by our main result and obtain similar minimum distance bounds. (C) 2003 Elsevier Inc. All rights reserved.