Until a leakdown test is performed to find out where the compression is escaping to, there is no way to tell. Might be as simple as a couple of burnt valves and a head rebuild will fix it. Could be as indepth as the piston rings/cylinder wall are excessively worn and you will need a complete engine rebuild. Until more testing is done we can't give anything more than a speculative guess on what the problem is and what it will cost to fix. If the body/trans/interior are all in good shape, then a reman motor or a rebuild is cheaper than 6 mo payment on a new car.