Codegen: fix to DIV/DVI instructions

Previously, DIV/DVI instructions would produce the wrong value if the B operand had its high bit set (i.e. was >= 0x8000). This is now fixed in a somewhat perforamnce-degrading way. (The division is now done over a long value rather than an int value.)