For a given algebraic variety $V$ defined over a finite field and a very ample divisor $D$ on $V$, we give a construction of a linear code $C_{V,D}$. If $V$ is a curve, we recover the algebraic geometric Goppa codes. We are interested here in the case where $V$ is an algebraic surface, and we give in some cases the parameters of such corresponding codes. We compare these parameters to the Singleton bound and to those of Goppa codes. In order to compute these parameters, we use the Riemann-Roch theorem for surfaces.