[fpc-pascal]memw

Anton Tichawa anton.tichawa at chello.at
Sun Feb 23 21:08:37 CET 2003


Hi, James!

On Sunday 23 February 2003 18:44, you wrote:

> This is from an old Turbo Pascal source of the Pascal S compiler source:
>
>           getmem(spnt,((sleng+3) div 16 +1)*16);
>           k := seg(spnt^);
>           memw[k:0] := sleng;
>           memw[k:2] := 0;
>           move(sbuff[1],mem[k:4],sleng);
>
> How would you convert that into FPC syntax for linux ?

just a first approach by heart - i neither tested it, nor did i check the 
syntax. if you need explanation or testing, i can do that. but maybe it works 
at once:

type
  p_words = ^ t_words;
  t_words = array [0 .. maxint] of word;

var
  spnt: p_words;

begin
  getmem(spnt,((sleng+3) div 16 +1)*16);
  spnt ^ [0] := sleng;
  spnt ^ [1] := 0;
  move(sbuff[1], @(spnt ^ [2]),sleng);
end.

----------

"Adas Methode war, wie sich zeigen wird, Tagträume in offenbar korrekte 
Berechnungen einzuweben."

Doris Langley Moore: Ada, Countess of Lovelace (London 1977).

----------

Anton Tichawa
Volkertstrasse 19 / 20
A-1020 Wien
mobil: +43 664 52 07 907
email: anton.tichawa at chello.at

----------



More information about the fpc-pascal mailing list