the first law says that the change in internal energy of a system is given by:
δE = δq + δw
where δE is the i change in internal energy,
δq is the amount of thermal energy added to the system from the surroundings
δw is the l work done *on* the system *by* the surroundings.
For a system only undergoing expansion work,
δw = -pδV, so:
δE = δq - p δV
when δV = 0, then δe=δq