In the UK for example, s.11(2) of the Copyright, Design and Patents Act 1988 provides as follows:
(2) Where a literary, dramatic, musical or artistic work[, or a film,] is made by an employee in the course of his employment, his employer is the first owner of any copyright in the work subject to any agreement to the contrary.
s.3(1) of the same Act defines a literary work as including a computer program so there's your answer in respect of UK law. In other jurisdictions, software will generally attract copyright protection also.