hi paul,as you cmk has given techincally sound advice
although i would say the actual length of notice required in your contract can often mean didly squat,
as long as you leave of your own accord and provide a written explanation of your reason for leaving then you will be ok regardless you will be paid for the hours you work,they cant penalise you and say you wont get paid because they cant not pay you for work you do,that my freind would be a breach of various employment laws and statutary rights as a employee.
as for bad reference,that depends on what questions the company asks,your previous company cant give you a bad reference unless they have very good reason i.e you were sacked for fraud etc.
It would be libelous of them to give you a bad reference just because you didnt leave within their standard notice terms,they merely say that you worked their and maybe they will provide details of number of sickness days etc.
that is about it as far as what they can and cant say.
if you have a good working relationship with your boss,they should let you leave whenever you want.
Ive just left my job after 4 years of service and i left within 2-3 weeks which was less than standard notice but it could have been earlier if it wasnt my birthday on the first week they wanted me to start my new job.