Construction and decoding of a class of algebraic geometry codes