Pentium II problem with programs compiled in Turbo Pascal (CRT unit) 
Author Message
 Pentium II problem with programs compiled in Turbo Pascal (CRT unit)

        I have a problem with my new Intel Pentium II (Celeron 266)
processor. I've decided to buy this one because of compatibility with all
compilers (such as clipper, Pascal, C). And i had a great surprise when i
found out that there is no program compiled in Turbo Pascal 7.0 (Borland
too) which would run properly, runtime error 200 (divide by zero). Later
it
turned out that it's caused by declaration of CRT unit in uses section,
when there is no CRT declared everything is ok.
        Now I wonder if I should write my own unit which would substitute original
one or maybe there is another way to solve this problem.
--
                                                           Micha3 Piasecki


Wed, 18 Jun 1902 08:00:00 GMT  
 Pentium II problem with programs compiled in Turbo Pascal (CRT unit)
        I have a problem with my new Intel Pentium II (Celeron 266)
processor. I've decided to buy this one because of compatibility with all
compilers (such as clipper, pascal, C). And i had a great surprise when i
found out that there is no program compiled in Turbo Pascal 7.0 (Borland
too) which would run properly, runtime error 200 (divide by zero). Later
it
turned out that it's caused by declaration of CRT unit in uses section,
when there is no CRT declared everything is ok.
        Now I wonder if I should write my own unit which would substitute original
one or maybe there is another way to solve this problem.

--
                                                           Micha3 Piasecki.



Wed, 18 Jun 1902 08:00:00 GMT  
 Pentium II problem with programs compiled in Turbo Pascal (CRT unit)

clpb with

Quote:
>it
>turned out that it's caused by declaration of CRT unit in uses section,
>when there is no CRT declared everything is ok.

*Sigh* Please read before writing, it saves us all time. Info:

Mini-FAQ posted weekly lists this. Copies in the newsgroup and at
                        http://www.pascal.force9.co.uk/faq/clpb-faq.txt
                        http://www.merlyn.demon.co.uk/clpb-faq.txt
                        ftp://garbo.uwasa.fi/pc/doc-net/faqclpb.zip

Also Timo Salmi's FAQ - monthly pointer posted in clpb
                        ftp://garbo.uwasa.fi/pc/link/tsfaqp.zip
                        See #124

--
Pedt



Wed, 18 Jun 1902 08:00:00 GMT  
 Pentium II problem with programs compiled in Turbo Pascal (CRT unit)


Quote:

>    I have a problem with my new Intel Pentium II (Celeron 266)
>processor. I've decided to buy this one because of compatibility with all
>compilers (such as clipper, pascal, C). And i had a great surprise when i
>found out that there is no program compiled in Turbo Pascal 7.0 (Borland
>too) which would run properly, runtime error 200 (divide by zero). Later
>it
>turned out that it's caused by declaration of CRT unit in uses section,
>when there is no CRT declared everything is ok.
>    Now I wonder if I should write my own unit which would substitute original
>one or maybe there is another way to solve this problem.

This is a VFAQ.  Use the following before CRT:

Unit Fdelay;             { Use this before CRT }

interface

const dfix:word=1;       { call delay() dfix times }

implementation

{$ifdef msdos}

uses dos;

procedure oldints; assembler; { "variables" in the code segment }
          asm dd 0,0 end;

Procedure error;
begin
  runerror(200);
End;

Procedure Int0; assembler;
          asm
          cmp cx,55       { If CX<>55 we are at some other point }

          sti

          shr dx,1        { divide dx:ax by 2 }
          rcr ax,1
          shl Dfix,1      { multiply Dfix by 2 }
          iret            { return to the DIV (286+) }
          end;

{ Int21h handler removes the int0 handler (as well as itself) from the
  memory when CtrlBreak vector is set by CRT right after calculating
  the delay counter. Note DS does NOT point to the data segment when
  this is called }

