A two-dimensional PIC code aimed at the investigation of electron-cycl
otron beam instabilities in gyrotrons and their effects on the beam qu
ality is presented. The code is based on recently developed techniques
for handling charge conservation and open boundaries. It has been imp
lemented on the massively parallel computer CRAY T3D. First results sh
ow an electromagnetic backward-wave instability periodically growing a
nd decaying to energy levels close to those obtained from the electros
tatic Bernstein wave instability. On the average, the resulting beam d
egradation is 3 to 4 times larger than that predicted by electrostatic
models.