The main thing you can do to cover your Arse is to make sure that you have the evidence in your hand that you have worked on something.
Lets take five scenarios.
Scenario #1 : You are assigned with preparing a report that the boss is supposed to do..
You can do that.. but make sure that you are mentioning the same in your work report. Do remember to save a copy of the same in your computer, change the author to your initials(MS word have option to do that) and try to send the same to your boss through official mail. (with the last step you have a copy of the same in send folder)
Scenario #2 : You are asked to stop a work and instructed to do another one of high priority.
The rule above helps in that as well.. mention in the work sheet(or daily report) that it is in hold, with a comment why it is in hold.
eg: in hold as instructed by Mr. Boss by mail/ word, at ... PM.
Scenario #3 : A small bend of the rule, you are asked to do a work that may affect you if you perform the same( eg: giving a loan to a party without proper evalutaion)
Ask for a written request from your boss, either through mail or in any other written format(this will definitly make his face go wild)
Scenario #4 : Your evaluation marks are low inspite of you working hard.
Tackle this efficiently. Ask for a comment on each mark, why this is low, area of improvement. etc... dont forget to do a self evaluation.(next evaluation will be better)
Scenario #5 : A public war..
When your Boss declare a public war with you the best way to sort things up is to search for a new job. But make sure that you are not repeating your flaws in the new career / company