Procedure Int21h; assembler;
          asm
          cmp ax,$251B

          push es; push si; push di
          mov si,offset oldints
          xor di,di
          mov es,di
          cld
          segcs; movsw
          segcs; movsw           { restore int 0 }

          mov di,$21*4
          segcs; movsw           { restore int 21h }
          segcs; movsw
          pop di; pop si; pop es

          end;

type tr=record int0,int21:pointer; End;
     pr=^tr;

begin




{$endif}
end.



Wed, 18 Jun 1902 08:00:00 GMT  
 Pentium II problem with programs compiled in Turbo Pascal (CRT unit)
Czesc
widze, ze jestes Polak ;), wiec pisze po polsku
popatrz na : pl.comp.lang.pascal - zadalem pare dni temu to samo pytanie.
poczytaj sobie odpowiedzi ;))

GAD



Wed, 18 Jun 1902 08:00:00 GMT  
 Pentium II problem with programs compiled in Turbo Pascal (CRT unit)
uggg.... what he say?    :)
Quote:

>Czesc
>widze, ze jestes Polak ;), wiec pisze po polsku
>popatrz na : pl.comp.lang.pascal - zadalem pare dni temu to samo pytanie.
>poczytaj sobie odpowiedzi ;))

>GAD



Wed, 18 Jun 1902 08:00:00 GMT  
 Pentium II problem with programs compiled in Turbo Pascal (CRT unit)

Quote:
>uggg.... what he say?    :)

heheh
That was in Polish ;)))))))

GAD



Wed, 18 Jun 1902 08:00:00 GMT  
 Pentium II problem with programs compiled in Turbo Pascal (CRT unit)
it read:
"Hi, I see you're Polish so I'll write in Polish.
Look at pl.comp.lang.pascal. I asked the same question a few day's ago.
You can read the answers there. "

--

Jesse van Oort

(remove 'NOSPAM' for Email).

Quote:

>uggg.... what he say?    :)


>>Czesc
>>widze, ze jestes Polak ;), wiec pisze po polsku
>>popatrz na : - zadalem pare dni temu to samo pytanie.
>>poczytaj sobie odpowiedzi ;))

>>GAD



Wed, 18 Jun 1902 08:00:00 GMT  
 Pentium II problem with programs compiled in Turbo Pascal (CRT unit)
Hey! How do you know what this means ???? Are you Polish too or what?

GAD



Wed, 18 Jun 1902 08:00:00 GMT  
 Pentium II problem with programs compiled in Turbo Pascal (CRT unit)
This is a problem - or better: a bug - in TURBO.TPL. You must patch it.


(perhaps I'll upload it to http://software.webset.de/mbs/ )



Wed, 18 Jun 1902 08:00:00 GMT  
 Pentium II problem with programs compiled in Turbo Pascal (CRT unit)

Quote:
>This is a problem - or better: a bug - in TURBO.TPL. You must patch it.


>(perhaps I'll upload it to http://software.webset.de/mbs/ )

Fixes are already available in well publicised locations. Mini-FAQ has
info but see http://www.geocities.com/SiliconValley/2926/tp.html for
URLs for patches.

--
Pedt



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 11 post ] 

 Relevant Pages 

1. Borland Pascal 7 CRT unit on Pentium II

2. The CRT Unit and my new 300 mhz Pentium II

3. Pentium II 300 - bug with crt unit

4. Pentium II and CRT unit

5. crt.zip Replacement CRT units for Turbo/Borland Pascal

6. Pentium and CRT unit: Problem solved

7. borland pascal programs don't run with intel pentium II

8. CRT pentium PRO/II bug work-around

9. BP 7 programs don't run with a Pentium II 400

10. Executing TP7 programs over a PENTIUM II

11. Turbo Pascal for Windows 1.5 - CRT unit

12. Crt Unit in Turbo Pascal 7.0 generates overflow

 

 
Powered by phpBB® Forum Software