you could try adding a __asm pop ax or a __asm push ax after your function, if dev-cpp supports that.