Anomalous integer arithmetic--Simul-Task/Native DOS
joel m. cook
jmcook at jorel.APLDMT.COM
Sat Oct 27 06:33:06 AEST 1990
I'm running STSC's APL*PLUS/PC Version 8.0 and I get differing
behaviors with integer arithmetic depending on whether or
not I'm running native DOS or Simul-Task under AT&T SVR3.2.1.
If I add 32767 to 1, I get -32768 under Simul-Task, but
32769 under native DOS. I.e.,
32767 + 1 -> -32768 APL under Simul-Task
32767 + 1 -> 32768 APL under native DOS.
If I use floating point (32767.00000000001 for instance), it
all works as it should. Seems to me that under Simul-Task
the results are being kept in 2's-complement 16 bit notation, but
are handled properly under native DOS. Since I thought
the whole point of Simul-Task was to be a virtual 8086, I
don't understand the discrepancy.
For what it's worth, when run under Windows 3.0, the correct
answer is given, so it appears not to be *just* a function
of the virtual 8086 (assuming that's what Windows does???).
Any enlightenment will, as usual, be most appreciated!
--
Joel M. Cook
jmcook at jorel.apldmt.com
More information about the Comp.unix.msdos
mailing list