  We prove a stochastic maximum principle for a control problem where the state
equation is delayed both in the state and in the control, and also the final
cost functional may depend on the past trajectories. The adjoint equations turn
out to be a new form of linear anticipated backward stochastic differential
equations (ABSDEs in the following), and we prove a direct formula to solve
these equations.
