We have used a dynamic density functional theory ͑DDFT͒ for polymeric systems, to simulate the formation of micro phases in a melt of an asymmetric block copolymer, A n B m ( f A ϭ1/3), both in the bulk and in a thin film. In the DDFT model a polymer is represented as a chain of springs and beads. A spring mimics the stretching behavior of a chain fragment and the spring constant is calculated with the Gaussian chain approximation. Simulations were always started from a homogeneous system. We have mainly investigated the final morphology, adopted by the system. First, we have studied the bulk behavior. The diblock copolymer forms a hexagonal packed array of A-rich cylinders, embedded in a B-rich matrix. Film calculations have been done by confining a polymer melt in a slit. Both the slit width and surface-polymer interactions were varied. With the outcomes a phase diagram for confined films has been constructed. Various phases are predicted: parallel cylinders (C ʈ ), perpendicular cylinders (C Ќ ), parallel lamellae (L ʈ ), and parallel perforated lamellae (CL ʈ ). When the film surfaces are preferentially wet by either the A or the B block, parallel oriented microdomains are preferred. A perpendicular cylindrical phase is stable when neither the A nor B block preferentially wets the surfaces. The predicted phase diagram is in accordance with experimental data in the literature and explains the experimentally observed differences between films of asymmetric block copolymers with only two parameters: the film thickness and the energetic preference of the surface for one of the polymer blocks. We have also observed, that confinement speeds up the process of long range ordering of the microdomains.