Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!mcsun!hp4nl!svin02!wsinti01!wsinpp From: wsinpp@wsinti01.info.win.tue.nl (Peter Peters) Newsgroups: comp.lang.pascal Subject: Re: (R)window() problems in turbo 5.5 Message-ID: <1442@svin02.info.win.tue.nl> Date: 25 Sep 90 06:45:12 GMT References: <15445.26f8cfbb@levels.sait.edu.au> Sender: news@svin02.info.win.tue.nl Reply-To: wsinpp@info.win.tue.nl Lines: 116 In article <15445.26f8cfbb@levels.sait.edu.au>, Anthony Nuttall writes: >I have noticed using Turbo Pascal 5.5 that when you use the crt >procedure window to to change the screen borders, when you select a >region only 1 line high, it spits the dummy and scrolls the rest of the >screen. I can find no mention of it in the manual. > >demonstration code follows : > >for loop := 0 to 3999 do >mem[$b000:loop] := random(255); >window(1,1,50,1); >writeln('Hi there'); I e-mailed the answer to Anthony, but maybe it's best read by everyone interested. The phenomena Anthony describes is also causing me some trouble. I've posted the same question a few months ago and we finally found out that it's a bug in the bios (so the problem occurrs not on all machines...) The problem only occurrs for windows of height 1 ! Below is a piece of code which explains what causes the trouble (or not if you're lucky to have a correct bios !! :-) ) --------- here it comes ! ----------------------- {$define test} Program BugAgain; (* * Demonstrate a bios bug which occurrs with TP windows of height 1. * I was able to patch TP 3.x to work around this bug ! *) Uses Dos,Crt; Const Xloc = 10; Yloc = 10; Width = 5; Height = 1; (* This is a troublesome value !!! *) Var i : Word; R : Registers; Begin (* * Fill screen with character "-" *) ClrScr; For i := 1 To 80*24-1 Do Write('-'); (* * Define the window, clear it and fill it up with "a" * but leave the last character to be done ! *) Window(Xloc,Yloc,Xloc-1+Width,Yloc-1+Height); ClrScr; For i := 1 To Width-1 Do Write('a'); (* * Here comes trouble... * somewhere in the next write('a'), scrolling is done via the bios * INT 10h with register AX set to $0601. The $01 in register AL is * the number of empty lines to move into the window. * Apparently this goes wrong as can be shown by replacing the * write('a') statement by the alternative piece of code. * Watch what happens when this window scrolls !!! *) {$ifdef test} Write('a'); {$else} (* * This is an exact functional copy of what the TP compiler generates * to scroll a window up !! *) R.ax:=$0601; R.bh:=TextAttr; R.cx:=WindMin; R.dx:=WindMax; Intr($10,R); {$endif} (* * Now this could be called : * * 1 - a bios bug. * 2 - a TP bug. * * Scrolling up a 1 line window should be the same as clearing it !. * Since not everyone seems to be bothered by this problem it seems * to be a bug of the bios in my machine :-( *) End. ----- That's it ! ----------------------- I hope this clarifies the problem a bit. Peter Peters. -- | Peter Peters | UUCP : wsinpp@win.tue.nl | | Eindhoven University of Technology (TUE) | SURF : heithe5::wsdcpp | | Dept. of Mathematics and Computer Science | VHF : PA0PPE | | Disclaimer : I said WHAT ??? | TUE : HG 8.82 tst. 4120 |