{$nodebug} procedure sys(var s:array[slow..shigh:integer] of integer); { UUO (chr$(6%)) SYS calls - EFM } { The array used in the call must be dimensioned either to 0..30 or 1..30, } { and should contain the values which would go in CHR$() in a BASIC SYS call. } { Use -1 for 255. } { For example, for BASIC'S SYS(CHR$(6%)+CHR$(7%)+CHR$(255%)) } { use x[1]:=6; x[2]:=7; x[3]:=-1; sys(x); } { The values returned are the same as in BASIC. } type signedbyte = -128..127; var firqb origin 402B : packed array [0..31] of signedbyte; i : integer; begin if s[1] <> 6 then begin writeln('Error - First byte must be = 0.') end else if S[2]+128 in [105,106,107,108,118,121,123,124,146,150] { above all include +128 to get in range 0..255 } { actual values are -23,-22,-21,-20,-10,-7,-5,-4,18,22 } then writeln('Error - SYS call not available.') else begin firqb[0] := 0; firqb[1] := 0; firqb[2] := 0; for i := 2 to 30 do firqb[i+1] := s[i]; emt(255); emt(54); for i := 1 to 30 do begin s[i] := firqb[i+1]; if s[i]<0 then s[i] := s[i] + 256 end; if slow = 0 then s[0] := 30; if firqb[0] <> 0 then begin i := firqb[0]; writeln('Error in executing SYS call.'); writeln('Error number ',I:1) end end end; {$debug}