WORD is unsigned, so we need to transalte 0xffff into -1.