home *** CD-ROM | disk | FTP | other *** search
- $pagelength(5000)
- start: do;
- declare hhhh byte;
- $include(8096.plm)
- tttt0: procedure interrupt 2; declare d byte; d=0; return; end tttt0;
- key00: procedure; call time(10); end key00;
- key01: procedure; call time(20); end key01;
- key02: procedure; call time(30); end key02;
- key03: procedure; call time(40); end key03;
- key$p: procedure (pa1) byte;
- declare pa1 byte;
- declare (p8279d,p8279c) byte at(0e000h);
- p8279c=(pa1 and 07h) or 40h;
- do case (p8279d and 03h);
- call key00;
- call key01;
- call key02;
- call key03;
- end;
- return p8279d;
- end key$p;
- proc2: procedure (pb1,pb2); /* if then do; else do; */
- declare (pb1,pb2) byte;
- if ((((pb1+pb2) and 03h)=03h) or (((pb1-pb2) and 07h)=07h))
- then do; pb1=pb2; end;
- else do; pb2=pb1; end;
- pb2=(pb2+4)*(pb1+4);
- end proc2;
- proc3: procedure (pc1,pc2) word;
- declare (pc1,pc2) word, i byte;
- do i=1 to 10;
- pc1=pc1+2;
- end;
- do while pc2=0;
- pc1=pc1+1; pc2=pc2-1;
- end;
- return pc1;
- end proc3;
- mainp: do;
- declare (a,b,start$a$d) byte;
- declare (c,d,samp$v) word, v(4) word;
- declare (K,PK,TI,TD,pr) dword; declare (e,f,j) longint;
- declare (g,h,l) integer, (aa,bb,cc) dword;
- declare m$array(6) real, (dd,ee,ff) real;
- declare adr1 address;
- call init$real$math$unit; call set$real$mode(033eh);
- K=164; PK=5; TI=235; TD=22;
- v(1)=0; v(2)=0; v(3)=0;
- do while 1=1; watchdog=1eh; watchdog=0e1h;
- a=123; b=456; c=12345; d=(c+b)/a; /* byte and word */
- g=-3; h=5; l=g*h; h=l/g; /* integer */
- e=4; f=2222222h; j=f*e; f=j/2; /* long (32 bit) */
- dd=2.1101e+12; ee=2.0e+4; ff=dd*ee; /* real multiply */
- dd=4.2468e+12; ee=2.0e+6; ff=dd/ee; /* real devide */
- a=key$p(b); call proc2(a,b); c=proc3(c,d); /* procedure */
- start$a$d=05; v(0)=double(samp$v); /* sample */
- pr=K*((v(0)-v(1))+TI*v(0)+TD*(v(0)+v(2)-2*v(1))); /* P I D */
- do a=1 to 3; b=0; v(a)=v(a-1); end; /* loop */
- c=proc3(c,d); aa=123456789; bb=4; cc=aa/bb; /* dword (32 bit) */
- end;
- end mainp;
- end start;