Nikkei stock index ends at 5&month high on firm chip shares