home *** CD-ROM | disk | FTP | other *** search
/ Vectronix 2 / VECTRONIX2.iso / FILES_01 / KBMONITO.LZH / KBDMON.1_0 / KBDMON.PAS next >
Pascal/Delphi Source File  |  1992-08-30  |  2KB  |  63 lines

  1. program kbdmom;
  2. { Kleiner Monitor für den Tastaturprozessor }
  3. {$R-,S-,I+,F+}
  4.  
  5. uses km_comds,
  6.      km_inout;
  7.  
  8.  
  9. {*** Prozedur über Pointer aufrufen ***}
  10. procedure callptr(procptr :pointer);
  11. assembler;
  12. asm
  13.   move.l  procptr,a0
  14.   jsr     (a0)
  15. end;  
  16.  
  17.  
  18. var i,clpos1,clpos2      :integer;
  19.     cmdfnd :boolean;
  20.     cmdln  :string;
  21.  
  22. {*** Hauptprogrammm ***}      
  23. begin
  24.   inststatvec;
  25.   writeln;
  26.   writeln('Speichermonitor für den ST-Tastaturprozessor V1.0');
  27.   writeln('W. Schneider, Berlin 05/92');
  28.   writeln;
  29.   mhelp;
  30.   repeat
  31.     cmdln:='';
  32.     write('#'); inputln(cmdln); writeln; 
  33.     if cmdln<>'' then 
  34.     begin
  35.       cmdfnd:=false; cmdln:=cmdln+#0;
  36.       for i:=0 to 31 do if comnames[i]=upcase(cmdln[1]) then
  37.       begin
  38.         cmdfnd:=true;
  39.         clpos1:=2; clpos2:=2;
  40.         paramcnt:=0;
  41.         while cmdln[clpos2]<>#0 do
  42.         begin
  43.           while cmdln[clpos1]=' ' do inc(clpos1);
  44.           while not(cmdln[clpos2] in [',',#0]) do inc(clpos2);
  45.           if clpos2>clpos1 then
  46.           begin 
  47.             inc(paramcnt);
  48.             strpars[paramcnt]:=copy(cmdln,clpos1,clpos2-clpos1);
  49.             hexpars[paramcnt]:=rdhex(strpars[paramcnt]);
  50.           end; 
  51.           if cmdln[clpos2]<>#0 then
  52.           begin
  53.             inc(clpos2,1);
  54.             clpos1:=clpos2;  
  55.           end;    
  56.         end;  
  57.         callptr(comaddrs[i])
  58.       end;
  59.       if not(cmdfnd) then writeln('Unbekanntes Kommando!');
  60.     end;    
  61.   until false;
  62. end.          
  63.