crt.pp 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 1993-98 by the Free Pascal development team.
  5. Borland Pascal 7 Compatible CRT Unit for Go32V1 and Go32V2
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. unit crt;
  13. interface
  14. const
  15. { CRT modes }
  16. BW40 = 0; { 40x25 B/W on Color Adapter }
  17. CO40 = 1; { 40x25 Color on Color Adapter }
  18. BW80 = 2; { 80x25 B/W on Color Adapter }
  19. CO80 = 3; { 80x25 Color on Color Adapter }
  20. Mono = 7; { 80x25 on Monochrome Adapter }
  21. Font8x8 = 256; { Add-in for ROM font }
  22. { Mode constants for 3.0 compatibility }
  23. C40 = CO40;
  24. C80 = CO80;
  25. { Foreground and background color constants }
  26. Black = 0;
  27. Blue = 1;
  28. Green = 2;
  29. Cyan = 3;
  30. Red = 4;
  31. Magenta = 5;
  32. Brown = 6;
  33. LightGray = 7;
  34. { Foreground color constants }
  35. DarkGray = 8;
  36. LightBlue = 9;
  37. LightGreen = 10;
  38. LightCyan = 11;
  39. LightRed = 12;
  40. LightMagenta = 13;
  41. Yellow = 14;
  42. White = 15;
  43. { Add-in for blinking }
  44. Blink = 128;
  45. var
  46. { Interface variables }
  47. CheckBreak: Boolean; { Enable Ctrl-Break }
  48. CheckEOF: Boolean; { Enable Ctrl-Z }
  49. DirectVideo: Boolean; { Enable direct video addressing }
  50. CheckSnow: Boolean; { Enable snow filtering }
  51. LastMode: Word; { Current text mode }
  52. TextAttr: Byte; { Current text attribute }
  53. WindMin: Word; { Window upper left coordinates }
  54. WindMax: Word; { Window lower right coordinates }
  55. { Interface procedures }
  56. procedure AssignCrt(var F: Text);
  57. function KeyPressed: Boolean;
  58. function ReadKey: Char;
  59. procedure TextMode(Mode: Integer);
  60. procedure Window(X1,Y1,X2,Y2: Byte);
  61. procedure GotoXY(X,Y: Byte);
  62. function WhereX: Byte;
  63. function WhereY: Byte;
  64. procedure ClrScr;
  65. procedure ClrEol;
  66. procedure InsLine;
  67. procedure DelLine;
  68. procedure TextColor(Color: Byte);
  69. procedure TextBackground(Color: Byte);
  70. procedure LowVideo;
  71. procedure HighVideo;
  72. procedure NormVideo;
  73. procedure Delay(MS: Word);
  74. procedure Sound(Hz: Word);
  75. procedure NoSound;
  76. {Extra Functions}
  77. procedure cursoron;
  78. procedure cursoroff;
  79. procedure cursorbig;
  80. implementation
  81. uses
  82. go32;
  83. {$ASMMODE ATT}
  84. var
  85. DelayCnt, { don't modify this var name, as it is hard coded }
  86. ScreenWidth,
  87. ScreenHeight : longint;
  88. {
  89. definition of textrec is in textrec.inc
  90. }
  91. {$i textrec.inc}
  92. {****************************************************************************
  93. Low level Routines
  94. ****************************************************************************}
  95. procedure setscreenmode(mode : byte);
  96. var
  97. regs : trealregs;
  98. begin
  99. regs.realeax:=mode;
  100. realintr($10,regs);
  101. end;
  102. function GetScreenHeight : longint;
  103. begin
  104. getscreenheight:=mem[$40:$84]+1;
  105. end;
  106. function GetScreenWidth : longint;
  107. begin
  108. getscreenwidth:=mem[$40:$4a];
  109. end;
  110. procedure SetScreenCursor(x,y : longint);
  111. var
  112. regs : trealregs;
  113. begin
  114. regs.realeax:=$0200;
  115. regs.realebx:=0;
  116. regs.realedx:=(y-1) shl 8+(x-1);
  117. realintr($10,regs);
  118. end;
  119. procedure GetScreenCursor(var x,y : longint);
  120. begin
  121. x:=mem[$40:$50]+1;
  122. y:=mem[$40:$51]+1;
  123. end;
  124. {****************************************************************************
  125. Helper Routines
  126. ****************************************************************************}
  127. Function WinMinX: Byte;
  128. {
  129. Current Minimum X coordinate
  130. }
  131. Begin
  132. WinMinX:=(WindMin and $ff)+1;
  133. End;
  134. Function WinMinY: Byte;
  135. {
  136. Current Minimum Y Coordinate
  137. }
  138. Begin
  139. WinMinY:=(WindMin shr 8)+1;
  140. End;
  141. Function WinMaxX: Byte;
  142. {
  143. Current Maximum X coordinate
  144. }
  145. Begin
  146. WinMaxX:=(WindMax and $ff)+1;
  147. End;
  148. Function WinMaxY: Byte;
  149. {
  150. Current Maximum Y coordinate;
  151. }
  152. Begin
  153. WinMaxY:=(WindMax shr 8) + 1;
  154. End;
  155. Function FullWin:boolean;
  156. {
  157. Full Screen 80x25? Window(1,1,80,25) is used, allows faster routines
  158. }
  159. begin
  160. FullWin:=(WindMax-WindMin=$184f);
  161. end;
  162. {****************************************************************************
  163. Public Crt Functions
  164. ****************************************************************************}
  165. procedure textmode(mode : integer);
  166. var
  167. regs : trealregs;
  168. begin
  169. lastmode:=mode;
  170. mode:=mode and $ff;
  171. setscreenmode(mode);
  172. { set 8x8 font }
  173. if (lastmode and $100)<>0 then
  174. begin
  175. regs.realeax:=$1112;
  176. regs.realebx:=$0;
  177. realintr($10,regs);
  178. end;
  179. screenwidth:=getscreenwidth;
  180. screenheight:=getscreenheight;
  181. windmin:=0;
  182. windmax:=(screenwidth-1) or ((screenheight-1) shl 8);
  183. end;
  184. Procedure TextColor(Color: Byte);
  185. {
  186. Switch foregroundcolor
  187. }
  188. Begin
  189. TextAttr:=(Color and $8f) or (TextAttr and $70);
  190. End;
  191. Procedure TextBackground(Color: Byte);
  192. {
  193. Switch backgroundcolor
  194. }
  195. Begin
  196. TextAttr:=(Color shl 4) or (TextAttr and $0f);
  197. End;
  198. Procedure HighVideo;
  199. {
  200. Set highlighted output.
  201. }
  202. Begin
  203. TextColor(TextAttr Or $08);
  204. End;
  205. Procedure LowVideo;
  206. {
  207. Set normal output
  208. }
  209. Begin
  210. TextColor(TextAttr And $77);
  211. End;
  212. Procedure NormVideo;
  213. {
  214. Set normal back and foregroundcolors.
  215. }
  216. Begin
  217. TextColor(7);
  218. TextBackGround(0);
  219. End;
  220. Procedure GotoXy(X: Byte; Y: Byte);
  221. {
  222. Go to coordinates X,Y in the current window.
  223. }
  224. Begin
  225. If (X>0) and (X<=WinMaxX- WinMinX+1) and
  226. (Y>0) and (Y<=WinMaxY-WinMinY+1) Then
  227. Begin
  228. Inc(X,WinMinX-1);
  229. Inc(Y,WinMinY-1);
  230. SetScreenCursor(x,y);
  231. End;
  232. End;
  233. Procedure Window(X1, Y1, X2, Y2: Byte);
  234. {
  235. Set screen window to the specified coordinates.
  236. }
  237. Begin
  238. if (X1>X2) or (X2>ScreenWidth) or
  239. (Y1>Y2) or (Y2>ScreenHeight) then
  240. exit;
  241. WindMin:=((Y1-1) Shl 8)+(X1-1);
  242. WindMax:=((Y2-1) Shl 8)+(X2-1);
  243. GoToXY(1,1);
  244. End;
  245. Procedure ClrScr;
  246. {
  247. Clear the current window, and set the cursor on 1,1
  248. }
  249. var
  250. fil : word;
  251. y : longint;
  252. begin
  253. fil:=32 or (textattr shl 8);
  254. if FullWin then
  255. DosmemFillWord($b800,0,ScreenHeight*ScreenWidth,fil)
  256. else
  257. begin
  258. for y:=WinMinY to WinMaxY do
  259. DosmemFillWord($b800,((y-1)*ScreenWidth+(WinMinX-1))*2,WinMaxX-WinMinX+1,fil);
  260. end;
  261. Gotoxy(1,1);
  262. end;
  263. Procedure ClrEol;
  264. {
  265. Clear from current position to end of line.
  266. }
  267. var
  268. x,y : longint;
  269. fil : word;
  270. Begin
  271. GetScreenCursor(x,y);
  272. fil:=32 or (textattr shl 8);
  273. if x<WinMaxX then
  274. DosmemFillword($b800,((y-1)*ScreenWidth+(x-1))*2,WinMaxX-x+1,fil);
  275. End;
  276. Function WhereX: Byte;
  277. {
  278. Return current X-position of cursor.
  279. }
  280. var
  281. x,y : longint;
  282. Begin
  283. GetScreenCursor(x,y);
  284. WhereX:=x-WinMinX+1;
  285. End;
  286. Function WhereY: Byte;
  287. {
  288. Return current Y-position of cursor.
  289. }
  290. var
  291. x,y : longint;
  292. Begin
  293. GetScreenCursor(x,y);
  294. WhereY:=y-WinMinY+1;
  295. End;
  296. {*************************************************************************
  297. KeyBoard
  298. *************************************************************************}
  299. var
  300. is_last : boolean;
  301. last : char;
  302. function readkey : char;
  303. var
  304. char2 : char;
  305. char1 : char;
  306. regs : trealregs;
  307. begin
  308. if is_last then
  309. begin
  310. is_last:=false;
  311. readkey:=last;
  312. end
  313. else
  314. begin
  315. regs.realeax:=$0000;
  316. realintr($16,regs);
  317. char1:=chr(regs.realeax and $ff);
  318. char2:=chr((regs.realeax and $ff00) shr 8);
  319. if char1=#0 then
  320. begin
  321. is_last:=true;
  322. last:=char2;
  323. end;
  324. readkey:=char1;
  325. end;
  326. end;
  327. function keypressed : boolean;
  328. var
  329. regs : trealregs;
  330. begin
  331. if is_last then
  332. begin
  333. keypressed:=true;
  334. exit;
  335. end
  336. else
  337. begin
  338. regs.realeax:=$0100;
  339. realintr($16,regs);
  340. keypressed:=((regs.realflags and zeroflag) = 0);
  341. end;
  342. end;
  343. {*************************************************************************
  344. Delay
  345. *************************************************************************}
  346. procedure Delayloop;assembler;
  347. asm
  348. .LDelayLoop1:
  349. subl $1,%eax
  350. jc .LDelayLoop2
  351. cmpl %fs:(%edi),%ebx
  352. je .LDelayLoop1
  353. .LDelayLoop2:
  354. end;
  355. procedure initdelay;assembler;
  356. asm
  357. movl $0x46c,%edi
  358. movl $-28,%edx
  359. movl %fs:(%edi),%ebx
  360. .LInitDel1:
  361. cmpl %fs:(%edi),%ebx
  362. je .LInitDel1
  363. movl %fs:(%edi),%ebx
  364. movl %edx,%eax
  365. call DelayLoop
  366. notl %eax
  367. xorl %edx,%edx
  368. movl $55,%ecx
  369. divl %ecx
  370. movl %eax,DelayCnt
  371. end;
  372. procedure Delay(MS: Word);assembler;
  373. asm
  374. movzwl MS,%ecx
  375. jecxz .LDelay2
  376. movl $0x400,%edi
  377. movl DelayCnt,%edx
  378. movl %fs:(%edi),%ebx
  379. .LDelay1:
  380. movl %edx,%eax
  381. call DelayLoop
  382. loop .LDelay1
  383. .LDelay2:
  384. end;
  385. procedure sound(hz : word);
  386. begin
  387. if hz=0 then
  388. begin
  389. nosound;
  390. exit;
  391. end;
  392. asm
  393. movzwl hz,%ecx
  394. movl $1193046,%eax
  395. cltd
  396. divl %ecx
  397. movl %eax,%ecx
  398. movb $0xb6,%al
  399. outb %al,$0x43
  400. movb %cl,%al
  401. outb %al,$0x42
  402. movb %ch,%al
  403. outb %al,$0x42
  404. inb $0x61,%al
  405. orb $0x3,%al
  406. outb %al,$0x61
  407. end ['EAX','ECX','EDX'];
  408. end;
  409. procedure nosound;
  410. begin
  411. asm
  412. inb $0x61,%al
  413. andb $0xfc,%al
  414. outb %al,$0x61
  415. end ['EAX'];
  416. end;
  417. {****************************************************************************
  418. HighLevel Crt Functions
  419. ****************************************************************************}
  420. procedure removeline(y : longint);
  421. var
  422. fil : word;
  423. begin
  424. fil:=32 or (textattr shl 8);
  425. y:=WinMinY+y-1;
  426. While (y<WinMaxY) do
  427. begin
  428. dosmemmove($b800,(y*ScreenWidth+(WinMinX-1))*2,
  429. $b800,((y-1)*ScreenWidth+(WinMinX-1))*2,(WinMaxX-WinMinX+1)*2);
  430. inc(y);
  431. end;
  432. dosmemfillword($b800,((WinMaxY-1)*ScreenWidth+(WinMinX-1))*2,(WinMaxX-WinMinX+1),fil);
  433. end;
  434. procedure delline;
  435. begin
  436. removeline(wherey);
  437. end;
  438. procedure insline;
  439. var
  440. my,y : longint;
  441. fil : word;
  442. begin
  443. fil:=32 or (textattr shl 8);
  444. y:=WhereY;
  445. my:=WinMaxY-WinMinY;
  446. while (my>=y) do
  447. begin
  448. dosmemmove($b800,(((WinMinY+my-1)-1)*ScreenWidth+(WinMinX-1))*2,
  449. $b800,(((WinMinY+my)-1)*ScreenWidth+(WinMinX-1))*2,(WinMaxX-WinMinX+1)*2);
  450. dec(my);
  451. end;
  452. dosmemfillword($b800,(((WinMinY+y-1)-1)*ScreenWidth+(WinMinX-1))*2,(WinMaxX-WinMinX+1),fil);
  453. end;
  454. {****************************************************************************
  455. Extra Crt Functions
  456. ****************************************************************************}
  457. procedure cursoron;
  458. var
  459. regs : trealregs;
  460. begin
  461. regs.realeax:=$0100;
  462. regs.realecx:=$90A;
  463. realintr($10,regs);
  464. end;
  465. procedure cursoroff;
  466. var
  467. regs : trealregs;
  468. begin
  469. regs.realeax:=$0100;
  470. regs.realecx:=$ffff;
  471. realintr($10,regs);
  472. end;
  473. procedure cursorbig;
  474. var
  475. regs : trealregs;
  476. begin
  477. regs.realeax:=$0100;
  478. regs.realecx:=$10A;
  479. realintr($10,regs);
  480. end;
  481. {*****************************************************************************
  482. Read and Write routines
  483. *****************************************************************************}
  484. var
  485. CurrX,CurrY : longint;
  486. Procedure WriteChar(c:char);
  487. var
  488. regs : trealregs;
  489. begin
  490. case c of
  491. #10 : inc(CurrY);
  492. #13 : CurrX:=WinMinX;
  493. #8 : begin
  494. if CurrX>WinMinX then
  495. dec(CurrX);
  496. end;
  497. #7 : begin { beep }
  498. regs.dl:=7;
  499. regs.ah:=2;
  500. realintr($21,regs);
  501. end;
  502. else
  503. begin
  504. memw[$b800:((CurrY-1)*ScreenWidth+(CurrX-1))*2]:=(textattr shl 8) or byte(c);
  505. inc(CurrX);
  506. end;
  507. end;
  508. if CurrX>WinMaxX then
  509. begin
  510. CurrX:=WinMinX;
  511. inc(CurrY);
  512. end;
  513. while CurrY>WinMaxY do
  514. begin
  515. removeline(1);
  516. dec(CurrY);
  517. end;
  518. end;
  519. Function CrtWrite(var f : textrec):integer;
  520. var
  521. i : longint;
  522. begin
  523. GetScreenCursor(CurrX,CurrY);
  524. for i:=0 to f.bufpos-1 do
  525. WriteChar(f.buffer[i]);
  526. SetScreenCursor(CurrX,CurrY);
  527. f.bufpos:=0;
  528. CrtWrite:=0;
  529. end;
  530. Function CrtRead(Var F: TextRec): Integer;
  531. procedure BackSpace;
  532. begin
  533. if (f.bufpos>0) and (f.bufpos=f.bufend) then
  534. begin
  535. WriteChar(#8);
  536. WriteChar(' ');
  537. WriteChar(#8);
  538. dec(f.bufpos);
  539. dec(f.bufend);
  540. end;
  541. end;
  542. var
  543. ch : Char;
  544. Begin
  545. GetScreenCursor(CurrX,CurrY);
  546. f.bufpos:=0;
  547. f.bufend:=0;
  548. repeat
  549. if f.bufpos>f.bufend then
  550. f.bufend:=f.bufpos;
  551. SetScreenCursor(CurrX,CurrY);
  552. ch:=readkey;
  553. case ch of
  554. #0 : case readkey of
  555. #71 : while f.bufpos>0 do
  556. begin
  557. dec(f.bufpos);
  558. WriteChar(#8);
  559. end;
  560. #75 : if f.bufpos>0 then
  561. begin
  562. dec(f.bufpos);
  563. WriteChar(#8);
  564. end;
  565. #77 : if f.bufpos<f.bufend then
  566. begin
  567. WriteChar(f.bufptr^[f.bufpos]);
  568. inc(f.bufpos);
  569. end;
  570. #79 : while f.bufpos<f.bufend do
  571. begin
  572. WriteChar(f.bufptr^[f.bufpos]);
  573. inc(f.bufpos);
  574. end;
  575. end;
  576. ^S,
  577. #8 : BackSpace;
  578. ^Y,
  579. #27 : begin
  580. f.bufpos:=f.bufend;
  581. while f.bufend>0 do
  582. BackSpace;
  583. end;
  584. #13 : begin
  585. WriteChar(#13);
  586. WriteChar(#10);
  587. f.bufptr^[f.bufend]:=#13;
  588. f.bufptr^[f.bufend+1]:=#10;
  589. inc(f.bufend,2);
  590. break;
  591. end;
  592. #26 : if CheckEOF then
  593. begin
  594. f.bufptr^[f.bufend]:=#26;
  595. inc(f.bufend);
  596. break;
  597. end;
  598. else
  599. begin
  600. if f.bufpos<f.bufsize-2 then
  601. begin
  602. f.buffer[f.bufpos]:=ch;
  603. inc(f.bufpos);
  604. WriteChar(ch);
  605. end;
  606. end;
  607. end;
  608. until false;
  609. f.bufpos:=0;
  610. SetScreenCursor(CurrX,CurrY);
  611. CrtRead:=0;
  612. End;
  613. Function CrtReturn:Integer;
  614. Begin
  615. CrtReturn:=0;
  616. end;
  617. Function CrtClose(Var F: TextRec): Integer;
  618. Begin
  619. F.Mode:=fmClosed;
  620. CrtClose:=0;
  621. End;
  622. Function CrtOpen(Var F: TextRec): Integer;
  623. Begin
  624. If F.Mode=fmOutput Then
  625. begin
  626. TextRec(F).InOutFunc:=@CrtWrite;
  627. TextRec(F).FlushFunc:=@CrtWrite;
  628. end
  629. Else
  630. begin
  631. F.Mode:=fmInput;
  632. TextRec(F).InOutFunc:=@CrtRead;
  633. TextRec(F).FlushFunc:=@CrtReturn;
  634. end;
  635. TextRec(F).CloseFunc:=@CrtClose;
  636. CrtOpen:=0;
  637. End;
  638. procedure AssignCrt(var F: Text);
  639. begin
  640. Assign(F,'');
  641. TextRec(F).OpenFunc:=@CrtOpen;
  642. end;
  643. var
  644. x,y : longint;
  645. begin
  646. { Load startup values }
  647. ScreenWidth:=GetScreenWidth;
  648. ScreenHeight:=GetScreenHeight;
  649. WindMax:=(ScreenWidth-1) or ((ScreenHeight-1) shl 8);
  650. { Load TextAttr }
  651. GetScreenCursor(x,y);
  652. TextAttr:=mem[$b800:((y-1)*ScreenWidth+(x-1))*2+1];
  653. lastmode:=mem[$40:$49];
  654. { Redirect the standard output }
  655. assigncrt(Output);
  656. Rewrite(Output);
  657. TextRec(Output).Handle:=StdOutputHandle;
  658. assigncrt(Input);
  659. Reset(Input);
  660. TextRec(Input).Handle:=StdInputHandle;
  661. { Calculates delay calibration }
  662. initdelay;
  663. end.
  664. {
  665. $Log$
  666. Revision 1.2 1999-01-22 11:12:09 florian
  667. + support of font8x8 added
  668. Revision 1.1 1998/12/21 13:07:02 peter
  669. * use -FE
  670. Revision 1.17 1998/12/15 22:42:49 peter
  671. * removed temp symbols
  672. Revision 1.16 1998/12/09 23:04:36 jonas
  673. * fixed bug in InsLine (changed "my" from "WinMaxY -1" to "WinMaxY - WinMinY")
  674. Revision 1.15 1998/11/28 14:09:48 peter
  675. * NOATTCDQ define
  676. Revision 1.14 1998/11/26 23:14:52 jonas
  677. * changed cdq to cltd in AT&T assembler block
  678. Revision 1.13 1998/08/26 10:01:54 peter
  679. * fixed readln cursor position
  680. Revision 1.12 1998/08/19 17:57:55 peter
  681. * fixed crtread with wrong cursor position
  682. Revision 1.11 1998/08/19 14:55:44 peter
  683. * fixed removeline which scrolled too much lines
  684. Revision 1.10 1998/08/18 13:32:46 carl
  685. * bugfix to make it work with FPC 0.99.5 (Delayloop is not correctly
  686. converted by ATT parser)
  687. Revision 1.9 1998/08/15 17:00:10 peter
  688. * moved delaycnt from interface to implementation
  689. Revision 1.8 1998/08/08 21:56:45 peter
  690. * updated crt with new delay, almost like bp7 routine
  691. Revision 1.5 1998/05/31 14:18:12 peter
  692. * force att or direct assembling
  693. * cleanup of some files
  694. Revision 1.4 1998/05/28 10:21:38 pierre
  695. * Handles of input and output restored
  696. Revision 1.3 1998/05/27 00:19:16 peter
  697. * fixed crt input
  698. Revision 1.2 1998/05/21 19:30:46 peter
  699. * objects compiles for linux
  700. + assign(pchar), assign(char), rename(pchar), rename(char)
  701. * fixed read_text_as_array
  702. + read_text_as_pchar which was not yet in the rtl
  703. }