Paul Allen uses memoir to portray Bill Gates as a bully who sought to deprive him of his share in Microsoft fortune

Bill Gates betrayed his ailing business partner and tried to deprive him of his share of the Microsoft fortune, according to a scathing memoir from Paul Allen, the company's billionaire co-founder.

Allen portrays the Microsoft mogul as a sarcastic bully who tried to force his founding partner out of the firm and to cut his share in the company as he was recovering from cancer. The book, Idea Man: a Memoir by the co-founder of Microsoft, is set to go on sale on 17 April, and an extract appears in May's Vanity Fair magazine and has been released online.

Despite Gates's moves, Allen held on to his Microsoft stake – one that contributed to the lion's share of what Forbes magazine's estimates to be a $13bn (£8.1bn) fortune.

The two were once inseparable and met at Lakeside high school in Seattle where Allen paints a picture of the couple as the original nerds. Allen didn't fit in amid the golfers and tennis players "who carried their rackets wherever they went". Then in 1968 he met Gates, another gawky kid who was also spending all his free time hunched over the school's first computer, an ASR-33 Teletype model.

"His blond hair went all over the place. You could tell three things about Bill Gates pretty quickly. He was really smart. He was really competitive; he wanted to show you how smart he was. And he was really, really persistent."

At the age of 13 Gates was already poring over Fortune magazine and planning on building a company. When Gates went to Harvard, Allen followed him and the two spent their spare time working on ideas for a software firm.

"I'd assumed that our partnership would be a 50-50 proposition. But Bill had another idea," Allen writes. Gates had put in more work than Allen, and eventually after some quibbling from Gates, Allen agreed to a 64-36 split. Allen writes that when the relationship soured he wondered again about that split. "I'd been taught that a deal was a deal and your word was your bond. Bill was more flexible," he writes. Gates pushed deals "as hard and as far as he could".

Relations worsened as Microsoft took off. Gates would prowl the car park to see who came in on the weekend. He thrived on conflict and sarcasm; he and Allen would argue for hours at a stretch. Then Gates brought in Steve Ballmer, the firm's current boss, to help manage the company. Gates offered Ballmer 8.75% of the firm, angering other staff and Allen, who had agreed to a far smaller percentage.

In 1982 Allen contracted Hodgkin's lymphoma. When he returned to work relations with Gates and Ballmer hit a new low. Allen claims the pair undermined him and he overheard them discussing ways of diluting his stake in the firm. "Unable to stand it any longer, I burst in on them and shouted, 'This is unbelievable! It shows your true character, once and for all,'" he writes.

Ballmer and Gates later apologised but the partnership was over. Allen resigned and Gates tried to buy him out for $5 a share. Allen refused and said he wouldn't discuss less than $10. Gates balked at the price and Allen left with what was to become an enormous fortune. Shares are trading at more than $25 and the company is now worth more than $214bn.

"While my recollection of many of these events may differ from Paul's, I value his friendship and the important contributions he made to the world of technology and at Microsoft," Gates said in a written statement given to the Wall Street Journal.