Code generator - cases 8 to 9