home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!rpi!ghost.dsi.unimi.it!univ-lyon1.fr!cismibm.univ-lyon1.fr!ppollet
- From: ppollet@cismibm.univ-lyon1.fr (Patrick POLLET)
- Newsgroups: comp.lang.pascal
- Subject: Re: Turbo Pascal V6.0 BUG?! Fixed?
- Date: Thu, 17 Dec 1992 10:05:23 GMT
- Organization: INSA CENTRE INFORMATIQUE DU 1er CYCLE
- Lines: 63
- Message-ID: <ppollet.78.724586723@cismibm.univ-lyon1.fr>
- References: <1992Dec16.182311.45706@kuhub.cc.ukans.edu> <1992Dec17.004658.26894@news.acns.nwu.edu>
- NNTP-Posting-Host: 134.214.232.25
-
- In article <1992Dec17.004658.26894@news.acns.nwu.edu> delusion@casbah.acns.nwu.edu (Albert Schmezer) writes:
- >From: delusion@casbah.acns.nwu.edu (Albert Schmezer)
- >Subject: Turbo Pascal V6.0 BUG?! Fixed?
- >Date: Thu, 17 Dec 1992 00:46:58 GMT
-
- > Hello all. I seem to have uncovered some bugs in Turbo Pascal V6.0
- >that I hope some people could shed some light on. Are these internal bugs? Can
- >they be fixed? Are they fixed in TP 7.0 or BP 7.0?
-
- >var i: integer;
- > l: longint;
-
- >begin
- > i:=400; l:=i*104;
- >end.
-
- > It will return a NEGATIVE number! Switch the i variable to a longint,
- >and it will work fine! Why?!
-
- That's not a bug but the standard behaviour of the integer type.
- When you declare a variable of a given type, say integer , you
- declare to the compiler that you are conscient that the
- values taken by that varaible will always be in a certain range....
-
- Integer goes from -32768 to 32767. (that is storage within a word
- of 16 bits with one bit for sign and 15 for the abs(value).
-
- Assembly language calculations with integers do not check overflow
- conditions. So if a result gets too big, the bit 15 may get set to 1
- and the number "looks" negative ...
- so you result 104*400 = 41600 is out of range. It is returned as
- 41600-65536 i.e. -23936
- the same is true with additions (try 20000+20000) (-20000 -20000)....
-
- You may experiment with it using the Evaluate... in the Debug Menu of TP6
- ( use the ,h specifier to get results in HEX, and you will see when
- the bit 15 gets set to 1)
-
- > 2.) ALL the Turbo products (Turbo Pascal V5.0, 6.0, Turbo C, and Turbo
- >C++ V2.0) refuse to work with my EMS driver (ACCEMM.SYS). They lock up
- >immediately upon bootup. WHY?! Hmmmm!
-
- They seem to dectect your EMS driver but not using it properly.
- It the version up to date ?
-
- In TP6 there is a command line option /X to DISABLE the usage of EMS
- even if one is present
- something like TURBO -X- (* the minus after is to turn it off*)
- check the User Guide beginning of Section IDE reference....
-
- The same option may be present in the others products (? ) I don't
- have them...
- ppollet@cismibm.univ-lyon1.fr (Patrick POLLET)
- --------------------------------------------------------
- Dr Patrick L.Pollet
- Institut National des Sciences Appliquées
- Centre Informatique du 1er Cycle Bat 110
- 20 Avenue A.Einstein
- 69621 Villeurbanne Cedex France
- --------------------------------------------------------
- Phone: 72 43 83 80 - la premiere erreur c'est
- Fax : 72 43 85 33 - de se lever le matin ... GASTON
- -------------------------------------------------------
-