home *** CD-ROM | disk | FTP | other *** search
- {$m 5000,2000,10000}
- program setram;
-
- uses
- autocopy,umcb;
-
- var
- mcb : mcbtyp;
- min,max : word;
- endseg : word;
- w,i : word;
- j : integer;
- s : string[5];
-
- begin
- if paramcount<2 then begin
- writeln('setram nnnn mmmm');
- writeln('n Anfangssegment des zusätzlichen Ramspeichers.');
- writeln('m Endsegment des zusätzlichen Ramspeichers.');
- writeln('Angaben als Hex-Zahlen.');
- writeln('Bitte keinen EMS-Speicherbereich angeben!');
- halt(1);
- end;
- s:=paramstr(1);
- if upcase(s[ord(s[0])])='H' then dec(s[0]);
- if s[1]<>'$' then s:='$'+s;
- val(s,min,j);
- if j<>0 then halt(1);
- s:=paramstr(2);
- if upcase(s[ord(s[0])])='H' then dec(s[0]);
- if s[1]<>'$' then s:='$'+s;
- val(s,max,j);
- if j<>0 then halt(1);
- w:=min;
- repeat
- i:=not memw[w:0];
- memw[w:0]:=i;
- if memw[w:0]<>i then min:=w+$100;
- inc(w,$100);
- until (w>=max) or (i=memw[w-$100:0]);
- repeat
- i:=not memw[w:0];
- memw[w:0]:=i;
- if memw[w:0]<>i then max:=w;
- inc(w,$100);
- until (w>=max) or (i<>memw[w-$100:0]);
- if min=max then halt(1);
- with mcb do begin
- init;
- while (id<>#0) and next do;
- endseg:=mcbseg+succ(len);
- if seg(mcb^)>endseg then exit;
- if seg(mcb^)<>pred(endseg) then begin
- dec(mcb^.len);
- mcb^.id:='M';
- if next then;
- end;
- mcb^.id:='M';
- mcb^.psp:=8;
- mcb^.len:=min-endseg;
- if next then;
- mcb^.psp:=0;
- mcb^.id:='Z';
- mcb^.len:=pred(max-min);
- end;
- end.