A novel sourceline voltage compensation circuit for program operation in embedded flash memory is presented. With the sourceline voltage compensation circuit, the charge pump can modulate the output voltage according to the number of cells to be programmed with data "0". So the IR drop on the sourceline decoding path is compensated, and a stable sourceline voltage can be obtained. In order to reduce the power dissipation in program operation, a bit-inversion program circuit is adopted. By using the bit-inversion program circuit, the cells programmed to data "0" are limited to half of the bits of a write data word, thus power dissipation in program operation is greatly reduced. A 1.8-V 8 64-kbits embedded NOR flash memory employing the two circuits has been integrated using a GSMC 0.18-m 4-poly 4-metal CMOS process.