The investigation of many interesting, complex phenomena in a free-electron laser (FEL) requires the use of numerical computer codes. In this paper we describe the extension of one such code (TDA), which in its original form could only be used to study free-electron laser amplifiers, to include resonator configurations. For convenience of interpretation of results obtained with this code, we have implemented the option of a decomposition of the radiation field into Gauss-Laguerre functions. Also the electron beam format at the undulator entrance can be chosen more freely than in the original version of TDA, which permits proper matching of the electrons to the undulator field for the case of a planar undulator. Exploratory simulations have been performed with the extended code. Some typical results, for instance for a planar undulator geometry with an on-axis aperture in one of the cavity mirrors, are presented.