Program SwapCom;

Const
   segm:word=$0040;
   offs:word=$0000;

Var
  apu:word;
  n1,n2:byte;

Function num(x:byte):byte;
var p:string;
Begin
   p:=ParamStr(x);
   If p='1' Then num:=1 Else
   If p='2' Then num:=2 Else
   If p='3' Then num:=3 Else
   If p='4' Then num:=4 Else
   Begin
      Writeln('Virheelliset parametrit !');
      Halt(0);
   End;
End;

Begin
   n1:=2*num(1);
   n2:=2*num(2);
   apu:=MemW[segm:offs+n1];
   MemW[segm:offs+n1]:=MemW[segm:offs+n2];
   MemW[segm:offs+n2]:=apu;
End.
