Xref: utzoo comp.unix.msdos:147 comp.lang.apl:537 Path: utzoo!attcan!uunet!jorel!jmcook From: jmcook@jorel.APLDMT.COM (joel m. cook) Newsgroups: comp.unix.msdos,comp.lang.apl Subject: Anomalous integer arithmetic--Simul-Task/Native DOS Keywords: Simul-Task, unix, APL Message-ID: <283@jorel.APLDMT.COM> Date: 26 Oct 90 20:33:06 GMT Followup-To: poster Organization: Applied Materials, Inc., Santa Clara, CA Lines: 25 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@jorel.apldmt.com