0707070000020076441006440001460001440000010441160425331563300000600000003373FilesFiles Install Name Remove Size /usr/local/mod2 /usr/lib/libmod2.a /usr/local/lib/mod2 /usr/local/lib/mod2/Arguments.def /usr/local/lib/mod2/CLibrary.def /usr/local/lib/mod2/Clock.def /usr/local/lib/mod2/Conversion.def /usr/local/lib/mod2/Coroutine.def /usr/local/lib/mod2/ErrorHandl.def /usr/local/lib/mod2/FileInform.def /usr/local/lib/mod2/FileSystem.def /usr/local/lib/mod2/InOut.def /usr/local/lib/mod2/M2System.def /usr/local/lib/mod2/MathLib0.def /usr/local/lib/mod2/Procs.def /usr/local/lib/mod2/Storage.def /usr/local/lib/mod2/Strings.def /usr/local/lib/mod2/Terminal.def /usr/local/lib/mod2/Arguments.sym /usr/local/lib/mod2/CLibrary.sym /usr/local/lib/mod2/Clock.sym /usr/local/lib/mod2/Conversion.sym /usr/local/lib/mod2/Coroutine.sym /usr/local/lib/mod2/ErrorHandl.sym /usr/local/lib/mod2/FileInform.sym /usr/local/lib/mod2/FileSystem.sym /usr/local/lib/mod2/InOut.sym /usr/local/lib/mod2/M2System.sym /usr/local/lib/mod2/MathLib0.sym /usr/local/lib/mod2/Procs.sym /usr/local/lib/mod2/Storage.sym /usr/local/lib/mod2/Strings.sym /usr/local/lib/mod2/Terminal.sym /usr/local/lib/mod2/SYSTEM.def /usr/local/lib/mod2/Arguments.imp /usr/local/lib/mod2/Clock.imp /usr/local/lib/mod2/Conversion.imp /usr/local/lib/mod2/Coroutine.s /usr/local/lib/mod2/ErrorHandl.imp /usr/local/lib/mod2/FileInform.imp /usr/local/lib/mod2/FileSystem.imp /usr/local/lib/mod2/InOut.imp /usr/local/lib/mod2/M2System.imp /usr/local/lib/mod2/MathLib0.imp /usr/local/lib/mod2/Procs.imp /usr/local/lib/mod2/Storage.imp /usr/local/lib/mod2/Strings.imp /usr/local/lib/mod2/Terminal.imp /usr/local/lib/mod2/Makefile /usr/local/lib/mod2/doc /usr/local/lib/mod2/doc/mod2.1 /usr/local/lib/mod2/doc/builtin.tr /usr/local/lib/mod2/doc/datarep.tr /usr/local/lib/mod2/doc/howto.upc /usr/local/lib/mod2/doc/mod2.guide 0707070000020037211007550001460001440000010400740424432102200001000000001350Install echo '**** Installing Modula-2 compiler ...' cd /usr/local chown bin mod2 /usr/lib/libmod2.a lib/mod2 lib/mod2/* lib/mod2/doc/* chgrp bin mod2 /usr/lib/libmod2.a lib/mod2 lib/mod2/* lib/mod2/doc/* chmod 644 /usr/lib/libmod2.a lib/mod2/* lib/mod2/doc/* chmod 755 mod2 lib/mod2 lib/mod2/doc echo echo 'Miscellaneous information:' echo echo ' 1. The command to invoke the compiler is "mod2".' echo ' 2. You must add /usr/local to the command search path' echo ' (check /etc/profile or /etc/localprofile).' echo ' 3. The definition modules for the included libraries are in' echo ' /usr/local/lib/mod2/*.def' echo ' 4. Documentation is in /usr/local/lib/mod2/doc.' echo sleep 10 echo '**** Modula-2 compiler installation complete.' 0707070000020037531006440001460001440000010401020424431661200000500000000026NameModula-2, version 1.0 0707070000020037661007550001460001440000010403240424160646500000700000000076Removerm -rf /usr/local/mod2 /usr/lib/libmod2.a /usr/local/lib/mod2 0707070000020037521006440001460001440000010400760437017115200000500000000004Size950 0707070000020062241007550001460001440000010614750432317074700002000000456674/usr/local/mod2R#Lb X%$ .textX .data %@.bss % %$.lib I I/< IN1X OQ./HJf/H#0Na`04.&n8.SD$nEHG(666Sn`4.&nG(67n7y U&nRS` ?<\aV 9 %Uf N f`* 9# %Ug 9% %Uf?< a ```N^NtNVB<N ub&n&Hna&nk .b$n&R7n` ?<Ra<?<aHna/./.a$n&R7n4+ko/ ?<?a&_7k'n $n7jJ9 Uf Jng/ ?+?+?+HkN '&_N^NtNV&n& %H 9% %UfHnaVJg &n +f&n$n$` ?<4a 9 %UfN f&n-S/.a$n&R$+ g>$. %$f($n&R$+ %(f$n&R'y %$ ` ?<=ax 9 %Uf N f`?<aZ 9 %UfN f`H 9 %UfN fB<N ub&n&t-BBn 9% %UfRB?9 %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+ cx` g /.NN/9 Ul/.N v0` ?<2a2N f` ?< a 9 %Uf N f` 9% %Uf?< a```<&?< aN^NtNV 9% %Uf(B?9 %V<N s-_N [N f` ?< a 9 %Uf N f` 9% %Uf?< ap```<&?< anN^NuNV`NV&n -k 9% %Ug 9= %Uf-nB. 9= %UfN f| 9% %Uf:Jg&n6 %V&n-k ` ?<BaN [N f` ?< a 9 %Uf N f`< 9% %Uf?< a`$ 9= %Uf?< axN f```b<?< anHna^-n$.gv&n$+gB$n&j +f(&n +f$n&j$+ &n g ?<Ea&n+.g ?<Da&n-k ` 9& %Uf N f` 9% %Uf?< a```pJg ?<Fa<?<aN^NtNVt-BBn 9% %Ug 9= %Uf>-nB. 9= %UfN f| 9% %Uf4B?9 %V./.N x-_N [N f&nB+` ?< a 9 %Uf N f`< 9% %Uf?< a`$ 9= %Uf?< aN f```h<?< aHna-n$.g&&n'n/.HnNq&n-k ` 9& %Uf N f` 9% %Uf?< a```t-BJg$-n&n-k &n'n -n`&n 'n$n &j4.JBlDB7B<?<aN^NtNV&n -k y Uf$n &j4+PB=B`$n &j4+B =BJgdB&n?<N s-_&n$n'jBk7y U$njB+/ /.HnNq&_7n&n-k `N^NtNVB?9 %VN r&n &&n JgV$n &R +fF$n &RJk&f8$n &R&kJkf Jy Ug*$n &R&kJg $n &R&k4+y Uf$n &R&kJkf$n &R&k|<%?< a^ 9 %UfN f&n //.a 9 %Uf`N f 9% %UfBHnaDJg&&n +f$n &R$n$*g ?<Ga` ?< a`$n &R$+ % %Uf8N f$n &R&kHnN`$n &R4.UB&k7B`&n //.a$n &R&kJg4.TB?N '$n &R&kJk g$n &R&k?+ N ("$n &R&k7y U$n &R&kB$n &R&kJ+g&n /NNBnHn$n &R&k?+Ni6HnN`Bn&n /B'HnHnah?.?.N (ZSy UN xN yr<&?< aܤN^NtNVB.<%?< a܊B?9 %V<N s&n&N [Ry V$n&R7y V&=y Ua<&?< a@<N xL 9E %Ug 9F %Ufpt-B 9E %UfHN f 9% %U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&n/+ N&n/+ &n/+N L` ?<{aNu&n +g,&n +g&n +g&n +f*&n/+ N&n/+ &n/+N `&n + g&n + f&n/+ &n/+NF`N&n + f8&n/+N &n/+ N&n/+ &n/+N ` ?<|aNu&n&k +f&n&k J+ fT&n&k +b$&n/+N &n/+<a`&n&k +g ?<qa`&n/+B'a&n/+ <a`&n&k +g$n$j&R +f&n&k +f8&n&kJ+ g&n/+B'a\`&n/+<aH`N&n&k +b$&n/+N &n/+<a`?<qa&n/+<a`?<qa&n/+<a&n&kJkg.Bg&n&k ?+&n&k?+N (&n&k 7_&n&k$n$j k&n&k$n$j 5k Nu&n +c,&n + g&n + g&n +f&&n/+ &n/+N &n|`T&n + g&n + f&&n/+ &n/+NВ&n|`?<~az&n|&n/+ &n+aNu&n +c,&n + g&n + g&n +f&&n/+ &n/+N &n|`T&n + g&n + f&&n/+ &n/+NВ&n|`?<~a&n|&n/+ &n+aNu&n +g&n +f&&n/+ &n/+N &n| `&n +c&n +f&&n/+ &n/+N &n|`T&n + g&n + f&&n/+ &n/+NВ&n| `?<~a&n|&n/+ &n+aNu&n +g&n +f&&n/+ &n/+N &n|`&n +c&n +f&&n/+ &n/+N &n|`&n + g&n + f&&n/+ &n/+NВ&n|`b&n + fB&n/+ N&n/+N &n/+ &n/+N &n|`?<~aޘ&n|&n/+ &n+aNu&n +g&n +f&&n/+ &n/+N &n|`&n +c&n +f&&n/+ &n/+N &n|`T&n + g&n + f&&n/+ &n/+NВ&n|`?<~aݰ&n|&n/+ &n+aNu&n +g&n +f&&n/+ &n/+N &n| `&n +c&n +f&&n/+ &n/+N &n|`&n + g&n + f&&n/+ &n/+NВ&n| `b&n + fB&n/+ N&n/+ N &n/+ &n/+N &n|`?<~az&n|&n/+ &n+aްNutJ*jd:GSB BctB43 N N^Nt/. aH$n &Rk/.a4$n&Rk&n $&ngZ .f6 .f,&n +f&n kb&n $n$` .f< .f2&n +f$&n kb&n$n $|` .f: .f0&n +f"&n Jm&n$n $|` .f2 .g .f&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OWG E xtOWG XE tOWG nE tOWG ~E htOWG E tOWG E tOWG E XtOWG E tOWG &E tOWG XE tOWG E tOWG E 8tOWG E tOWG E tOWG E (tOWG E xtOWG E tOWG &E tOWG BE htOWG E tOWG E tOWG E XtOWG E tOWG (E tOWG FE HtOWG E tOWG E tOWG E 8tOWG  E tOWG ,E tOWG PE (tOWG tE xtOWG E tOWG E tOWG E htOWG E tOWG &E tOWG LE XtOWG vE tOWG E tOWG E HtOWG $E tOWG \E tOWG tE 8tOWG E tOWG E tOWG E (tOWG >E tOWG tE tOWG E htOWG E tOWG E XtOWG E tOWG 4E tOWG HE HtOWG jE 8tOWG E 8tOWG E tOWG E tOWG HE (tOWG nE xtOWG E tOWG E tOWG E htOWG E tOWG E tOWG  E XtOWG VE tOWG jE tOWG E HtOWG E tOWG E tOWG  E 8tOWG ,E tOWG VE tOWG E tOWG E tOWG E XtOWG E tOWG E tOWG $E HtOWG DE tOWG fE xtOWN^NuBN^NuNV gN^NuNNoN X N %` dNV?.N X2N^NtNV?.N &N^NtNVJnc4. n =B Sn`=n `N^NtNV&n$. %,f/ /.?. /.N֢&_`&| 7n N^Nt NV&n$ %,f/ /.N&_`" +b/ HnN&_/ /.HnN&_ +fd/ 4.x bB /.NN^NtNV/.?<N`&n& %,?</.aN^NtNV?</.aN^NtNV?</.aN^NtNV?</.aN^NtNV&n $ %,f =|`=|?./. /.aN^NtNV&n $ %,f =|`=|?./. /.aN^NtNV&n $ %,f =|`=|?./. /.aN^NtNV&n $ %,f>&n +f& <&n$+//N f ?<al=| `=|?./. /.a8N^NtNV&n $ %,f>&n +f& <&n$+//N f ?<a=| `=|?./. /.aN^NtNV&n $ %,f =| `=|?./. /.aN^NtBN^NuNV gN^NuNoN X N %NEr`TNV-n=n `N^NtNV?.N X2N^NtNV?.N &N^NtNV/.N &xN^NtNVJ.f ?<aN^NtNV|t4. J=Bt4. BPB=B4.8. Dcx` f B.`( nf4.8. Dcx` fB.J.f ?<a0N^NtNV&n-S&n +f &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&n-k`xt&y ='B&y ='y =N^NuNVHnBgNo&n +fX&n-k"Jg/.a&n-k`aHy U|?<N xHy U|$n&j?+N x`^&n +fP&n-kJg/.a&n-k`aHy U|?<N xHy U|&n?+&N x/.NpLN^NtNVHy U|?<N xHy U|?. N xHy U|?.N xHy U|N $B'N 6Jf?<N X2N JN^Nt&y %H7|&y g7|&y %07|&y %$7|&y %(7|&y %87|&y %,7|&y g7|&y %47| &y g7| &y %@7| &y %D7| &y g7| &y g7|&y g7|BN^NuNV =gN^NuN N .N``NV Uh$9 >| >g# >| >Hy %dHnN Hy %d/9 >xN nTfN H49 >ty >g49 >ty >vgN H?<Hy VN `?9 >t?<N ?<Hy \N `B.=|Hy %dHnN . gB'Hy %dN \Jf|J.ft n+fL3 >t >t. B dt. B g|? nFd Rn`| |.N .Hy %dHnN `jJ.f . f .N .3 >t >v# >pHy %d/.N ?< Hy `N `?.?<N ?<Hy lN ` no?<4Hy pN ``4.PG iX?<OHs(N `N H3 >N^NtNV Uh49 >nf9 >9 %Ug|Hy %dHy >pN nTfN H?< Hy N `?.?<N ?<Hy N `4.PG iX?<OHs(N `N H3 >N^NtNVHy %dHy =N N^NuNV4. G %hx3 =DJnfBn `v`n4. G %h8.E %h3 2@g04. G %hx3 4.G %h|3 F=D `(` 4. RB=B 4.RB=B4.SB=B`~N^NtNV3 = %VN^NuNV49 %VRB3 = y/ =o?<[aJ3 =a9 =.f`b 9 =d2?<-a 9 =fRy >tHy %dHy >xN `&49 =G %h = 49 =RB3 =`a49 %VG %h89 =y %V 49 %VG %h 3 f0# %U3 %X49 %VRBG %hx3 3 %Z`P$ %U49 %VG %h 3 f249 =G %hB3 49 =RB3 =49 %VG %h N^NtNV49 %VRB3 = y/ =o?<[a3 =49 =G %h = 49 =RB3 =a 90 =eV 99 =c 9 = ae zb_ Ae,9 = ae zb_ Zc 9_ =g|49 %VG %h89 =y %V Bn=|,4.nJ=BBg?9 %V4.BG =?3 aJ_n =n` 4.RB=B4.ne n,dX .(3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f"Ry >tHy %dHy >xN aX`8t 9 =g 9 =f a6`?<+af =`D`<$<9 =f =`"` 9 =c a```R# >| >Hy %dHy >|N t9 =`<H %UB9 =NuB9 %UaNu<"a^Nu %UaNuB9 %UavNuB9 %UajNu %Ua\Nu<'a NuaL 9* =fHVaa`  %UNu %UaNu %UaNu %UaNu %UaNu %UaNua 9. =fa %U`  %UNu %UaNuaNNua 9= =fa" %U`  %UNu& %UanNuah 9= =faX %U`& 9> =fa< %U`  %UNu %UaNua 9= =fa %U`  %UNuB9 %UaNuB9 %UaNuaNuaNu %UaNuB9 %UaNu %UaNu %UaNuB9 %UaNuaNu %UavNu' %UahNu %UaZNu! %UaLNu %Ua>Nu .B B_ctB43 N N^NuNV4. RBgRB&n-O$OSBQ4. TB=B3 %V =49 =n B0lj49 %VG %h8. 49 %VRB3 %V4.UBBn?4.Wn049 %VG %h8.$n@ 49 %VRB3 %VRnhT=y =`N^NtNV =B9 Uht# >p3 >tt# >xBy >B9 >Jy =f3 %V =` 3 = %VNN^NuNV4. RBgRB&n-O$OSBQ49 >TBG = 49 >TBG =7 %V Bn4. =B49 %VG %h8.TD Ry %V4.nb649 %VG %h8.$n@ 49 %VRB3 %V4.RB=B`49 >TRB3 >TN^NtBy >T %h3 %VBy =t# >|By >t Y/N 2# >X 9 >X$9 >XY//N l# >\ 9 >\$9 >\Y//N l# >` 9 >`$9 >`Y//N l# >d 9 >d$9 >dY//N l# >h 9 >h$9 >hY//N l# >l<?<Hy aP<?<Hy a><,?<Hy a,<?<Hy a<?<Hy a< ?<Hy a<?<Hy a<?<Hy a<?<Hy a<(?<Hy a<4?<Hy a<?<Hy a<!?<Hy ax<?<Hy af<8?<Hy aT<=?<Hy aB<3?<Hy a0<:?<Hy a<)?<Hy a <1?<Hy  a<E?<Hy a</?<Hy a<?<Hy a<?<Hy a<6?<Hy a<??<Hy a<D?<Hy an<A?< Hy a\<B?< Hy aJBN^NuNV >gN^NuNoN X N ` NV-nJf`JBg?. &n?N [=_Jn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>?. /.N :Hy >< N N^NtBN^NuNV >gN^NuN `NVBt.xB&n //N1P. VD I N^NtNV4. RBgRB&n-O$OSBQB&n//.N1P. VD I N^Nt NV=| nb.4.G >$n((f =n `Rnd=| `N^NtNV4. RBgRB&n-O$OSBQBn| ndJ.g4.G >J(fB.4.G >G($n&Bn/ Bg?. /.N &4&_=B=|4.nd*4.nb4.E8."n@ Rn`4.nb4.EB2 `Rn`BN^Nt NVBn| ndHJ.g@4.G >(3(&nf4.G >x'(B.`Rn`N^NtNVy I `N^NuNV$90`Hy >?< Hy aNuHy >?<Hy aNuHy >?<Hy &aNuHy >?<Hy 6aNuHy >?<Hy NaxNuHy >?<Hy XabNuHy >?<Hy raLNuHy >?<Hy a6NuHy >?<Hy a NuHy >?< Hy a NuHy >?<Hy aNuHy >?<Hy aNuHy >?<Hy aNuHy >?< Hy aNuHy >?<Hy aNuHy >?<Hy !aNuHy >?< Hy !apNuHy >?<Hy !$aZNuHy >?< Hy !6aDNuHy >?<Hy !Fa.NuHy >?< Hy !VaNuHy >?<Hy !faNuHy >?<Hy !xaNuHy >?<Hy !aNuHy >?<Hy !aNuHy >?< Hy !aNuHy >?< Hy !aNuHy >?<Hy !a~NuHy >?< Hy !ahNuHy >?<Hy !aRNuHy >?< Hy "a?< Hy "a&NuHy >?<Hy "*aNuHy >?<Hy "JaNuHy >?<Hy "haNuHy >?<Hy "aNuHy >?<Hy "aNuNuHy >?< Hy "aNu&< aN^NuNV&n$ >gL&n$ >g<&n$ >g,B&n/N1FX.-_ I /.aV`B9 I N^NtNV4. RBgRB&n-O$OSBQB/.N1X.JWD I N^NtNV4.RBgRB&n-O$OSBQ4. RBgRB&n-O$OSBQB/./.N1P.Jf?./.aL`B9 I N^Nt NV&n-St&n+ VDB `N^NtNV&n-St&n+ VDB `N^NtNV&n-St&n+ VDB `N^NtNV&n-St&n+ VDB `N^NtNV&n-St&n+ VDB `N^NtNV&n-St&n+ VDB `N^NtNV&n-St&n+ VDB `N^NtNV&n-St&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Hy I< N Rn`Hy I?<Hy I N :N^NtNV/. ?.?<Hy I N Bg?<Hy I N &4SB=B4.n=B=|4.nnHy I< N Rn`Hy I?<Hy I N :N^NtNV?. ?.?<Hy I N Bg?<Hy I N &4SB=B4.n=B=|4.nnHy I< N Rn`Hy I?<Hy I N :N^NtNV/. ?.?<Hy I N ,Bg?<Hy I N &4SB=B4.n=B=|4.nnHy I< N Rn`Hy I?<Hy I N :N^NtNV/.?. ?. .?<Hy I N Bg?<Hy I N &4SB=B4. n=B=|4.nnHy I< N Rn`Hy I?<Hy I N :N^Nt NV/. ?. ?.<fa\N^NtNV/. ?. ?.<ea>N^Nt# > I# > IB9 IBN^NuNV IgN^NuN 2N `NVG #(EtW=|Sn$.=B$.-B n d4.B0=B`4.B7=B4.G8. nfB.?<HnN nN N^NtNV n$Y-B=@4.`?< Hy #@N nNu?<Hy #PN nNu?<Hy #hN nNu?<&Hy #N nNu?<&Hy #N nNu?<1Hy #N nNu?<Hy $ N nNu?<Hy $N nNu?<Hy $0N nNu\nG BctB43 N /.a4.xBR/N1xXN^NuNVH<$&(*HDHEHABBمCمHABBBCHBHCԃԄ "Jg<L|gXO||G|~mF H@HFB@H@2Ё"HAHFЁHD؀kSEؼdREJEk|m NqpaB` -D`N^NtNV(. ,..BGfpaD<BEgV<✚G|HF⌈0BDHD8 H@∀HDkSEؼdREJEk|m NqpaB` -D`N^NtNVpaN^NtNV . ".$j ļfB$j ļfBN^NtNV .@-@ `N^NtNV .-@ `N^NtNV .Jg*2<bH@|bQAU-@ `N^NtNV .Jj g` BA<☒|lB`|DAlNqpa⨰b-@ `N^NtNVLL H0N1PO# I# IL IH`N^NtNVLL H0N1PO# I# IL IH`N^NtNVLL H0N1PO# I# IL IH`N^NtNVLL H0N1PO# I# IL IH`N^NtNVpaN^NtNVLL H0N1POJN^NtNVLH I 9 I@# IL IH`N^NtNVLH I 9 I# IL IH`N^NtNV .N1# I# IL IH `N^NtNVLH I 9 I"9 IN1-@`N^NtNV .N1# I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ROR: Cannot fork the link editor, /bin/ld Done linking Executable file: a.out Linking failed Linking failed.sym.sym.sym Output symbol file: ERROR: symbol file not created.o Unlinked COFF output file: Usage: mod2 [-rfvc] [-o outfile] filename [...]No source file namerfvcdo:-orfvcdo:No source file nameToo many source file names on command lineToo many source file names on command lineNo source file name/bin/ld/lib/crt0s.o/lib/shlib.ifileModula-2 Compiler for the AT&T Unix PC, Version 1.0 Source file: : File Not Found.text.data.bss s_name: s_paddr: 0x s_size: s_scnptr: 0x s_relptr: 0x s_lnnoptr: 0x s_nreloc: s_nlnno: s_flags: 0x/tmp/m2symXXXXXXERROR: cannot create temporary file in /tmp for symbol table/tmp/m2strgXXXXXXERROR: cannot create temporary file in /tmp for string tableM2System_argcM2System_argvM2System_environmain*** ERROR - could not find defining module for symbol M2System_argcM2System_argvM2System_environ not enough internal heap space in compilerIdentifier expected, Comma expected; Semicolon expected (perhaps on previous line): Colon expected. Period expected (perhaps on previous line)) Right parenthesis expected] Right bracket expected} Right brace expected= Equal sign expected:= Assignment expectedEND expected.. Ellipsis expected( Left parenthesis expectedOF expectedTO expectedDO expectedUNTIL expectedTHEN expectedMODULE expectedIllegal digit or character in numeric constantIMPORT expectedFactor starts with illegal symbolIdentifier, (, or [ expectedIdentifier, ARRAY, RECORD, SET, POINTER, PROCEDURE, (, or [ expectedType followed by illegal symbolStatement starts with illegal symbolDeclaration followed by illegal symbolStatement part is not allowed in definition moduleExport list not allowed in program or definition modulesEXIT not inside a LOOP statementIllegal character in numberNumber too largeComment without closing *)Illegal non-printable control character in source fileString cannot extend across another lineUnexpected symbol in statementIdentifier not declared or not visibleObject should be a constantObject should be a typeObject should be a variableObject should be a procedureObject should be a moduleType should be a subrangeType should be a recordType should be an arrayType should be a setIllegal base type of setIncompatible type of label or of subrange boundMultiply defined case (label)Low bound > high boundMore actual than formal parametersFewer actual than formal parametersMore parameters in I than in DParameters with equal types in I have different types in DMismatch between VAR specificationsMismatch between type specificationsMore parameters in D than in IMismatch between result type specificationsFunction in D, pure procedure in IProcedure in D has parameters, but not in ICode procedure cannot be declared in definition moduleIllegal type of control variable in FOR statementProcedure call of a functionIdentifiers in heading and at end do not matchRedefinition of a type that is declared in definition partImported module not foundUnsatisfied export list entryIllegal type of procedure resultIllegal base type of subrangeIllegal type of case expressionWriting of symbol file failedSymbol file versions do not matchError in format of symbol fileSymbol file for imported module not successfully openedProcedure declared in definition module, but not in implementationIn {a..b}, if a is a constant, b must also be a constantToo many identifiersToo many casesToo many exit statementsIndex type of array must be a subrangeSubrange bound must be less than 2^15Too many global modulesToo many procedure in definition moduleToo many structure elements in definition moduleMultiple definition within the same scopeIllegal use of typeIllegal use of procedureIllegal use of constantIllegal use of typeIllegal use of procedureIllegal use of expressionIllegal use of moduleConstant index out of rangeIndexed variable is not an array, or the index has the wrong typeRecord selector is not a field identifierDereferenced variable is not a pointerOperand type incompatible with sign inversionOperand type incompatible with NOTx IN y: type(x) # basetype(y)Type of x cannot be the basetype of a set, or y is not a set{a..b}: type of either a or b is not equal to the base type of the setIncompatible operand typesOperand type incompatible with *Operand type incompatible with /Operand type incompatible with DIVOperand type incompatible with MODOperand type incompatible with ANDOperand type incompatible with +Operand type incompatible with -Operand type incompatible with OROperand type incompatible with relationProcedure must be declared at level 0Result type of P does not match that of TMismatch of a parameter of P with the formal type list of TProcedure has fewer parameters than the formal type listProcedure has more parameters than the formal type listAssignment of a negative integer to a cardinal variableIncompatible assignmentAssignment to non-variableType of expression in IF, WHILE, UNTIL clause must be BOOLEANCall of an object which is not a procedureType of VAR parameter is not identical to that of actual parameterType of RETURN expression differs from procedure typeIllegal type of CASE expressionStep in FOR clause cannot be 0Illegal type of control variableIncorrect type of parameter of standard procedureThis parameter should be a type identifierString is too longIncorrect priority specificationExported identifier collides with declared identifierSize of value returned by function too large; cannot be > 8 bytes/ division not implemented for INTEGER or CARDINAL typesREM operation on constants not implementedInteger too small for sign inversionSet element outside word rangeOverflow in multiplicationOverflow in divisionDivision by zero, or modulus with negative valueOverflow in additionOverflow in subtractionCardinal value assigned to integer variable too largeSet size too largeArray size too largeAddress too large (compiler error?)Character array component cannot correspond to VAR parameterIllegal store operation (compiler error?)Set elements must be constantsExpression too complex (stack overflow)Double precision multiply and divide are not implementedOutput file not openedOutput incompleteToo many external referencesToo many strings - reduce the number of string constantsProgram too longCannot CIMPORT entire C moduleNo effective address possible???Internal compiler register errorM2SystemM2System_HALTXM2System_MULU32M2System_DIVU32M2System_MULS32M2System_DIVS32M2System_FADDsM2System_FSUBsM2System_FMULsM2System_FDIVsM2System_FREMsM2System_FCMPsM2System_FNEGsM2System_FABSsM2System_FLOATsM2System_TRUNCsM2System_FADDdM2System_FSUBdM2System_FMULdM2System_FDIVdM2System_FREMdM2System_FCMPdM2System_FNEGdM2System_FABSdM2System_FLOATdM2System_TRUNCdM2System_FLONGM2System_FSHORT*** PC: .file.text.data.bssSystemInternal compiler ERROR: M2LM.SetSignal(ignore): Internal compiler ERROR: M2LM.SetSignal(handler): : bad file format/usr/local/lib/mod2/ Input symbol file: ** Symbol file for newer than this symbol file which imports it: line : **** Error : Internal compiler error; contact system administrator **** error : BYDOIFINOFORTOANDDIVENDFORMODNOTREMSETVARCASECODEELSEEXITFROMLOOPTHENTYPEWITHARRAYBEGINCONSTELSIFUNTILWHILEEXPORTIMPORTMODULERECORDREPEATRETURNCIMPORTFORWARDPOINTERPROCEDUREQUALIFIEDDEFINITIONIMPLEMENTATIONBOOLEANCHARCARDINALINTEGERBITSETLONGCARDLONGINTREALLONGREALPROCBYTEWORDADDRESSADRTSIZEINLINEREGSETREGLONGSHIFTSHORTSYSTEMFALSETRUENILABSCAPCHRDECEXCLFLOATFLOATDHALTHIGHINCINCLMAXMINODDORDSIZETRUNCTRUNCDVALArg error : not enough argumentsNot super-userNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead only file systemToo many linksBroken pipeMath arg out of domain of funcMath result not representableNo message of desired typeIPC identifier removedFile region locking deadlockUnknown errorrwar+w+a+FileSystem.Release: File not found in FileTab: CloseInput: CloseOutput: at address 0x--------.Program HaltedCase index out of rangeNo-return from function errorIEEE floating point arithmetic overflowREM operation on floats not implementedIndex/Range error or arithmetic overflow/underflowDivision by zeroNEW: Heap OverflowUnknown index to M2System.HALTXERROR: cannot catch SIGILL signal: ERROR: cannot catch SIGILL signal: Storage.ALLOCATE: Heap overflow.Heap overflow.%.CRASH IN MODULE Conversions PROCEDURE StringToReal0123456789ABCDEF.text<.data .bss %XX1.filegmod2.o.text<E6x.data j.bss %.filegCoff.o.textErh.data j.bss %.filegM2CM.o.textV.data 4.bss %.file'gM2DM.o.texto.data 4,.bss %.file/gM2EM.o.textpI.data `.bss %.file7gM2ErrTable.o.text >.data `(.bss %.file?gM2FM.o.text< I.data .bss %.fileGgM2HM.o.textT.data .bss %.fileOgM2LM.o.text % .data B.bss %.fileWgM2RM.o.text 1&|.data .bss %.file_gM2SM.o.text X x.data Vv.bss %.fileggM2TM.o.text qx.data .bss %.fileogArguments.o.text l.data ".bss %.filewgClock.o.text f.data .bss %.filegErrorHandlin.o.text  .data .bss %.filegFileSystem.o.text H.data  .bss %.filegInOut.o.text . .data # .bss %.filegM2System.o.text  ZR.data #(p.bss %.filegStorage.o.text  .data $2.bss %.filegStrings.o.text ".data $.bss %.filegTerminal.o.text 2.data $.bss %.filegConversions.o.text  l1.data $J.bss %timezone0tzname0patblack0patwhite04patgray0T0t_iob00_ctype0 0_iob20 %0 _dbase0errno0environ0PC0BC0 UP0ospeed0LINES0COLS0wncur0 optind0"optarg0&opterr0*optopt0.sys_nerr02FPA_flag06FPA_s0:FPA_d0>_sibuf0`_sobuf0d_tbase1shlbat1shlbatid1access1 alarm1brk1ibrk1sbrk1$chdir1*chmod10chown16chroot1<close1Bcreat1Hdup1Nexecl1Texecv1Zexecle1`execve1fexeclp1lexecvp1rexit1x_exit1~fcntl1fork1getpid1getpgrp1getppid1getuid1geteuid1getgid1getegid1gtty1ioctl1kill1link1locking1lseek1mknod1mount1msgctl1msgget1msgsnd1msgrcv1nice1open1openi1pause1pipe1profil1 ptrace1&read1,semctl12semget18semop1>setpgrp1Dsetuid1Jsetgid1Pshmctl1Vshmget1\shmat1bshmdt1hsignal1nstat1tstty1zfstat1stime1swrite1sync1syslocal1time1times1ulimit1umask1umount1uname1unlink1ustat1utime1wait1write1abort1abs1atof1clock1crypt1setkey1encrypt1ctermid1 ctime111gmtime1asctime1"tzset1(cuserid1.ecvt14fcvt1:gcvt1@fclose1Ffflush1Lfopen1Rfreopen1Xfdopen1^fread1dfwrite1jfrexp1pldexp1vmodf1|fseek1rewind1ftell1ftw1fgetc1getw1getcwd1getenv1getgrent1getgrgid1getgrnam1setgrent1endgrent1getlogin1getopt1getpass1getpw1getpwent1getpwuid1getpwnam1setpwent1endpwent1gets1getchar1 fgets1getutent1getutid1;1$E1*setutent10endutent16utmpname1<malloc1Bfree1Hrealloc1Ncalloc1Tcfree1Zmemccpy1`memchr1fmemcmp1lmemcpy1rmemset1xmktemp1~monitor1perror1popen1pclose1printf1fprintf1sprintf1fputc1putw1putpwent1puts1putchar1fputs1scanf1fscanf1sscanf1setbuf1sleep1ssignal1gsignal1strcat1strncat1strcmp1strncmp1strcpy1strncpy1strlen1 strchr1&strrchr1,strpbrk12strspn18strcspn1>strtok1Dstrtol1Jatol1Patoi1Vswab1\system1btmpfile1htmpnam1ntempnam1tttyname1zisatty1ttyslot1ungetc1_filbuf1_flsbuf1lmul__1lmul1ldiv__1ldiv1lrem__1lrem1aldiv1almul1alrem1ulmul1uldiv__1uldiv1ulrem__1ulrem1qsort1l3tol1ltol31tgetflag1tgetent1 tgetstr1tgetnum1tgoto1tputs1"form1(menu1.message14setattr1:pb_open1@O1FY1Lpb_gets1Rpb_check1Xpb_weof1^pb_seek1dpb_puts1jpb_name1ppb_empty1vpb_gbuf1|c1wrefresh1track1wcreate1initscr1cbreak1attroff1nl1attron1flushinp1noecho1inch1getch1savetty1resetty1echo1nocbreak1nonl1wdelete1wprexec1m1wgetc1kcodemap1keypad1 wsigintr1wind1w1winit1$wsetbuf1*iswind10wexit16endwin1<wgetpos1Bwgoto1Hwinstr1N1T1Z1`wnl1fwndelay1lwprompt1rwguser1xwcmd1~wslk1wlabel1wuser1wprintf1printw1wputc1wputs1wrastop1wselect1wgetsel1wsetstat1wgetstat1setty1fixterm1physclr11setterm1getterm1baudrate11slkcol1setjmp1longjmp1afmulf1afdivf1afaddf1_cvfd1 _cvif1&fltused1,nlist12fmul18fdiv1>fadd1Dfsub1J_cvdf1P_cvdi1V_cvid1\_cvfi1bafadd1hafsub1nafsubf1tafmul1zexhelp1tolower1wicon1wicoff1toupper1l64a1a64l1_bufsync1setuname1auldiv1eprintf1dbsub__1dbadd__1dbdiv__1dbmul__1ltodb__1dbtol__1dbtofl__1fltodb__1ltofl__1fltol__1ultodb__1ultofl__1aulmul1 afdiv1dbtst__1fltst__1plock1"dial1(callout1.undial14drand481:erand481@lrand481Fmrand481Lsrand481Rjrand481Xseed481^lcong481drand1jsrand1pftok1vputenv1|targets111w_target1_fpachk1_startmain<_end I % % %Terminal 2 N > # n8 C S e y $  6 J  %  " Clock f Strings  &( v;FY g M2DMoo %$ %( %, %0 %4 %8 %< %@ %D %H %L %P) %TM2SM X M2SM_sym %UM2SM_id %V6 %XB %ZN %\Z %`g fs [} [ X2 %d %h Uh lbM2TM q Ul Up s ub x v0 xL x/ r9 rI qZ xh yLv yr yM2RM 1 Ut Ux U| 2 4 G V V M2EMp U qZq(r,6tPCvQy _ymzJy{|}~TXPM2CMV U"W1`<`Ha|Sa_bmcL{fi6iZij"jdjrkklmTm n .nh;nLoM2HM\ Uh Ut U@ܦ֢H *M2LM %M2LM_pc U & ' '# ("0 (Z? * Q *@b )CoffErpE~ UNUK^mod2< UM2System mod2_ch U Umod2_pno Vmod2_mno V V V V V V  V V , f : p I f V f f g  v gH gp gt gx g| g 8   ZInOut .  ` -  <  L  [ HStorage  i 0 z g g g g g F  HN J K K2 SF /Uj @ g M g [ g g g t g g F     l  p : X  M2HM_BccM2HM_Scc '  5 B  O Z` e o |   "  p Z "  M2HM_Jf fM2HM_Jb  !  "  "  " + # 8 # E # R # b #P s $v $^ $ $M2FM< R    g g & 'x (z" gM2CM_sp0 gM2CM_sp g. jA S f gr g g gp0pLL:R >M2HM_Iszլ'42B DL V ` j t M2HM_Or2 L~ ~   6M2HM_In2 ^ P x       \ $N0|<ΜIV aFlπwϺВ& ( g g hH     l F# 2 iXF XpM2HM_GeaM2HM_Ext$  &x            t* x8܄F Y \h x} @     k  . p r t0 uC xN xY =xh %u  | ZL =| =~M2RM_f =M2RM_err = = = = = =  =M2SM_ch =M2SM_id0 =M2SM_id1 = =M2SM_K >TM2SM_pow >X) >p6 >tC >vT >xc >|s > > > > > 2 >M2TM_obj > > > > > % > >K V 6a s : > > > > >  > >" I 4 II [ To     0  0 6 O b  $ I IInOut_in I I   z   T1 J f   ,   :  < T p  t  ƪ    * I7 I A Q 8b s       t  H   0 ? &R 2f >y J ^ | I I I v  z  v- < K LZ i x   : v    I I  ' 9 II I\ Ik I{ I I I I_etext Xetext X_edata %edata %end Ipatltgray_bufendtabsys_errlist_buf2endtablocaltimegetutlinepututlineadf_gtxcdadf_gtwrdadf_gttokwpostwaitwsigcatchwreadmousewsetmousewgetmouseresettermparselinen_targetswtargetonM2System_argcM2System_argvM2System_environTerminal_ReadTerminal_WriteTerminal_WriteLnTerminal_WriteStringFileSystemFileSystem_OpenFileSystem_CreateFileSystem_ReadCharFileSystem_CloseFileSystem_DeleteFileSystem_DoneFileSystem_ShowStatusArgumentsArguments_ArgCountArguments_GetArgumentArguments_GetOptClock_ClockTimeStrings_StringLenStrings_CopyStringM2ErrTableM2ErrTable_ErrHaltErrorHandlingErrorHandling_ErrorMessageM2DM_ALLOCATEM2DM_inttypM2DM_cardtypM2DM_realtypM2DM_chartypM2DM_bitstypM2DM_dbltypM2DM_notypM2DM_stringtypM2DM_addrtypM2DM_undftypM2DM_mainmodM2DM_sysmodM2DM_verboseM2SM_numtypM2SM_intvalM2SM_dblvalM2SM_realvalM2SM_GetSymM2SM_DiffM2SM_KeepIdM2SM_MarkM2SM_sourceM2SM_IdBufM2SM_scanerrM2SM_InitScannerM2TM_topScopeM2TM_ScopeM2TM_NewObjM2TM_NewStrM2TM_NewParM2TM_NewImpM2TM_NewScopeM2TM_CloseScopeM2TM_FindM2TM_FindImportM2TM_FindInScopeM2TM_CheckUDPM2TM_MarkHeapM2TM_ReleaseHeapM2TM_InitTableHandlerM2RM_ModNoM2RM_ModListM2RM_RefFileM2RM_InitRefM2RM_InRefM2RM_OpenRefM2RM_CloseRefM2RM_OutUnitM2EM_wlevM2EM_AllocVarM2EM_AllocParM2EM_AllocFldM2EM_GenItemM2EM_GenIndexM2EM_GenFieldM2EM_GenDeRefM2EM_GenNegM2EM_GenNotM2EM_GenAndM2EM_GenOrM2EM_GenSingSetM2EM_GenSetM2EM_GenInM2EM_GenOpM2EM_GenWithM2EM_GenWith2M2EM_GenStParamM2EM_GenStFctM2EM_InitM2EMM2CM_curPrioM2CM_GenAssignM2CM_GenFJM2CM_GenCFJM2CM_GenBJM2CM_GenCBJM2CM_PrepCallM2CM_GenParamM2CM_GenCallM2CM_GenEnterM2CM_GenResultM2CM_GenReturnM2CM_GenCase1M2CM_GenCase2M2CM_GenCase3M2CM_GenFor1M2CM_GenFor2M2CM_GenFor3M2CM_GenFor4M2CM_GenLoop1M2CM_GenLoop2M2CM_GenExitM2CM_GenEnterModM2CM_GenExitModM2HM_curLevM2HM_rngchkM2HM_ovflchkM2HM_WordValM2HM_CheckRegsM2HM_SetregMdM2HM_SetconMdM2HM_ConvertTypM2HM_CopyDynArrayM2HM_GenHaltM2HM_InitM2HMM2LM_AllocStringM2LM_AllocBoundsM2LM_fixupM2LM_FixLinkM2LM_FixupWithM2LM_ReleaseTempsM2LM_OutCodeFileM2LM_InitM2LMCoff_InitCoffCoff_debugCoff_OutSymEntCoff_OutSymTreeCoff_InitSymTabmod2__gate_mod2_FileNamemod2_isdefmod2_isimpmod2_nolinkmod2_oflagmod2_outfilenamemod2_ldargindexmod2_ldargsmod2_argerrorM2System_HALTXCoff_FileHdrCoff_TextScnHdrCoff_DataScnHdrCoff_BssScnHdrCoff_TextRelHeadCoff_DataRelHeadCoff_symfileCoff_strgfileCoff_strindexErrorHandling_HaltMessageFileSystem_CreateTempfileFileSystem_WriteRecordInOut_WriteStringInOut_WriteIntInOut_WriteCardInOut_WriteHexInOut_WriteLnStorage_ALLOCATECoff__gate_Coff_TextRelTailCoff_DataRelTailCoff_symindexCoff_isimpmodCoff_FillHdrsM2System_MULS32Coff_WriteScnHdrCoff_NewRelocCoff_NewSymEntCoff_NewAuxEntCoff_OutGateSymCoff_OutRtSymEntM2DM_booltypM2DM_lcardtypM2DM_lrltypM2DM_proctypM2DM_wordtypM2DM_bytetypM2HM_SimpleTM2HM_RealTM2HM_LongQuickM2HM_GetRegM2HM_ReleaseM2HM_ReleaseRegM2HM_SaveRegsM2HM_RestoreRegsM2HM_SetlocMdM2HM_SetstkMdM2HM_InvertCCM2HM_StackTopM2HM_SetupSLM2HM_LoadAdrM2HM_LoadDM2HM_LoadXM2HM_MoveM2HM_MoveAdrM2HM_MoveBlockM2HM_Neg1M2HM_Tst1M2HM_Add2M2HM_Cmp2M2HM_CheckClimitM2HM_CheckRangeM2HM_CheckDbltoSingleM2HM_DynArrayM2HM_EnterCaseM2HM_ExitCaseM2HM_LinkM2HM_UnlinkM2HM_CallIntM2HM_CallExtM2HM_CallIndM2HM_CallSystemM2HM_CallDefProcM2HM_EnterModuleM2HM_ExitModuleM2HM_InitModuleM2HM_GenEnvironM2FM_FMoveM2FM_LoadFM2FM_FLongM2FM_FShortM2LM_maxPM2LM_maxMM2LM_PutWordM2LM_AllocCharM2LM_FixLinkWithM2CM__gate_Storage_DEALLOCATEStorage_AvailableStorage_REALLOCATEM2DM__gate_M2DM_currentM2DM_heapstartM2DM_maxAdrM2DM_AvailableM2DM_ResetHeapM2HM_LongValM2HM_SimpleCM2HM_SignedTM2HM_LockRegM2HM_UnlockRegM2HM_IslockedM2HM_SetbusyRegM2HM_SetglbMdM2HM_LoadAM2HM_LoadToLRegM2HM_Abs1M2HM_Com1M2HM_Inc1M2HM_Dec1M2HM_Sub2M2HM_And2M2HM_Eor2M2HM_Div2M2HM_Mod2M2HM_Mul2M2HM_Shi2M2HM_Ash2M2HM_ConIndexM2HM_VarIndexM2HM_GetHighM2HM_NormalizeM2HM_CheckHighM2HM_PreLoadM2FM_FNeg1M2FM_FAbs1M2FM_Float1M2FM_Trunc1M2FM_FloatD1M2FM_TruncD1M2FM_FAdd2M2FM_FSub2M2FM_FMul2M2FM_FDiv2M2FM_FCmp2M2FM_FRem2M2LM_MergedLinksM2EM__gate_M2EM_maskM2EM_wtabM2System_FNEGsM2System_FCMPsM2System_FABSsM2System_FDIVsM2System_FMULsM2System_FSUBsM2System_FADDsM2ErrTable_errtableM2ErrTable__gate_M2ErrTable_InitErrTableM2HM_GetRegPairM2FM__gate_M2LM_PutLongM2HM__gate_M2HM_RpoolM2HM_RbusyM2HM_RlockM2HM_dataM2HM_memoryM2HM_controlM2HM_alterableM2HM_MoveCodeM2HM_ShiCodeM2HM_maskM2HM_hightypM2HM_M2SysTabM2HM_InitRegsFileSystem_ReleaseFileSystem_EofFileSystem_WriteWordFileSystem_WriteByteFileSystem_WriteCharFileSystem_FlushFileSystem_ResetFileSystem_ReadRecordM2SM_EnterInOut_WriteOctInOut_WriteM2LM__gate_M2LM_dataptrM2LM_codeoverflowM2LM_constoverflowM2LM_codeBM2LM_dataBM2LM_converterM2LM_PrintPCFileSystem_GetPosFileSystem_ReadWordM2SM_MarkNoSourceM2RM__gate_M2RM_CurStrM2RM_TempsM2RM_FieldsM2RM_ParamsM2RM_lastParM2RM_convFileSystem_SetPosM2SM__gate_M2SM_keyTabM2SM_lastPosM2SM_curlineM2SM_lasterrlineM2SM_linestartM2SM_tokenstartM2SM_errtokenstartM2SM_prevtokenM2SM_lastsymM2SM_lasterrM2SM_badlineM2System_FLOATsM2TM__gate_M2TM_universeM2TM_BBtypM2TM_expoArguments__gate_Arguments_GetEnvironmentArguments_PutEnvironmentClock__gate_Clock_TimeClock_DateClock_ConvertTimeFileSystem_WriteStringFileSystem_StderrErrorHandling__gate_FileSystem_StdinFileSystem_StdoutFileSystem_Base_iobStrings_AppendStringFileSystem__gate_FileSystem_FileTabFileSystem_StatusFileSystem_FileCountFileSystem_RenameFileSystem_ReadModeFileSystem_WriteModeFileSystem_ReadWriteModeFileSystem_FileNotBufferedFileSystem_FileBigBufferFileSystem_BufferingStatusUnknownFileSystem_ErrorOnFileFileSystem_ReadByteFileSystem_ReadLongWordFileSystem_WriteLongWordFileSystem_GetNameFileSystem_FileNameLengthCheckFileSystem_ParseInOut_DoneInOut_termCHInOut_outConversionsConversions_DoneConversions_NumToStringConversions_OctToStringConversions_HexToStringConversions_IntToStringConversions_CardToStringConversions_LongIntToStringConversions_LongCardToStringConversions_LongOctToStringConversions_LongHexToStringConversions_RealToStringConversions_StringToOctConversions_StringToLongOctConversions_StringToHexConversions_StringToLongHexConversions_StringToIntConversions_StringToLongIntConversions_StringToCardConversions_StringToLongCardConversions_StringToRealConversions_ByteToLongIntConversions_WordToLongIntTerminal_ReadStringTerminal_ReadLnTerminal_ReadAgainInOut__gate_InOut_bufInOut_OpenInputInOut_OpenOutputInOut_CloseInputInOut_CloseOutputInOut_ReadInOut_ReadLnInOut_ReadStringInOut_ReadIntInOut_ReadLongIntInOut_ReadCardInOut_ReadLongCardInOut_ReadOctInOut_ReadLongOctInOut_ReadHexInOut_ReadLongHexInOut_ReadRealInOut_WriteLongIntInOut_WriteLongCardInOut_WriteLongOctInOut_WriteLongHexInOut_WriteRealInOut_WriteERealM2System__gate_M2System_convertM2System_retvalM2System_MULU32M2System_DIVU32M2System_DIVS32M2System_FREMsM2System_TRUNCsM2System_FADDdM2System_FSUBdM2System_FMULdM2System_FDIVdM2System_FREMdM2System_FCMPdM2System_FNEGdM2System_FABSdM2System_FLOATdM2System_TRUNCdM2System_FLONGM2System_FSHORTStorage__gate_Strings__gate_Strings_CmpStringStrings_CmpNStringStrings_StringChrTerminal__gate_Terminal_mustagainTerminal_oldchTerminal_ScreenTerminal_KeyboardConversions__gate_Conversions_ResultConversions_digs0707070000020013351006440001460001440000010441570431624676600002300000200552/usr/lib/libmod2.a! / 590958045 0 0 0 5404 ` ```````!!!!!!!!!!!!!!!!!!!!!!!!!!8888;;;;>>>>>>>>>>>>>>>>>>>>>>>>QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~LLLLLLLLArguments_ArgCountArgumentsArguments__gate_Arguments_GetArgumentArguments_GetEnvironmentArguments_PutEnvironmentArguments_GetOptClockClock__gate_Clock_TimeClock_ClockTimeClock_DateClock_ConvertTimeConversionsConversions__gate_Conversions_ResultConversions_digsConversions_DoneConversions_NumToStringConversions_OctToStringConversions_LongOctToStringConversions_HexToStringConversions_LongHexToStringConversions_IntToStringConversions_LongIntToStringConversions_CardToStringConversions_LongCardToStringConversions_RealToStringConversions_StringToOctConversions_StringToLongOctConversions_StringToHexConversions_StringToLongHexConversions_StringToIntConversions_StringToLongIntConversions_StringToCardConversions_StringToLongCardConversions_StringToRealConversions_ByteToLongIntConversions_WordToLongInt_Coroutine_currentprocessCoroutineCoroutine_NEWPROCESSCoroutine_TRANSFERErrorHandlingErrorHandling__gate_ErrorHandling_HaltMessageErrorHandling_ErrorMessageFileInformationFileInformation__gate_FileInformation_GetModeFileInformation_GetInoFileInformation_GetDevFileInformation_GetRdevFileInformation_GetNlinkFileInformation_GetUidFileInformation_GetGidFileInformation_GetSizeFileInformation_GetAtimeFileInformation_GetMtimeFileInformation_GetCtimeFileInformation_fGetModeFileInformation_fGetInoFileInformation_fGetDevFileInformation_fGetRdevFileInformation_fGetNlinkFileInformation_fGetUidFileInformation_fGetGidFileInformation_fGetSizeFileInformation_fGetAtimeFileInformation_fGetMtimeFileInformation_fGetCtimeFileSystem_StdinFileSystem_StdoutFileSystem_StderrFileSystem_Base_iobFileSystemFileSystem__gate_FileSystem_FileTabFileSystem_StatusFileSystem_FileCountFileSystem_WriteCharFileSystem_WriteStringFileSystem_DoneFileSystem_ShowStatusFileSystem_CloseFileSystem_DeleteFileSystem_RenameFileSystem_ReadModeFileSystem_WriteModeFileSystem_ReadWriteModeFileSystem_FileNotBufferedFileSystem_FileBigBufferFileSystem_BufferingStatusUnknownFileSystem_EofFileSystem_ErrorOnFileFileSystem_GetPosFileSystem_ResetFileSystem_SetPosFileSystem_ReadByteFileSystem_ReadWordFileSystem_ReadLongWordFileSystem_WriteByteFileSystem_WriteWordFileSystem_WriteLongWordFileSystem_FlushFileSystem_ReadCharFileSystem_ReadRecordFileSystem_WriteRecordFileSystem_GetNameFileSystem_FileNameLengthCheckFileSystem_ParseFileSystem_OpenFileSystem_CreateFileSystem_CreateTempfileFileSystem_ReleaseInOut_DoneInOut_termCHInOut_inInOut_outInOutInOut__gate_InOut_bufInOut_OpenInputInOut_OpenOutputInOut_CloseInputInOut_CloseOutputInOut_ReadInOut_ReadLnInOut_ReadStringInOut_ReadIntInOut_ReadLongIntInOut_ReadCardInOut_ReadLongCardInOut_ReadOctInOut_ReadLongOctInOut_ReadHexInOut_ReadLongHexInOut_ReadRealInOut_WriteInOut_WriteLnInOut_WriteStringInOut_WriteIntInOut_WriteLongIntInOut_WriteCardInOut_WriteLongCardInOut_WriteOctInOut_WriteLongOctInOut_WriteHexInOut_WriteLongHexInOut_WriteRealInOut_WriteERealM2System_argcM2System_argvM2System_environM2SystemM2System__gate_M2System_convertM2System_retvalM2System_HALTXM2System_MULU32M2System_DIVU32M2System_MULS32M2System_DIVS32M2System_FADDsM2System_FSUBsM2System_FMULsM2System_FDIVsM2System_FREMsM2System_FCMPsM2System_FNEGsM2System_FABSsM2System_FLOATsM2System_TRUNCsM2System_FADDdM2System_FSUBdM2System_FMULdM2System_FDIVdM2System_FREMdM2System_FCMPdM2System_FNEGdM2System_FABSdM2System_FLOATdM2System_TRUNCdM2System_FLONGM2System_FSHORTMathLib0_MathStatusMathLib0MathLib0__gate_MathLib0_LnAMathLib0_LnBMathLib0_ExpPMathLib0_ExpQMathLib0_LnC1MathLib0_ArcTanPMathLib0_ArcTanQMathLib0_ArcTanAMathLib0_SinRMathLib0_SinCMathLib0_sqrtMathLib0_expMathLib0_lnMathLib0_arctanMathLib0_entierMathLib0_sinMathLib0_cosMathLib0_powMathLib0_realStorageStorage__gate_Storage_ALLOCATEStorage_DEALLOCATEStorage_REALLOCATEStorage_AvailableStringsStrings__gate_Strings_StringLenStrings_CopyStringStrings_AppendStringStrings_CmpStringStrings_CmpNStringStrings_StringChrTerminalTerminal__gate_Terminal_mustagainTerminal_oldchTerminal_ScreenTerminal_KeyboardTerminal_ReadTerminal_ReadStringTerminal_ReadAgainTerminal_ReadLnTerminal_WriteTerminal_WriteStringTerminal_WriteLnProcsProcs__gate_Procs_cpProcs_dummyProcs_StartProcessProcs_StopProcessProcs_SENDProcs_WAITProcs_AwaitedProcs_InitArguments.o/ 590957825 102 100 100644 1818 ` R#9L .textl .datall"@.bssNVgN^NuNNN`4NV4.yd-y4.xB-D$.Ԯ-B&n-SBn4.&nJ3 g4.&n 8.$n@ Rn`4.&n B3 Bg?./. N&n6`?<HylNN^Nt NV4.RBgRB&n-O$OSBQ?./.?<xHnNBHnNX.-_?<x/.?<xHnN$.JBf &nB`<&nBg?<xHnN4.8Bb?<xHn?./. NN^NtNVBg?./. N4&n B3 B/. NX.-_txB$.WD&nN^Nt NV4.RBgRB&n-O$OSBQB/./9/9NO .-_&n&-y?<x/.?./. N$.B`N^Nt$93BN^NuArg error : not enough arguments 2< 2^   & , D\b.filegArguments.o.textl.datal".bssgetenvputenvgetoptoptindoptarg%M2System@N\Stringsm(Arguments_ArgCountErrorHandlingErrorHandling_ErrorMessageM2System_argcM2System_argvM2System_environStrings_CopyStringStrings_StringLenArgumentsArguments__gate_Arguments_GetArgumentArguments_GetEnvironmentArguments_PutEnvironmentArguments_GetOptClock.o/ 590957846 102 100 100644 1197 ` R#9M.textB .dataB@.bssNVgN^NuN`NVHntxB/NB/.NX.-_&n&B/.NX.-_&n$nt$Q&n$+R&n'BHnNN^NtNVHntxB/NB/.NX.&n&HnNN^NtNVHntxB/NB/.NX.-_BG/ NX.-_Bn nb,4. 8.Bb4.&n8.$n@ RndHnNN^NtNVBG/ NX.-_Bn nb,4. 8.Bb4.&n8.$n@ RndN^Nt BN^Nu . :V      N f .filegClock.o.text.data.bsstimectimeStorageClock2?JZeXwlocaltimeStorage_ALLOCATEStorage_DEALLOCATEClock__gate_Clock_TimeClock_ClockTimeClock_DateClock_ConvertTime Conversions.o/ 590957882 102 100 100644 5675 ` R#9M/,4.text l B1 .data l lJ @.bss NVgN^NuNNNN` NVy`N^NuNVBnRn4.xB$. "N$-B4.xB$. "N$-B$.=B4.SBG8.E@ JfJ.gRn4.SBG- 4. RB=B4.nc=n4.޴nc=nBn4.nc84.nc4.&n `4.&n0 RnSn`Jnc$4.&n8.SDE@ RnSn`4.ܴnd4.&nB3 N^NtNV4.xB/?.?.?.B'?. /.aN^Nt NV4.xB/?.?< ?<B'?. /.a`N^Nt NV/.?.?< ?<B'?. /.a8N^Nt NV4.xB/?.?<?<B'?. /.a N^Nt NV/.?.?<?<B'?. /.aN^Nt NV4.JBlDBxB/?.Bg?< Jn]D?. /.aN^Nt NV$.JlD/?.Bg?< J]D?. /.arN^Nt NV4.xB/?.Bg?< B'?. /.aFN^Nt NV/.?.Bg?< JUD?. /.aN^Nt NVG lEtWB.?.?<?<Hnaz n d B.`B.?<Hn?<Hn?<HnNBg?<HnN=_4.G 4.RBGB3 B9-n .N-@-AB/./.Hn/.NO.$=B nft&nB3 `4.no4.&nB3 4.n=B4.SB=B?.4.Wm$4.&n8.SD$n@ SnSnhT4.SB=BJnm4.&n SnhN^NtNV4. RBgRB&n-O$OSBQB9BnBn4.&n 30 e84.&n 37 b&4.B8.&n|3@FB0=BRn`Jnc =n`N^NtNV4. RBgRB&n-O$OSBQB9Bnt-B4.&n 30 e<4.&n 37 b*$.8.&n|3@F0xFԄ-BRn`Jnc -n`N^NtNV4. RBgRB&n-O$OSBQB9BnBn4.&n3 ae zb_D .0e .9c .Aex .Fbn .0e& .9b4.Bx.D0D=B`4.Bx.D7D=BRn4.&n3 ae zb_D`nJnc =n`N^NtNV4. RBgRB&n-O$OSBQB9Bnt-B4.&n3 ae zb_D .0e .9c .Ae .Fbv .0e* .9b $.x.D0|DԆ-B`$.x.D7|DԆ-BRn4.&n3 ae zb_D`fJnc -n`N^NtNV4. RBgRB&n-O$OSBQB9t&n 3- WDBt&n 3+ gt&n 3- ft`tBBnt./Bg?. /.N8$SD=B?4.Wb04. 8.&n|3@FB0=BRndTJ.g 4.DB=B=n`N^NtNV4. RBgRB&n-O$OSBQB9t&n 3- WDBt&n 3+ gt&n 3- ft`tBt-Bt./Bg?. /.N8$SD=B?4.Wb<$. r N$8.&n|3@F0xFԄ-BRndTJ.g $.D-B-n`N^NtNV4. RBgRB&n-O$OSBQB9BnBg?. /.N4SBBn?4.Wb04. 8.&n|3@F0F=BRndT=n`N^NtNV4. RBgRB&n-O$OSBQB9t-BBg?. /.N4SBBn?4.Wb<$. r N$8.&n|3@F0xFԄ-BRndT-n`N^NtNV4. RBgRB&n-O$OSBQB9|%|fB.BG/ Hn/.NO .$=B ng?<1Hy pN` -n`N^NtNVGn4g||` BB+B+-S `N^NtNVG7n4g|`BB+-S `N^Nt?<Hy ?<HyNBN^Nu%.CRASH IN MODULE Conversions PROCEDURE StringToReal0123456789ABCDEF &4`|8:v 2  | -   0 l   0  R x     : R \ b.filegConversions.o.text l1.data lJ.bss InOut&4StringsCUjsscanfsprintffltodb__}.-Eay@h20NLd    *# = WInOut_WriteStringInOut_WriteCardInOut_WriteLnInOut_WriteIntStrings_StringLenStrings_AppendStringStrings_CopyStringErrorHandlingErrorHandling_ErrorMessageConversionsConversions__gate_FileSystemConversions_ResultConversions_digsConversions_DoneM2System_DIVU32Conversions_NumToStringConversions_OctToStringConversions_LongOctToStringConversions_HexToStringConversions_LongHexToStringConversions_IntToStringConversions_LongIntToStringConversions_CardToStringConversions_LongCardToStringConversions_RealToStringConversions_StringToOctConversions_StringToLongOctConversions_StringToHexConversions_StringToLongHexConversions_StringToIntConversions_StringToLongIntM2System_MULS32Conversions_StringToCardConversions_StringToLongCardM2System_MULU32Conversions_StringToRealConversions_ByteToLongIntConversions_WordToLongInt Coroutine.o/ 590957890 102 100 100644 706 ` R#9MBT.text, .dataJ@.bssNuNVH nB!n!n "n"LN^&_NNVH$y n"P%O n #Jg.i LN^&_PN"(i,I.NN <NNq<R.filegCoroutine.s.text.data.bss.8M2firstimej_exit`_Coroutine_currentprocess_Coroutine_mainCoroutineCoroutine_NEWPROCESSCoroutine_TRANSFERErrorHandlin.o/ 590957897 102 100 100644 938 ` R#9MF.textV .dataV@.bssNVgN^NuN`NV4. RBgRB&n-O$OSBQHy?. /.NHy< NpNN^NtNV4. RBgRB&n-O$OSBQHy?. /.NHy< NN^NtBN^Nu D R X b j    .filegErrorHandlin.o.text .data.bss&;M[ptFileSystemFileSystem_WriteStringFileSystem_WriteCharFileSystem_StderrErrorHandlingErrorHandling__gate_ErrorHandling_HaltMessageM2System_HALTXErrorHandling_ErrorMessageFileInformat.o/ 590957916 102 100 100644 4749 ` R#9MT D'.text * [ .data * * @.bss * *NVgN^NuNN` NV4. RBgRB&n-O$OSBQHntxB/NB/./.NP.Jf&n=S``NHnNN^NtNV4. RBgRB&n-O$OSBQHntxB/NB/./.NP.Jf&n=k``NHnNN^NtNV4. RBgRB&n-O$OSBQHntxB/NB/./.NP.Jf&n=k``NHnNN^NtNV4. RBgRB&n-O$OSBQHntxB/NB/./.NP.Jf&n=k``NHnNN^NtNV4. RBgRB&n-O$OSBQHntxB/NB/./.NP.Jf&n=k``NHnNN^NtNV4. RBgRB&n-O$OSBQHntxB/NB/./.NP.Jf&n=k ``NHnNN^NtNV4. RBgRB&n-O$OSBQHntxB/NB/./.NP.Jf&n=k ``NHnNN^NtNV4. RBgRB&n-O$OSBQHntxB/NB/./.NP.Jf&n-k``NHnNN^NtNV4. RBgRB&n-O$OSBQHntxB/NB/./.NP.Jf&n-k``NHnNN^NtNV4. RBgRB&n-O$OSBQHntxB/NB/./.NP.Jf&n-k``NHnNN^NtNV4. RBgRB&n-O$OSBQHntxB/NB/./.NP.Jf&n-k``NHnNN^NtNVHntxB/NB/./.NP.Jf&n=S ``NHnNN^NtNVHntxB/NB/./.NP.Jf&n=k ``NHnNN^NtNVHntxB/NB/./.NP.Jf&n=k ``NHnNN^NtNVHntxB/NB/./.NP.Jf&n=k ``NHnNN^NtNVHntxB/NB/./.NP.Jf&n=k ``NHnNN^NtNVHntxB/NB/./.NP.Jf&n=k ``NHnNN^NtNVHntxB/NB/./.NP.Jf&n=k ``NHnNN^NtNVHntxB/NB/./.NP.Jf&n-k ``NHnNN^NtNVHntxB/NB/./.NP.Jf&n-k ``NHnNN^NtNVHntxB/NB/./.NP.Jf&n-k ``NHnNN^NtNVHntxB/NB/./.NP.Jf&n-k ``NHnNN^NtBN^Nu  V f    H Xz   < Ln x  0 @b l  $ 4V `   (J Tp       . P Zv       & 6 X b~      . > ` j        .filegFileInformat.o.text *[.data *.bss *statfstatStorage%6IYp"v-Fj_x^ d l$=WtqFileSystemFileSystem_ShowStatusStorage_ALLOCATEStorage_DEALLOCATEFileInformationFileInformation__gate_FileInformation_GetModeFileInformation_GetInoFileInformation_GetDevFileInformation_GetRdevFileInformation_GetNlinkFileInformation_GetUidFileInformation_GetGidFileInformation_GetSizeFileInformation_GetAtimeFileInformation_GetMtimeFileInformation_GetCtimeFileInformation_fGetModeFileInformation_fGetInoFileInformation_fGetDevFileInformation_fGetRdevFileInformation_fGetNlinkFileInformation_fGetUidFileInformation_fGetGidFileInformation_fGetSizeFileInformation_fGetAtimeFileInformation_fGetMtimeFileInformation_fGetCtime FileSystem.o/ 590957933 102 100 100644 11279 ` R#9M`"N.textH .dataHH @.bssTTNVgN^NuN`NVBt.xB&n //NP. VDN^NtNV4. RBgRB&n-O$OSBQB&n//.NP. VDN^Nt NV=| nb.4.G$n((f =n `Rnd=| `N^NtNV4. RBgRB&n-O$OSBQBn| ndJ.g4.GJ(fB.4.GG($n&Bn/ Bg?. /.N4&_=B=|4.nd*4.nb4.E8."n@ Rn`4.nb4.EB2 `Rn`BN^Nt NVBn| ndHJ.g@4.G(3(&nf4.Gx'(B.`Rn`N^NtNVy`N^NuNV$9`Hy?< HyHaNuHy?<HyXaNuHy?<HyraNuHy?<HyaNuHy?<HyaxNuHy?<HyabNuHy?<HyaLNuHy?<Hya6NuHy?<Hya NuHy?< Hya NuHy?<HyaNuHy?<HyaNuHy?<HyaNuHy?< Hy0aNuHy?<Hy4.&n&kJ3 g*RnRn4.&n&k 3. f &n `=n`N^Nt NV nbb=n?.4.WbH&n4+ &n8+Bb,&n4+&n&k8.$n$j@ &nRkRndT`^J. g4.BYB=n?4.WbH&n4+ &n8+Bb,&n4+&n&k8.$n$j@ &nRkRndT4.BWB=B4.&n&k 3. gRn`4.VB=n?4.WbH&n4+ &n8+Bb,&n4+&n&k8.$n$j@ &nRkRndT`d4.B=n?4.WbH&n4+ &n8+Bb,&n4+&n&k8.$n$j@ &nRkRndTN^Nt 4.RBgRB&n-O$OSBQBn=|Bg?.HnHVa=_B.Bg?./.N=_J.fb4.SB?4.nSB??..HVa4.nng(4.nRB=BBg?.HnHVa=_`|`4. 8.Bb4.&nB3 N^Nt NV`~NVt&n&k3 ae zb_D`B. `Nu| `Nut&n&kx3 ` | `Nu| `NuGD. DcxD83@N@NuGD. D,cxD83@N@N^NtNV`NVBg?./.N=_&n 4nd&n 4&n 3. fb&n RS&n 4&n 3/ f|`P`:&n 4&n 3. f&&n RS&n 4&n 3/ f |`&n RS`vB.`N^Nt4.RBgRB&n-O$OSBQBnBn4.=BBnB.J.frB'?./.HnHVa_t.`6=n?.4.Wb.4.nb4.&n 8.$n@ RnRndT|Nu4.UB=n?4.Wb.4.nb4.&n 8.$n@ RnRndT4.RB=BNu4.WB=n?4.Wb.4.nb4.&n 8.$n@ RnRndTUnB.Jne,J.f$4.&n 3/ g Sn`|`Rn4.RB=BNunG BctB43 N `N^Nt4.RBgRB&n-O$OSBQB'HVa\t`?./.?<HnNNuBt/HnNP.-_Bg?<HnN=_ nd4.G/ ?<Hn?./.?<HnNNuG BctB43 N ?<Hn?. /.HVa?. /.?. /.a^N^Nt NV|4.RBgRB&n -O $OSBQt.`BgHy?<HnNNuBgHy?<HnNNuBgHy?<HnNNu?<Hy?<HnNNu?<Hy?<HnNNu?<Hy"?<HnNNuhG BctB43 N BHn/. NP.&n&&n$JBVDJ9g&?./. ?<Hn|aL/.?<Hn|aN^Nt NV4. RBgRB&n-O$OSBQ|wB.BHn/.NP.&n&&n$JBg0B&n/NX.-_/.?. /.<a8`B9N^Nt NV4. RBgRB&n-O$OSBQ?. /.?<2HnNBHnNX.-_$.JBg/.?<2Hna`B9N^Nt NVB'/.azJfB'/.aJgfBg/.af=_/.a ng 4.G?<Hs(a8`$Hy?<,Hy&aHy< a` /.aN^NtB9G#$9#$9#G####3 yb&49GG(t&B+RydBN^NuNot super-userNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead only file systemToo many linksBroken pipeMath arg out of domain of funcMath result not representableNo message of desired typeIPC identifier removedFile region locking deadlockUnknown errorrwar+w+a+FileSystem.Release: File not found in FileTab' 6J))(B(\(|(2(V)jt ~       $ .: DP Zf p|          , 6B LX bn x        (4 >J T` jv   . JZ j |))!)D d) ) . @) h ) ) P) t )   ) `) )  )  ) 0" F) j) # ) (h $0j   $2 >L Xf r ))Fj) % )b(x  )   ( ( (** **(<*.filegFileSystem.o.textH.dataH .bssT'9StringsM`u_ioberrnocreatclosefopenfdopenfreopenfclosefflushrewindsetbuffgetcfputcfputsfseekftelllinkunlinkfreadfwritegetcwdmktemp PT Pd0>ASenyJv #5F X Jl   Z      t- @ _>p FileSystem_StdinFileSystem_StdoutFileSystem_StderrFileSystem_Base_iobStrings_CopyStringStrings_AppendStringStrings_StringLenFileSystemFileSystem__gate_FileSystem_FileTabFileSystem_StatusFileSystem_FileCountFileSystem_WriteCharFileSystem_WriteStringFileSystem_DoneFileSystem_ShowStatusFileSystem_CloseFileSystem_DeleteFileSystem_RenameFileSystem_ReadModeFileSystem_WriteModeFileSystem_ReadWriteModeFileSystem_FileNotBufferedFileSystem_FileBigBufferFileSystem_BufferingStatusUnknownFileSystem_EofFileSystem_ErrorOnFileFileSystem_GetPosFileSystem_ResetFileSystem_SetPosFileSystem_ReadByteFileSystem_ReadWordFileSystem_ReadLongWordFileSystem_WriteByteFileSystem_WriteWordFileSystem_WriteLongWordFileSystem_FlushFileSystem_ReadCharFileSystem_ReadRecordFileSystem_WriteRecordFileSystem_GetNameFileSystem_FileNameLengthCheckFileSystem_ParseFileSystem_OpenFileSystem_CreateFileSystem_CreateTempfileFileSystem_Release InOut.o/ 590957955 102 100 100644 9823 ` R#9Mvv.text 8 .data @.bss NVgN^NuNNNN` @NV4. RBgRB&n-O$OSBQB'NJ9f2Hy?. /.NHy?<Hy NNN^NtNV4. RBgRB&n-O$OSBQa?. /.?<HnNHy?. /.B'N?. /.a,N^NtNV4. RBgRB&n-O$OSBQa|?. /.?<HnNHy?. /.N?. /.aN^NtNV$9(9DgHyN#?< Hy aN^NuNV$9(9DgHyN#?< Hy aHN^NuNV$9JBf4/.N&n f&nBB9` `PB'HyNJg&nBB9`,Hy/.NB'HyNJWDJ9g &nN^NtNV 9 gHna@ . g J9fB9N^NuNV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n|--3T FTL Zv |        L&2 8JT ^+f lx~   H \XfrXXD5XXXE5*<PXZfXv|XF5XXXG 5$X.:XJP`Xf@t5zXXXA5XX$4X:BH5NbXlxXXC5XXH5 , *,Z h-X9XU , X- X;X"UN X,d nXt-X:XU , X- X < (X .U Z  d, p  zX - X 7 X U  ,  X - "X (= 4X :U f  p, |  X - X 8 X U  ,   X - .X 4> @X FU r  |,  X - X ? X U  ,   X &- n  r  x |  .filegInOut.o.text .data  .bss InOut_in&1BTfz 2CRf{)AVk4E[gx *Fb{0MfTerminalStrings'InOut9FP` qpRF -X?NZh2zr~      0 N%InOut_DoneInOut_termCHInOut_outFileSystemFileSystem_StdinFileSystem_StdoutFileSystem_StderrFileSystem_Base_iobFileSystem_DoneFileSystem_CreateFileSystem_CreateTempfileFileSystem_OpenFileSystem_CloseFileSystem_ReleaseFileSystem_RenameFileSystem_DeleteFileSystem_GetPosFileSystem_SetPosFileSystem_ResetFileSystem_EofFileSystem_ReadModeFileSystem_WriteModeFileSystem_ReadWriteModeFileSystem_FileNotBufferedFileSystem_FileBigBufferFileSystem_BufferingStatusUnknownFileSystem_ErrorOnFileFileSystem_ReadByteFileSystem_ReadWordFileSystem_ReadLongWordFileSystem_WriteByteFileSystem_WriteWordFileSystem_WriteLongWordFileSystem_FlushFileSystem_ReadCharFileSystem_WriteCharFileSystem_WriteStringFileSystem_ReadRecordFileSystem_WriteRecordFileSystem_GetNameFileSystem_FileNameLengthCheckFileSystem_ParseFileSystem_ShowStatusConversionsConversions_DoneConversions_NumToStringConversions_OctToStringConversions_HexToStringConversions_IntToStringConversions_CardToStringConversions_LongIntToStringConversions_LongCardToStringConversions_LongOctToStringConversions_LongHexToStringConversions_RealToStringConversions_StringToOctConversions_StringToLongOctConversions_StringToHexConversions_StringToLongHexConversions_StringToIntConversions_StringToLongIntConversions_StringToCardConversions_StringToLongCardConversions_StringToRealConversions_ByteToLongIntConversions_WordToLongIntTerminal_ReadTerminal_ReadStringTerminal_ReadLnTerminal_ReadAgainTerminal_WriteTerminal_WriteStringTerminal_WriteLnStrings_CopyStringStrings_StringLenInOut__gate_InOut_bufInOut_OpenInputInOut_OpenOutputInOut_CloseInputInOut_CloseOutputInOut_ReadInOut_ReadLnInOut_ReadStringInOut_ReadIntInOut_ReadLongIntInOut_ReadCardInOut_ReadLongCardInOut_ReadOctInOut_ReadLongOctInOut_ReadHexInOut_ReadLongHexInOut_ReadRealInOut_WriteInOut_WriteLnInOut_WriteStringInOut_WriteIntInOut_WriteLongIntInOut_WriteCardInOut_WriteLongCardInOut_WriteOctInOut_WriteLongOctInOut_WriteHexInOut_WriteLongHexInOut_WriteRealInOut_WriteEReal M2System.o/ 590957971 102 100 100644 5349 ` R#9M:.text Z VR .data Z Zp @.bss NVgN^NuNN`NVG ZEtW=|Sn$.=B$.-B n d4.B0=B`4.B7=B4.G8. nfB.?<HnNNN^NtNV n$Y-B=@4.`?< Hy rNNu?<Hy NNu?<Hy NNu?<&Hy NNu?<&Hy NNu?<1Hy NNu?<Hy |gXO||G|~mF H@HFB@H@2Ё"HAHFЁHD؀kSEؼdREJEk|m NqpaB` -D`N^NtNV(. ,..BGfpaD<BEgV<✚G|HF⌈0BDHD8 H@∀HDkSEؼdREJEk|m NqpaB` -D`N^NtNVpaN^NtNV . ".$j ļfB$j ļfBN^NtNV .@-@ `N^NtNV .-@ `N^NtNV .Jg*2<bH@|bQAU-@ `N^NtNV .Jj g` BA<☒|lB`|DAlNqpa⨰b-@ `N^NtNVLL H0NPO##LH`N^NtNVLL H0NPO##LH`N^NtNVLL H0NPO##LH`N^NtNVLL H0NPO##LH`N^NtNVpaN^NtNVLL H0NPOJN^NtNVLH 9@#LH`N^NtNVLH 9#LH`N^NtNV .N##LH `N^NtNVLH 9"9N-@`N^NtNV .N##LH `N^NtNVLH 9"9N-@`N^NtNVB/</.NP.-_ fp`paN^NtBHzt/NP.# f$?<"Hy NNt/NXBHzvt/NP.# f$?<"Hy NNt/NXBN^Nu at address 0x--------.Program HaltedCase index out of rangeNo-return from function errorIEEE floating point arithmetic overflowREM operation on floats not implementedIndex/Range error or arithmetic overflow/underflowDivision by zeroNEW: Heap OverflowUnknown index to M2System.HALTXERROR: cannot catch SIGILL signal: ERROR: cannot catch SIGILL signal:  (       & 28 DJ V\ hn (06>hpv~8TZdl*06>`flr     * 8 >  D N.filegM2System.o.text ZR.data Zp.bss  Terminal1BWbsignalexitdbtofl__fltodb__dbtol__ltodb__dbadd__dbsub__dbmul__dbdiv__ldiv__M2Systemx`%T4CRBa\pxR"F( 7RGM2System_argcM2System_argvM2System_environTerminal_WriteLnTerminal_WriteStringFileSystemFileSystem_ShowStatusM2System__gate_M2System_convertM2System_retvalM2System_HALTXM2System_MULU32M2System_DIVU32M2System_MULS32M2System_DIVS32M2System_FADDsM2System_FSUBsM2System_FMULsM2System_FDIVsM2System_FREMsM2System_FCMPsM2System_FNEGsM2System_FABSsM2System_FLOATsM2System_TRUNCsM2System_FADDdM2System_FSUBdM2System_FMULdM2System_FDIVdM2System_FREMdM2System_FCMPdM2System_FNEGdM2System_FABSdM2System_FLOATdM2System_TRUNCdM2System_FLONGM2System_FSHORT MathLib0.o/ 590957990 102 100 100644 9753 ` R#9M ,.text .datab@.bssNVgN^NuNNN`NV-n &nBS 0$.//No .$Y/. a -_ <$. //Nl& . Y/N-_ .Y/N-_ . $#;:`#8Z!#? #=hB#:%xb#5IBN^NuNegative number! Range Error!! Range Error!!The power is too big!!The power is too small!!  Hj  L h !  J\  4 Pt#$$ 8J$bt$!. Rftz $  !$ <Th! # *< Tv ! 8 R f$ z$   !      .  @ F T  f l z               0! H Z  v       \         v    ! #<`#$$ $(Rf x  (L!\~#$#$($: @Pb$ $ <F`t  2Xj|!  !  >\#$.8BLV`jt~ .filegMathLib0.o.text.datab.bssInOut&8D]MathLib0u #2AP^m|LN t bZ| MathLib0_MathStatusInOut_WriteLnInOut_WriteStringConversionsConversions_RealToStringConversions_StringToIntMathLib0__gate_FileSystemMathLib0_LnAMathLib0_LnBMathLib0_ExpPMathLib0_ExpQMathLib0_LnC1MathLib0_ArcTanPMathLib0_ArcTanQMathLib0_ArcTanAMathLib0_SinRMathLib0_SinCM2System_FCMPsM2System_FMULsM2System_FNEGsMathLib0_sqrtM2System_FADDsM2System_FDIVsMathLib0_expM2System_FLOATsM2System_FSUBsMathLib0_lnMathLib0_arctanMathLib0_entierMathLib0_sinMathLib0_cosMathLib0_powMathLib0_real Storage.o/ 590957999 102 100 100644 1017 ` R#9M.text .data2@.bss..NVgN^NuN`NVB/.NX.&n &&n Jf?<HyNN^NtNV&n/NXN^NtNVB/.&n /NP.&n &&n $JBf?< HyNN^NtNVB/.NX.-_$.JBfB. `` | ` HnahN^NtBN^NuStorage.ALLOCATE: Heap overflow.Heap overflow. (FL b   .filegStorage.o.text .data2.bss.mallocfreereallocStorage-<MV`nsErrorHandlingErrorHandling_ErrorMessageStorage__gate_Storage_ALLOCATEStorage_DEALLOCATEStorage_REALLOCATEStorage_Available Strings.o/ 590958008 102 100 100644 1628 ` R#9M.text" .data""@.bss""NVgN^Nu`NV4. RBgRB&n-O$OSBQBn4.&nJ3 gRn`=n`N^NtNV4.RBgRB&n-O$OSBQBnBg?./.az4SB=BBn?.4.Wb04. 8.Bd4.&n8.$n@ RnRndT4. 8.Bb4.&nB3 N^Nt NV4.RBgRB&n-O$OSBQ4.RBgRB&n-O$OSBQ?./.?. /.aBg?. /.a=_Bg?./.a4SB=BBn?.4.Wb04. 8.Bd4.&n8.$n@ RnRndT4. 8.Bb4.&nB3 N^NtNV4.RBgRB&n-O$OSBQ4. RBgRB&n-O$OSBQBn4.&n8.$n3 2@f 4.&nJ3 f Bn` 0 = Daylight savings time is in effect *) END; stattype = RECORD st_mode : WORD; (* File node *) st_ino : InoType; (* Inode number *) st_dev : DevType; (* ID of device containing a directory entry for this file *) st_rdev : DevType; (* ID of device. This entry is defined only for character special or block special files *) st_nlink : WORD; (* Number of links *) st_uid : WORD; (* User ID of the file's owner *) st_gid : WORD; (* Group ID of the file's group *) st_size : OffType; (* File size in bytes *) st_atime : LONGINT; (* Time of last access *) st_mtime : LONGINT; (* Time of last data modification *) st_ctime : LONGINT (* Time of last file status change *) END; intPtr = POINTER TO LONGINT; charPtr = POINTER TO CHAR; Stream = POINTER TO FileBlock; tmsPtr = POINTER TO tms; tmPtr = POINTER TO tm; timestringPtr = POINTER TO timestring; statPtr = POINTER TO stattype; VAR _iob : IOBlock; (* extern _iob in file.h *) errno : LONGINT; (* extern errno in errno.h *) optarg : ADDRESS; (* return the option argument *) optind : LONGINT; (* return the option index *) PROCEDURE abort () : LONGINT; PROCEDURE access ( path : ARRAY OF CHAR ; mode : BITSET ) : LONGINT; PROCEDURE chdir ( path : ARRAY OF CHAR ; mode : BITSET ) : LONGINT; PROCEDURE chmod ( path : ARRAY OF CHAR ; mode : BITSET ) : LONGINT; PROCEDURE chown ( path : ARRAY OF CHAR ; owner, group : BITSET ) : LONGINT; PROCEDURE close ( fileds : LONGINT ) : LONGINT; PROCEDURE creat ( filename : ARRAY OF CHAR ; mode : BITSET ) : LONGINT; PROCEDURE dup ( fileds : LONGINT ) : LONGINT; PROCEDURE exit ( status : LONGINT ); PROCEDURE fclose ( stream : Stream ): LONGINT; PROCEDURE fflush ( stream : Stream ) : LONGINT; PROCEDURE fopen ( filename : ARRAY OF CHAR; type : ARRAY OF CHAR ) : Stream; PROCEDURE freopen ( filename, type : ARRAY OF CHAR; stream : Stream ) : Stream; PROCEDURE fdopen ( fileds : LONGINT ; type : ARRAY OF CHAR ) : Stream; PROCEDURE fread ( ptr : ARRAY OF BYTE ; size, nitems : LONGINT ; stream : Stream ) : LONGINT; PROCEDURE fwrite ( ptr : ARRAY OF BYTE ; size, nitems : LONGINT ; stream : Stream ) : LONGINT; PROCEDURE fseek ( stream : Stream ; offset : LONGINT ; ptrname : LONGINT ) : LONGINT; PROCEDURE rewind ( stream : Stream ) : LONGINT; PROCEDURE ftell ( stream : Stream ) : LONGINT; PROCEDURE getcwd ( buf : ARRAY OF CHAR ; size : LONGINT ) : ADDRESS; PROCEDURE link ( filename1, filename2 : ARRAY OF CHAR ) : LONGINT; PROCEDURE malloc ( size : LONGCARD ) : ADDRESS; PROCEDURE free ( ptr : ADDRESS ); PROCEDURE realloc ( ptr : ADDRESS ; size : LONGCARD ) : ADDRESS; (* PROCEDURE mallinfo () : struc *) PROCEDURE mknod ( VAR path : ARRAY OF CHAR ; mode : BITSET ; dev : LONGINT ) : LONGINT; PROCEDURE system ( VAR string : ARRAY OF CHAR ) : LONGINT; PROCEDURE unlink ( VAR filename : ARRAY OF CHAR ) : LONGINT; PROCEDURE setbuf ( stream : Stream; VAR buf : ARRAY OF CHAR ) : LONGINT;(* IO Functions *) PROCEDURE fgetc ( stream : Stream ) : LONGINT; PROCEDURE fputc ( c : LONGINT; stream : Stream ) : LONGINT; PROCEDURE fputs ( VAR str : ARRAY OF CHAR ; stream : Stream ) : LONGINT; PROCEDURE sscanf ( VAR s : ARRAY OF CHAR; VAR format : ARRAY OF CHAR; r: ADDRESS) : LONGINT; PROCEDURE sprintf ( VAR s : ARRAY OF CHAR; VAR format : ARRAY OF CHAR; HighReal : LONGINT; LowReal : LONGINT) : LONGINT; PROCEDURE getenv ( VAR name : ARRAY OF CHAR ) : ADDRESS; PROCEDURE putenv ( VAR string : ARRAY OF CHAR ) : LONGINT; (* time and date *) PROCEDURE times ( buffer : tmsPtr ) : LONGINT; (* Get process and child process times *) PROCEDURE time ( tloc : intPtr) : LONGINT; (* Get time *) PROCEDURE stime ( tp : intPtr) : LONGINT; PROCEDURE ctime ( clock : intPtr) : timestringPtr; PROCEDURE localtime ( clock : intPtr) : tmPtr; PROCEDURE gmtime ( clock : intPtr) : tmPtr; PROCEDURE asctime ( tm : tmsPtr) : timestringPtr; (* get file status *) PROCEDURE stat ( VAR path : ARRAY OF CHAR; buf : statPtr) : LONGINT; PROCEDURE fstat ( fileds : LONGINT; buf : statPtr) : LONGINT; (* temporary file creation *) PROCEDURE mktemp ( VAR template : ARRAY OF CHAR) : charPtr; PROCEDURE tmpfile () : Stream; PROCEDURE tmpnam ( VAR s : ARRAY OF CHAR) : charPtr; PROCEDURE tempnam ( VAR dir : ARRAY OF CHAR; VAR pfx : ARRAY OF CHAR) : charPtr; PROCEDURE getpid () : LONGINT; PROCEDURE getpgrp () : LONGINT; PROCEDURE getppid () : LONGINT; PROCEDURE kill ( pid : LONGINT; sig : LONGINT) : LONGINT; PROCEDURE fork () : LONGINT; PROCEDURE pause () : LONGINT; PROCEDURE sleep ( seconds : LONGINT) : LONGINT; PROCEDURE signal ( Sig : LONGINT; Func : SignalProc): LONGINT; PROCEDURE wait ( stat_loc : intPtr ) : LONGINT; PROCEDURE alarm ( sec : LONGINT) : LONGINT; PROCEDURE gsignal ( sig : LONGINT) : LONGINT; PROCEDURE ssignal ( Sig : LONGINT; action : SignalProc): LONGINT; PROCEDURE execv ( VAR path : ARRAY OF CHAR; argv : ADDRESS) : LONGINT; PROCEDURE rand () : LONGINT; PROCEDURE srand ( seed : LONGINT); PROCEDURE getopt(argc : LONGCARD; argv : ADDRESS; optstring : ARRAY OF CHAR) : LONGINT; (* routines for 32 bit integer and 32 & 64 bit float arithmetic *) PROCEDURE dbtofl__; (* convert LONGREAL to REAL *) PROCEDURE fltodb__; (* convert REAL to LONGREAL *) PROCEDURE ltodb__; (* convert LONGINT to LONGREAL *) PROCEDURE dbtol__; (* convert LONGREAL to LONGINT *) PROCEDURE dbadd__; (* add 2 LONGREALs *) PROCEDURE dbsub__; (* subtract 2 LONGREALs *) PROCEDURE dbmul__; (* multiply 2 LONGREALs *) PROCEDURE dbdiv__; (* divide 2 LONGREALs *) PROCEDURE ldiv__(divisor: LONGINT); (* divide 2 LONGINTs *) END CLibrary. 0707070000020044711006440001460001440000010672110427416053600003600000003355/usr/local/lib/mod2/Clock.def (**********************************************************) (* *) (* Module Name: Clock *) (* *) (* Purpose: Determine the current date and time. *) (* *) (**********************************************************) DEFINITION MODULE Clock; FROM CLibrary CIMPORT tm; (* This record is defined in the CLibrary. It is here only so the user *) (* can see its structure without looking at the CLibrary definition module *) (* tm = RECORD tm_sec : LONGINT; second, 0 - 59 tm_min : LONGINT; minutes, 0 - 59 tm_hour : LONGINT; hours, 0 - 23 tm_mday : LONGINT; day of month, 1 - 31 tm_mon : LONGINT; month of year, 1 - 12 tm_year : LONGINT; year - 1900 tm_wday : LONGINT; day of week, Sunday = 0 tm_yday : LONGINT; day of year, 0 - 365 tm_isdst : LONGINT; > 0 = Daylight savings time in effect END; *) TYPE TimeRecType = tm; (* for use in calls to "Time" *) PROCEDURE Time(VAR timerec : TimeRecType); (* * Returns current date and time broken down into its various components. *) PROCEDURE ClockTime (VAR time: LONGINT); (* * Returns current date and time as the number of seconds since * 00:00:00 GMT, January 1, 1970. *) PROCEDURE Date (VAR date: ARRAY OF CHAR); (* * Returns current date and time in string "date", which must have a * minimum length of 26 chars. *) PROCEDURE ConvertTime (time: LONGINT; VAR date: ARRAY OF CHAR); (* * Converts "time", which is usually the result of a call to ClockTime, * into a character string which is returned in "date". "date" must * have a minimum length of 26 chars. *) END Clock. 0707070000020044751006440001460001440000010672160427416053700004300000006245/usr/local/lib/mod2/Conversion.def (***********************************************************) (* *) (* Module Name: Conversions *) (* *) (* Purpose: Routines for converting various numeric *) (* types to corresponding character *) (* strings, vice versa, and a few *) (* number-to-number conversions. *) (* *) (***********************************************************) DEFINITION MODULE Conversions; FROM SYSTEM IMPORT BYTE, WORD; PROCEDURE Done(): BOOLEAN; (* * Returns TRUE if last String/Number conversion was successful. *) (********************************) (* Number to string conversions *) (********************************) PROCEDURE NumToString (num: WORD; len, base: CARDINAL; VAR s: ARRAY OF CHAR); PROCEDURE OctToString (num: WORD; len: CARDINAL; VAR s: ARRAY OF CHAR); PROCEDURE HexToString (num: WORD; len: CARDINAL; VAR s: ARRAY OF CHAR); PROCEDURE IntToString (num: INTEGER; len: CARDINAL; VAR s: ARRAY OF CHAR); PROCEDURE CardToString (num: CARDINAL; len: CARDINAL; VAR s: ARRAY OF CHAR); PROCEDURE LongIntToString (num: LONGINT; len: CARDINAL; VAR s: ARRAY OF CHAR); PROCEDURE LongCardToString (num: LONGCARD; len: CARDINAL; VAR s: ARRAY OF CHAR); PROCEDURE LongOctToString (num: LONGCARD; len: CARDINAL; VAR s: ARRAY OF CHAR); PROCEDURE LongHexToString (num: LONGCARD; len: CARDINAL; VAR s: ARRAY OF CHAR); PROCEDURE RealToString (num : REAL; decimal: CARDINAL; len : CARDINAL; form : CHAR; VAR s : ARRAY OF CHAR); (* * "decimal" indicates the number of digits desired after the decimal point; * If "form" = 'e', then "num" is given in scientific notation. * If "form" = 'f', then "num" is given in decimal notation. *) (********************************) (* String to number conversions *) (********************************) PROCEDURE StringToOct (s: ARRAY OF CHAR): CARDINAL; PROCEDURE StringToLongOct (s: ARRAY OF CHAR): LONGCARD; PROCEDURE StringToHex (s: ARRAY OF CHAR): CARDINAL; PROCEDURE StringToLongHex (s: ARRAY OF CHAR): LONGCARD; PROCEDURE StringToInt (s: ARRAY OF CHAR): INTEGER; PROCEDURE StringToLongInt (s: ARRAY OF CHAR): LONGINT; PROCEDURE StringToCard (s: ARRAY OF CHAR): CARDINAL; PROCEDURE StringToLongCard (s: ARRAY OF CHAR): LONGCARD; PROCEDURE StringToReal (s : ARRAY OF CHAR) : REAL; (********************************) (* Number to number conversions *) (********************************) PROCEDURE ByteToLongInt (num: BYTE): LONGINT; PROCEDURE WordToLongInt (num: WORD): LONGINT; END Conversions. 0707070000020044761006440001460001440000010672200427416053700004200000002235/usr/local/lib/mod2/Coroutine.def (**********************************************************) (* *) (* Module Name: Coroutine *) (* *) (* Purpose: Routines for coroutine creation and *) (* activation. *) (* *) (**********************************************************) DEFINITION MODULE Coroutine; FROM SYSTEM IMPORT ADDRESS; PROCEDURE NEWPROCESS(p: PROC; wspaceadr: ADDRESS; wspacesize: LONGCARD; VAR cor: ADDRESS); (* * Create a new coroutine that represents procedure "p". * "wspaceadr" should be the address of a PRE-ALLOCATED block of memory * of size "wspacesize". This space is used for the control block for * the coroutine as well as its run-time stack. The address returned * in "cor" should then be used in subsequent calls to TRANSFER. *) PROCEDURE TRANSFER(VAR source, destination : ADDRESS); (* * Transfer control of the CPU from coroutine "source" to coroutine * "destination". State information is saved for "source" such that * any subsequent TRANSFER to it will result in its resumption at the * first statement after the TRANSFER call. *) END Coroutine. 0707070000020044671006440001460001440000010672210427416053700004300000001457/usr/local/lib/mod2/ErrorHandl.def (**********************************************************) (* *) (* Module Name: ErrorHandling *) (* *) (* Purpose: Routines for writing error messages on *) (* on the terminal screen. *) (* *) (**********************************************************) DEFINITION MODULE ErrorHandling; PROCEDURE HaltMessage (Str : ARRAY OF CHAR); (* * Writes the string "Str" on Stderr (by default, your terminal screen), * and halts the program with a call to HALT. *) PROCEDURE ErrorMessage (Str : ARRAY OF CHAR); (* * Writes the string "Str" on Stderr (by default, your terminal screen), * but does not halt execution of the program. The program just continues. *) END ErrorHandling. 0707070000020042321006440001460001440000010672270427416053700004300000005550/usr/local/lib/mod2/FileInform.def (**********************************************************) (* *) (* Module Name: FileInformation *) (* *) (* Purpose: Routines for getting status information*) (* about files. *) (* *) (**********************************************************) DEFINITION MODULE FileInformation; FROM CLibrary CIMPORT stat, fstat, InoType, DevType, OffType; FROM SYSTEM IMPORT WORD; (* * There are two sets of procedures. They have the same functionality, * but one set specifies the file by a path name, while the other uses * a file descriptor. In other words, the former can work on a file * that has not been opened yet, while the latter uses a file * descriptor obtained from a call to "open" in the C library. *) PROCEDURE GetMode (path : ARRAY OF CHAR) : WORD; (* File mode *) PROCEDURE GetIno (path : ARRAY OF CHAR) : InoType; (* Inode number *) PROCEDURE GetDev (path : ARRAY OF CHAR) : DevType; (* ID of device containing a directory entry for this file *) PROCEDURE GetRdev (path : ARRAY OF CHAR) : DevType; (* ID of device. This entry is defined only for character special or block special file *) PROCEDURE GetNlink (path : ARRAY OF CHAR) : WORD; (* Number of links *) PROCEDURE GetUid (path : ARRAY OF CHAR) : WORD; (* User ID of the file's owner *) PROCEDURE GetGid (path : ARRAY OF CHAR) : WORD; (* Group ID of the file's group *) PROCEDURE GetSize (path : ARRAY OF CHAR) : OffType; (* File size in bytes *) PROCEDURE GetAtime (path : ARRAY OF CHAR) : LONGINT; (* Time of last access *) PROCEDURE GetMtime (path : ARRAY OF CHAR) : LONGINT; (* Time of last data modification *) PROCEDURE GetCtime (path : ARRAY OF CHAR) : LONGINT; (* Time of last file status change *) PROCEDURE fGetMode (filedescr: LONGINT) : WORD; (* File mode *) PROCEDURE fGetIno (filedescr: LONGINT) : InoType; (* Inode number *) PROCEDURE fGetDev (filedescr: LONGINT) : DevType; (* ID of device containing a directory entry for this file *) PROCEDURE fGetRdev (filedescr: LONGINT) : DevType; (* ID of device. This entry is defined only for character special or block special file *) PROCEDURE fGetNlink (filedescr: LONGINT) : WORD; (* Number of links *) PROCEDURE fGetUid (filedescr: LONGINT) : WORD; (* User ID of the file's owner *) PROCEDURE fGetGid (filedescr: LONGINT) : WORD; (* Group ID of the file's group *) PROCEDURE fGetSize (filedescr: LONGINT) : OffType; (* File size in bytes *) PROCEDURE fGetAtime (filedescr: LONGINT) : LONGINT; (* Time of last access *) PROCEDURE fGetMtime (filedescr: LONGINT) : LONGINT; (* Time of last data modification *) PROCEDURE fGetCtime (filedescr: LONGINT) : LONGINT; (* Time of last file status change *) END FileInformation. 0707070000020043471006440001460001440000010456210427416054000004300000016125/usr/local/lib/mod2/FileSystem.def (**********************************************************) (* *) (* Module Name: FileSystem *) (* *) (* Purpose: Routines for file manipulation and I/O *) (* *) (**********************************************************) DEFINITION MODULE FileSystem; FROM SYSTEM IMPORT ADDRESS, BYTE, WORD; FROM CLibrary CIMPORT NAME_MAX, Stream; CONST EOL = 12C; (* *) MAX_FILENAME = 127; TYPE File = Stream; FileName = ARRAY [0..MAX_FILENAME] OF CHAR; ModeType = (O_RDONLY, O_WRONLY , O_APPEND, O_RDWR , O_WRUPDATE, O_APPENDUPDATE); VAR Stdin, Stdout, Stderr : File; Base_iob : ADDRESS; (*********************************************************************** * * * A file is identified by an external and by an internal name; * * the external name is a string according to Unix filename conventions,* * the internal name is a MODULA variable of type File. * * The procedures Open and Create link both names and establish an * * access path to the file. The procedures Close and Release destroy * * this link and disable further access to the file. * * An accessible file has an implicit (access-) position that is used * * and updated by most of the FileSystem procedures (see below). * * With a call to the function "Done" you can determine if a previous * * call to another FileSystem procedure was successful. * * * ***********************************************************************) PROCEDURE Done(): BOOLEAN; (* * Should be called after each FileSystem procedure to determine if * that call was successful. *) PROCEDURE Create(VAR f: File; filename: ARRAY OF CHAR); (* * Create a new file named "filename" and open it for read/write access. *) PROCEDURE CreateTempfile (VAR f : File; filename : ARRAY OF CHAR); (* * Creates a new file with a unique name. The file is also opened for * read/write access. The parameter "filename" should look like a * file name with six trailing Xs (for example, "/tmp/fnameXXXXXX"). * These trailing Xs are then filled in with the pid of this program, * thus helping ensure a unique file name. It is not really * "temporary", though; it is not removed when closed. *) PROCEDURE Open(VAR f: File; filename: ARRAY OF CHAR; mode : ModeType); (* * Open an existing file named "filename". *) PROCEDURE Close (VAR f: File); (* * Close file "f". *) PROCEDURE Release(VAR f: File); (* * If write access is allowed on the file, it is deleted. * otherwise it is just closed. *) PROCEDURE Rename(old,new: ARRAY OF CHAR); PROCEDURE Delete(filename: ARRAY OF CHAR); PROCEDURE GetPos(VAR f: File; VAR position: LONGINT); (* * Returns in "position" the current byte offset in the file of the * file pointer. The file pointer is the location in the file where * the next I/O operation will occur. *) PROCEDURE SetPos(VAR f: File; position: LONGINT); (* * Sets the file pointer to byte offset "position" such that the next * next I/O operation will occur there. *) PROCEDURE Reset(VAR f: File); (* * Move the file pointer to the beginning of the file. * Is equivalent to "SetPos(f, 0D);" *) PROCEDURE Eof(VAR f: File): BOOLEAN; (* * Returns whether or not the file pointer is past the end of the file * (i.e., there is no more data to be read from the file). *) PROCEDURE ReadMode(VAR f : File) : BOOLEAN; PROCEDURE WriteMode(VAR f : File) : BOOLEAN; PROCEDURE ReadWriteMode(VAR f : File) : BOOLEAN; PROCEDURE FileNotBuffered(VAR f : File) : BOOLEAN; PROCEDURE FileBigBuffer(VAR f : File) : BOOLEAN; PROCEDURE BufferingStatusUnknown(VAR f : File) : BOOLEAN; PROCEDURE ErrorOnFile(VAR f : File) : BOOLEAN; (***********************************) (***** binary I/O operations *******) (***********************************) (* * In all cases, the file pointer is advanced however many bytes the * operation required. *) PROCEDURE ReadByte (VAR f: File; VAR b: BYTE); (* * Read one byte. *) PROCEDURE ReadWord (VAR f: File; VAR w: WORD); (* * Read one word (2 bytes). *) PROCEDURE ReadLongWord(VAR f: File; VAR s: ARRAY OF BYTE); (* * Read one long word (4 bytes). *) PROCEDURE WriteByte (VAR f: File; b: BYTE); (* * Write one byte. *) PROCEDURE WriteWord (VAR f: File; w: WORD); (* * Write one word (2 bytes). *) PROCEDURE WriteLongWord(VAR f: File; s: ARRAY OF BYTE); (* * Write one long word (4 bytes). *) PROCEDURE Flush (VAR f : File); (* * Flush all data buffered for a disk file out to the disk. * (Actually only schedules it for writing to the disk - the operating * system actually determines when it gets physically written on disk). *) (*****************************) (***** textfile access *******) (*****************************) PROCEDURE ReadChar (VAR f: File; VAR ch: CHAR); (* * Read one character (1 byte interpreted as a character). *) PROCEDURE WriteChar(VAR f: File; ch: CHAR); (* * Write character "ch" (1 byte). *) PROCEDURE WriteString (VAR f : File; str : ARRAY OF CHAR); (* * Write string "str". *) PROCEDURE ReadRecord (VAR f: File; VAR bufPtr: ARRAY OF BYTE; requestedBytes: CARDINAL; VAR read : CARDINAL); (* * Read a block of data from file "f" into "bufPtr". If possible, * "requestedBytes" are read. The number of bytes actually read is * returned in "read" (you may encounter EOF before all the bytes * can be read, for example). *) PROCEDURE WriteRecord (VAR f: File; VAR bufPtr: ARRAY OF BYTE; requestedBytes: CARDINAL; VAR written : CARDINAL); (* * Write "reqestedBytes" bytes of data from "bufPtr" into file "f". * The number of bytes successfully written is returned in "written". *) PROCEDURE GetName (VAR f: File; VAR filename: ARRAY OF CHAR); (* * Returns the name of the file currently open on "f". *) PROCEDURE FileNameLengthCheck (Filename : ARRAY OF CHAR; VAR resultname : ARRAY OF CHAR); (* * Gross. Don't even try to use it. *) PROCEDURE Parse (filename : ARRAY OF CHAR; VAR resultname : ARRAY OF CHAR); (* * Who knows what this really does? *) PROCEDURE ShowStatus; (* * Display the error message on stdout caused by the last file I/O * operation that failed. This should be called if a call "Done" * returns FALSE after an I/O operation from a FileSystem routine. *) END FileSystem. 0707070000020043401006440001460001440000010764330427416054000003600000010477/usr/local/lib/mod2/InOut.def (*************************************************************) (* *) (* Module Name: InOut *) (* *) (* Purpose: Routines for general purpose, high-level, *) (* sequential I/O. Default output goes *) (* to the terminal screen (stdout), and *) (* input is taken from the keyboard (stdin)*) (* *) (*************************************************************) DEFINITION MODULE InOut; FROM FileSystem IMPORT File; CONST EOL = 012B; (* line feed *) VAR Done : BOOLEAN; (* TRUE if last I/O op. successful. FALSE if failed. *) termCH : CHAR; in, out : File; PROCEDURE OpenInput(filename: ARRAY OF CHAR); (* * "filename" is opened to be used by InOut for all subsequent input. * Done := "file was succesfully opened". *) PROCEDURE OpenOutput(filename: ARRAY OF CHAR); (* * "filename" is opened to be used by InOut for all subsequent output. * Done := "file was succesfully opened". *) PROCEDURE CloseInput; (* * Close the current input file for InOut. Subsequent input comes * from the keyboard (stdin). *) PROCEDURE CloseOutput; (* * Close the current output file for InOut. Subsequent output goes * to the terminal screen (stdout). *) PROCEDURE Read(VAR ch: CHAR); (* Done := NOT Eof(in) *) PROCEDURE ReadLn; (* skip to the beginning of the next input line *) PROCEDURE ReadString(VAR s: ARRAY OF CHAR); (* * Read a string, i.e. a sequence of characters not containing * blanks nor control characters; leading blanks are ignored. * Input is terminated by any character <= " "; * this character is assigned to termCH. *) PROCEDURE ReadInt(VAR i: INTEGER); (* * Read a string of characters and convert it to an integer. * Syntax: integer = ["+"|"-"]digit{digit}. * Leading blanks are ignored. * Done := "integer was read". *) PROCEDURE ReadCard(VAR c: CARDINAL); (* * Read a string of characters and convert it to an cardinal. * Syntax: cardinal = digit{digit}. * Leading blanks are ignored. * Done := "cardinal was read". *) PROCEDURE ReadOct(VAR c: CARDINAL); (* * Read a string of characters and convert it to a cardinal. * Syntax: cardinal = octdigit{octdigit}, where "octdigit" = [0..7]. * Leading blanks are ignored. * Done := "octal cardinal was read". *) PROCEDURE ReadHex(VAR c: CARDINAL); (* * Read a string of characters and convert it to a cardinal. * Syntax: cardinal = hexdigit{hexdigit}, where "hexdigit" = [0..9,A..F]. * Leading blanks are ignored. * Done := "hexidecimal cardinal was read". *) PROCEDURE ReadReal(VAR c: REAL); PROCEDURE ReadLongInt(VAR i: LONGINT); PROCEDURE ReadLongCard(VAR c: LONGCARD); PROCEDURE ReadLongOct(VAR c:LONGCARD); PROCEDURE ReadLongHex(VAR c:LONGCARD); PROCEDURE Write(ch: CHAR); PROCEDURE WriteLn; PROCEDURE WriteString(s: ARRAY OF CHAR); PROCEDURE WriteInt(i: INTEGER; n: CARDINAL); (* * Write integer "i" with (at least) "n" characters on file "out". * If n is greater then the number of digits needed, * blanks are added preceding the number. *) PROCEDURE WriteCard(c: CARDINAL; n: CARDINAL); PROCEDURE WriteOct(c: CARDINAL; n: CARDINAL); PROCEDURE WriteHex(c: CARDINAL; n: CARDINAL); PROCEDURE WriteReal (r : REAL; d, n : CARDINAL); (* * Display the REAL number "r" in decimal notation, with "d" * places printed past the decinal point, and "n" characters * printed overall. If "n" is more than what is needed to print the * number, then blank spaces are padded on the left. *) PROCEDURE WriteEReal (r : REAL; d, n : CARDINAL); (* * Display the REAL number "r" in scientific notation, with "d" * places printed past the decinal point, and "n" characters * printed overall. If "n" is more than what is needed to print the * number, then blank spaces are padded on the left. *) PROCEDURE WriteLongInt(i: LONGINT; n: CARDINAL); PROCEDURE WriteLongCard(c: LONGCARD; n: CARDINAL); PROCEDURE WriteLongOct(c: LONGCARD; n: CARDINAL); PROCEDURE WriteLongHex(c: LONGCARD; n: CARDINAL); END InOut. 0707070000020042271006440001460001440000010764370427416054000004100000011243/usr/local/lib/mod2/M2System.def (**********************************************************) (* *) (* Module Name: M2System *) (* *) (* Purpose: Run-time support. A user should never *) (* use anything from this module. *) (* *) (**********************************************************) DEFINITION MODULE M2System; FROM SYSTEM IMPORT ADDRESS; (* 'System' FOR MC68000/MC68010 runtime support of Modula-2.*) (* System procedure numbers used by the compiler : *) (* These numbers must correspond with the procedure numbers *) (* associated with a specific procedure in the definition *) (* module 'System'. *) (* BodyOfSystem = 0; (* 0 is reserved for module body *) HALTX = 1; (* System.HALTX = HALT-statement *) MULU32 = 2; (* System.MULU32 = unsigned long MUL *) DIVU32 = 3; (* System.DIVU32 = unsig. long DIV/MOD *) MULS32 = 4; (* System.MULS32 = signed long MUL *) DIVS32 = 5; (* System.DIVS32 = signed long DIV/MOD *) FADDs = 6; (* System.FADDs = Floating ADD single *) FSUBs = 7; (* System.FSUBs = Floating SUB single *) FMULs = 8; (* System.FMULs = Floating MUL single *) FDIVs = 9; (* System.FDIVs = Floating DIV single *) FREMs = 10;(* System.FREMs = Floating REM single *) FCMPs = 11;(* System.FDIVs = Floating CMP single *) FNEGs = 12;(* System.FNEGs = Floating NEG single *) FABSs = 13;(* System.FABSs = Floating ABS single *) FLOATs = 14;(* System.FLOATs = FLOAT single *) TRUNCs = 15;(* System.TRUNCs = TRUNC single *) FADDd = 16;(* System.FADDd = Floating ADD double *) FSUBd = 17;(* System.FSUBd = Floating SUB double *) FMULd = 18;(* System.FMULd = Floating MUL double *) FDIVd = 19;(* System.FDIVd = Floating DIV double *) FREMd = 20;(* System.FREMd = Floating REM double *) FCMPd = 21;(* System.FDIVd = Floating CMP double *) FNEGd = 22;(* System.FNEGd = Floating NEG double *) FABSd = 23;(* System.FABSd = Floating ABS double *) FLOATd = 24;(* System.FLOATd = FLOAT double *) TRUNCd = 25;(* System.TRUNCd = TRUNC double *) FLONG = 26;(* System.FLONG = Floating single to double *) FSHORT = 27;(* System.FSHORT = Floating double to single *) *) VAR argc: LONGCARD; argv: ADDRESS; environ: ADDRESS; PROCEDURE HALTX; (* argument in register D0 ! *) PROCEDURE MULU32; (* arguments and quadword-result in regs. D0/D1 ! *) PROCEDURE DIVU32; (* arguments and quadword-result in regs. D0/D1 ! *) PROCEDURE MULS32; (* arguments and quadword-result in regs. D0/D1 ! *) PROCEDURE DIVS32; (* arguments and quadword-result in regs. D0/D1 ! *) PROCEDURE FADDs (adder, addend : REAL) : REAL; PROCEDURE FSUBs (minuend, subtrahend : REAL) : REAL; PROCEDURE FMULs (multiplicand, multiplier : REAL) : REAL; PROCEDURE FDIVs (dividend, divisor : REAL) : REAL; PROCEDURE FREMs (dividend, divisor : REAL) : REAL; PROCEDURE FCMPs (first, second : REAL); (* result in CCR *) PROCEDURE FNEGs (toNeg : REAL) : REAL; PROCEDURE FABSs (toAbs : REAL) : REAL; PROCEDURE FLOATs (toFloat : LONGINT) : REAL; PROCEDURE TRUNCs (toTrunc : REAL) : LONGINT; PROCEDURE FADDd (adder, addend : LONGREAL) : LONGREAL; PROCEDURE FSUBd (minuend, subtrahend : LONGREAL) : LONGREAL; PROCEDURE FMULd (multiplicand, multiplier : LONGREAL) : LONGREAL; PROCEDURE FDIVd (dividend, divisor : LONGREAL) : LONGREAL; PROCEDURE FREMd (dividend, divisor : LONGREAL) : LONGREAL; PROCEDURE FCMPd (first, second : LONGREAL); (* result in CCR *) PROCEDURE FNEGd (toNeg : LONGREAL) : LONGREAL; PROCEDURE FABSd (toAbs : LONGREAL) : LONGREAL; PROCEDURE FLOATd (toFloat : LONGINT) : LONGREAL; PROCEDURE TRUNCd (toTrunc : LONGREAL) : LONGINT; PROCEDURE FLONG (toConvert : REAL) : LONGREAL; PROCEDURE FSHORT (toConvert : LONGREAL) : REAL; END (* OF DEFINITION MODULE *) M2System. 0707070000020040341006440001460001440000010764440427416054100004100000003464/usr/local/lib/mod2/MathLib0.def (**********************************************************) (* *) (* Module Name: MathLib0 *) (* *) (* Purpose: Various mathematical functions. *) (* *) (**********************************************************) DEFINITION MODULE MathLib0; (* * Due to the fact that the Modula-2 compiler is limited to 32-bit * calculations, this math library module will only return numbers * with the precision of 7 significant digits. *) TYPE MathLibStatus = (Valid, InValid); VAR MathStatus : MathLibStatus; (* indicates whether the last operation *) (* in MathLib0 produced a valid or invalid *) (* result. *) PROCEDURE sqrt(x : REAL) : REAL; (* * Return the square root of x. if x < 0.0 then return 0.0. *) PROCEDURE exp(x : REAL) : REAL; (* * This expoential function returns "e" raised to the "x" power. * If underflow, then return 0.0. If overflow then return MAX(REAL). *) PROCEDURE ln(x : REAL) : REAL; (* * Return natural log of x. If x <= 0.0 then return LnMinReal. *) PROCEDURE arctan(x : REAL) : REAL; (* * Return the arctangent of x, where x is in radians, not degrees. *) PROCEDURE sin(x : REAL) : REAL; (* * Return the sin of x, where x is in radians, not degrees. *) PROCEDURE cos(x : REAL) : REAL; (* * Return the cosine of x, where x is in radians, not degrees. *) PROCEDURE pow(x, y : REAL) : REAL; (* * Retrun "x" raised to the power "y". If underflow then return 0.0. * If overflow, then return MAX(REAL). *) PROCEDURE entier(x : REAL) : INTEGER; (* * Return the nearest INTEGER to the REAL x. *) PROCEDURE real(a : INTEGER) : REAL; (* * Return the REAL representation of the INTEGER x. *) END MathLib0. 0707070000020043351006440001460001440000010764460427416054100003600000006471/usr/local/lib/mod2/Procs.def (**********************************************************) (* *) (* Module Name: Procs *) (* *) (* Purpose: High-level facilities for coroutine *) (* creation and synchronization. *) (* *) (**********************************************************) DEFINITION MODULE Procs; (* * This is a modified version of Niklaus Wirth's module "Processes" which * he describes in chapter 30 of his book, "Programming in Modula-2". * It provides a mechanism for coroutines to synchronize with a special * object of type "SIGNAL", using the procedures "WAIT" and "SEND". *) FROM SYSTEM IMPORT ADDRESS; TYPE PROCESS = ADDRESS; SIGNAL = POINTER TO ProcessDescriptor; (* the object coroutines synchronize with *) ProcessDescriptor = RECORD next: SIGNAL; (* linked list of active coroutines *) queue: SIGNAL; (* queue of coroutines waiting on specific signal *) cor: PROCESS; (* control block maintained by the system *) ready: BOOLEAN; (* flag for ready or blocked state *) paddr: ADDRESS; (* address of low-level process control block *) psize: CARDINAL; (* size allocated to process *) priority: INTEGER; (* user-assigned priority - main program always = -1 *) main: BOOLEAN; (* indicates whether is main coroutine or child *) END; PROCEDURE StartProcess (P: PROC; worksize: CARDINAL; pri: INTEGER); (* * Maintains active coroutine linked list. Also starts the quasi-concurrent * process - actually a coroutine - with parameterless procedure "P", * workspace of size "worksize", and priority "pri". Priority is used * for scheduling. Whenever scheduling occurs (such as in "WAIT"), the * coroutine with the highest priority will go next. *) PROCEDURE StopProcess; (* * Stops the current coroutine, deallocates its resources, * and transfers to the next ready one with the highest priority. * This must be the last statement in every corouting, including the * main one. It also does some deadlock checking. You have deadlock * if you call "StopProcess" from the main coroutine when ALL the child * coroutines have not terminated yet (again, they terminate by calling * "StopProcess. *) PROCEDURE SEND (VAR sendsig: SIGNAL); (* * If at least one coroutine is waiting for "sendsig", the coroutine * that has been waiting the longest is resumed (i.e., it is a FIFO * wait queue, not one based on priority). *) PROCEDURE WAIT (VAR waitsig: SIGNAL); (* * Wait for some other coroutine to send "waitsig" - put the calling * coroutine on this signal's wait queue, then start up the ready * coroutine with the highest priority. *) PROCEDURE Awaited (signal: SIGNAL): BOOLEAN; (* * Returns TRUE if at least one coroutine is waiting for "signal". *) PROCEDURE Init (VAR signal: SIGNAL); (* * Initialization of a new instance of the object that coroutines * synchronize with. All "SIGNAL"s must be initialized with this * procedure before they can by used for synchronization with * "SEND" and "WAIT". *) END Procs. 0707070000020042551006440001460001440000010764510427416054100004000000002532/usr/local/lib/mod2/Storage.def (**********************************************************) (* *) (* Module Name: Storage *) (* *) (* Purpose: Procedures for memory allocation and *) (* deallocation. *) (* *) (**********************************************************) DEFINITION MODULE Storage; FROM SYSTEM IMPORT ADDRESS; PROCEDURE ALLOCATE(VAR p: ADDRESS; size: LONGCARD); (* * Allocate a block of memory with "size" bytes, returning the * starting address of the block in "p". *) PROCEDURE DEALLOCATE(VAR p: ADDRESS); (* * Deallocate the block of memory pointed to by "p". This should * be a block previously allocated by a call to Storage.ALLOCATE. *) PROCEDURE Available(size : LONGINT) : BOOLEAN; (* * Return whether or not "size" bytes are available from the heap. *) PROCEDURE REALLOCATE (VAR p : ADDRESS; size : LONGINT); (* * Alter the size of the previously allocated block of memory pointed * to by "p". The new block will contain "size" bytes, with the * (perhaps different) starting address returned in "p". If the * the request is for a bigger block, then the existing block may * get copied to a new location in memory where the larger block can * fit. *) END Storage. 0707070000020042261006440001460001440000010764520427416054100004000000003446/usr/local/lib/mod2/Strings.def (**********************************************************) (* *) (* Module Name: Strings *) (* *) (* Purpose: Routines for string manipulation. *) (* *) (**********************************************************) DEFINITION MODULE Strings; FROM CLibrary CIMPORT charPtr; PROCEDURE StringLen(Str : ARRAY OF CHAR) : CARDINAL; (* * Returns the length of the string "Str". "Str" must be * null-terminated (end with the character 0C) for this function to * handle it properly. String constants are guaranteed by the * compiler to be null-terminated. *) PROCEDURE CopyString(Str1 : ARRAY OF CHAR; VAR Str2 : ARRAY OF CHAR); (* * Copy string "Str1" into string "Str2". Again, you should make sure * "Str1" is terminated with a null character (manually put one there if * you are not sure - an extra one won't hurt). That null character * will be copied into "Str2". *) PROCEDURE AppendString(Str1, Str2 : ARRAY OF CHAR; VAR Str3 : ARRAY OF CHAR); (* * Concatenate "Str1" and "Str2", returning the result in "Str3". *) PROCEDURE CmpString(Str1, Str2 : ARRAY OF CHAR) : INTEGER; (* * Compare strings "Str1" and "Str2". 0 is returned when * Str1 and Str2 are identical, -1 if Str1 < Str2, * and 1 if Str1 > Str2; *) PROCEDURE CmpNString(Str1, Str2 : ARRAY OF CHAR; n : CARDINAL) : INTEGER; (* * Same as CmpString, but just compare first "n" characters. *) PROCEDURE StringChr(Str : ARRAY OF CHAR; c : CHAR) : charPtr; (* * Search for character "c" in the string "Str". Return * the address in "Str" of the first occurence of that character. *) END Strings. 0707070000020040271006440001460001440000010764530427416054200004100000002370/usr/local/lib/mod2/Terminal.def (**********************************************************) (* *) (* Module Name: Terminal *) (* *) (* Purpose: Basic routines for writing and reading *) (* to and from the terminal (really *) (* stdout and stdin). *) (* *) (**********************************************************) DEFINITION MODULE Terminal; PROCEDURE Read(VAR ch: CHAR); (* * Read a single character from stdin, returning it in "ch". *) PROCEDURE ReadString(VAR s: ARRAY OF CHAR); (* * Read a string of characters. Input is terminated by a line terminator * (FileSystem.EOL, or just pressing the carriage return on the keyboard), * or when all the cells in array "s" are filled, or reaching EOF. *) PROCEDURE ReadLn; (* * Skip to the start of the next line. *) PROCEDURE ReadAgain; (* * Allow the last character read to be read again. *) PROCEDURE Write(ch: CHAR); (* * Put "ch" on stdout. *) PROCEDURE WriteString(s: ARRAY OF CHAR); (* * Put string "s" on stdout. *) PROCEDURE WriteLn; (* * Puts FileSystem.EOL (linefeed character) on stdout *) END Terminal. 0707070000020024531006440001460001440000010764540431624676100004200000000344/usr/local/lib/mod2/Arguments.sym#9L Arguments ArgCount  GetArgument!"GetEnvironment# PutEnvironment$%GetOpt0707070000020014041006440001460001440000010764550431624676100004100000010152/usr/local/lib/mod2/CLibrary.sym#9L CLibraryEOFNULLNFILEIOREADIOWRTIONBFIOMYBUFIOEOFIOERRIOUNKIORWEOKEPERMENOENTESRCHEINTREIOENXIOE2BIGENOEXEC EBADF ECHILD EAGAIN ENOMEM EACCESEFAULTENOTBLKEBUSYEEXISTEXDEVENODEVENOTDIREISDIREINVALENFILEEMFILEENOTTYETXTBSYEFBIGENOSPCESPIPEEROFSEMLINK EPIPE!EDOM"ERANGE#ENOMSG$EIDRM-EDEADLKR_OKW_OKX_OKF_OKL_SETL_CURL_END NAME_MAXSigHupSigIntSigQuitSigIllSigTrapSigIotSigEmtSigFpe SigKill SigBus SigSegv SigSys SigPipeSigAlrmSigTermSigUsr1SigUsr2SigCldSigPwrSigWind SigPhoneInoTypeDevTypeOffType FileRange!" timestring ptrcnt base flag fd# FileBlock# $IOBlock% SignalProc tms_utime tms_stime tms_cutime tms_cstime&tmstm_sectm_mintm_hour tm_mdaytm_montm_yeartm_wdaytm_yday tm_isdst$'tmst_modest_inost_devst_rdev st_nlink st_uid st_gidst_size st_atime st_mtime st_ctime( stattype)intPtr*charPtr+Stream,tmsPtr-tmPtr.timestringPtr/statPtr$_ioberrno optargoptindabort0 access1 chdir2 chmod3   chownclose4 creatdup exit+ fclose+ fflush56+ fopen77++ freopen8+ fdopen 9+fread :+fwrite+ fseek+rewind+ftell;  getcwd<< link malloc free  realloc=  mknod>system?unlink+@ setbuf+fgetc+fputcA+ fputsBC  sscanfDE!sprintfF "getenvG#putenv,$times)%time)&stime).'ctime)-( localtime)-)gmtime,.*asctimeH/+ stat/,fstatI*-mktemp+.tmpfileJ*/tmpnamKL*0 tempnam1getpid2getpgrp3getppid4kill5fork6pause7sleep%8signal)9wait:alarm;gsignal%<ssignalM = execv>rand?srand N@getoptA dbtofl__B fltodb__Cltodb__Ddbtol__Edbadd__Fdbsub__Gdbmul__Hdbdiv__Ildiv__)*#+&,'-".(/I0707070000020041001006440001460001440000010764620431624676100003600000000466/usr/local/lib/mod2/Clock.sym#9M Clock#9L CLibrarytm_sectm_mintm_hour tm_mdaytm_montm_yeartm_wdaytm_yday tm_isdst$ tm TimeRecType Time ClockTime!Date" ConvertTime0707070000020035511006440001460001440000010764630431624676100004300000001615/usr/local/lib/mod2/Conversion.sym#9M ConversionsDone  NumToString! OctToString" HexToString# IntToString$ CardToString% LongIntToString& LongCardToString' LongOctToString( LongHexToString)  RealToString*  StringToOct+ StringToLongOct, StringToHex-StringToLongHex. StringToInt/StringToLongInt0 StringToCard1StringToLongCard2 StringToReal ByteToLongIntWordToLongInt0707070000020051431006440001460001440000010704510431624676100004200000000142/usr/local/lib/mod2/Coroutine.sym#9M> Coroutine    NEWPROCESS  TRANSFER0707070000020035521006440001460001440000010764640431624676100004300000000147/usr/local/lib/mod2/ErrorHandl.sym#9LErrorHandling  HaltMessage! ErrorMessage0707070000020035531006440001460001440000010764650431624676200004300000001276/usr/local/lib/mod2/FileInform.sym#9MMFileInformation#9L CLibrary GetMode!GetIno"GetDev#GetRdev$ GetNlink%GetUid&GetGid'GetSize(  GetAtime)  GetMtime*  GetCtime  fGetMode fGetInofGetDev fGetRdev fGetNlinkfGetUidfGetGid fGetSize fGetAtime fGetMtime fGetCtime0707070000020035571006440001460001440000010764700431624676200004300000002772/usr/local/lib/mod2/FileSystem.sym#9M FileSystem#9L CLibrary EOL MAX_FILENAME Stream File!" FileName# O_RDONLY# O_WRONLY# O_APPEND#O_RDWR# O_WRUPDATE#O_APPENDUPDATE# ModeType Stdin Stdout Stderr Base_iobDone $ Create % CreateTempfile &# Open Close Release'' Rename(Delete  GetPos  SetPos  Reset  Eof   ReadMode  WriteMode ReadWriteMode FileNotBuffered FileBigBuffer BufferingStatusUnknown  ErrorOnFile  ReadByte  ReadWord ) ReadLongWord   WriteByte  WriteWord * WriteLongWord Flush  ReadChar  WriteChar + WriteString , ReadRecord - WriteRecord . GetName/0! FileNameLengthCheck12" Parse# ShowStatus ptrcnt base flag fd3 FileBlock3 #0707070000020035601006440001460001440000010764720431624676200003600000002022/usr/local/lib/mod2/InOut.sym#9M(InOut#9M FileSystem#9L CLibrary EOLDonetermCH Stream in out! OpenInput" OpenOutput CloseInput CloseOutputReadReadLn# ReadStringReadInt  ReadCard ReadOct ReadHex  ReadReal  ReadLongInt ReadLongCard ReadLongOct ReadLongHexWriteWriteLn$ WriteString WriteInt WriteCard WriteOct WriteHex WriteReal WriteEReal WriteLongIntWriteLongCard WriteLongOct WriteLongHex ptrcnt base flag fd% FileBlock% 0707070000020035611006440001460001440000010764740431624676200004100000001354/usr/local/lib/mod2/M2System.sym#9L M2Systemargc argv environHALTXMULU32DIVU32MULS32DIVS32FADDsFSUBsFMULs FDIVs FREMs FCMPs FNEGs FABSsFLOATsTRUNCsFADDdFSUBdFMULdFDIVdFREMdFCMPdFNEGdFABSdFLOATdTRUNCdFLONGFSHORT0707070000020035621006440001460001440000010764750431624676200004100000000473/usr/local/lib/mod2/MathLib0.sym#9M MathLib0 Valid InValid MathLibStatus MathStatussqrtexplnarctansincospowentier real 0707070000020074221006440001460001440000010434400431624676200003600000000520/usr/local/lib/mod2/Procs.sym#9MProcs PROCESS SIGNAL next queue cor ready paddrpsize prioritymain!ProcessDescriptor  StartProcess StopProcess SEND WAIT Awaited Init! 0707070000020035631006440001460001440000010764760431624676200004000000000217/usr/local/lib/mod2/Storage.sym#9MStorage  ALLOCATE  DEALLOCATE Available  REALLOCATE0707070000020035641006440001460001440000010764770431624676200004000000000472/usr/local/lib/mod2/Strings.sym#9LStrings#9L CLibrary  StringLen!" CopyString##$ AppendString%% CmpString&& CmpNString'charPtr(' StringChr'0707070000020035651006440001460001440000010765000431624676200004100000000310/usr/local/lib/mod2/Terminal.sym#9Mq TerminalRead  ReadStringReadLn ReadAgainWrite! WriteStringWriteLn0707070000020037561006440001460001440000010401040424160603700003700000006034/usr/local/lib/mod2/SYSTEM.def DEFINITION MODULE SYSTEM; TYPE ADDRESS = POINTER TO BYTE; (* Compatible with type LONGINT and with all pointer types. *) BYTE; (* Smallest addressable unit, uninterpreted, TSIZE(BYTE) = 1, *) (* dereferencing an address gives a value of type BYTE, *) (* ARRAY OF BYTE is compatible with everything. *) WORD; (* Two uninterpreted consecutive bytes beginning at an even *) (* address (the MC68010 processor generates traps on odd word *) (* addresses). Compatible with all types having size 2. *) (* "T" subsequently denotes any simple type of size <= 4 bytes, and *) (* "AnyType" refers any defined type identifier, such as INTEGER. *) PROCEDURE ADR(VAR x: AnyType): ADDRESS; (* Returns address in memory where variable "x" is stored. *) PROCEDURE TSIZE(AnyType): INTEGER; (* Returns the number of bytes occupied by type "AnyType". *) PROCEDURE INLINE(x: WORD); (* Puts the value "x" in the machine code block of the object file. *) (* This is used to put your own machine instructions in the resulting *) (* object file. *) PROCEDURE REG(reg: INTEGER): LONGINT; (* Returns the contents of the MC68010 register specified in "reg". *) (* Legal values of "reg" range from 0 to 15, where 0-7 represent data *) (* registers D0-D7, and 8-15 corresponds to address registers A0-A7. *) (* The formal parameter must be an INTEGER or CARDINAL constant within*) (* this legal range. PROCEDURE SETREG(reg: INTEGER; val: T); (* Set MC68010 register "reg" to the value "val". Legal values for *) (* "reg" are described under PROCEDURE REG above. Like REG, the "reg"*) (* formal parameter must be an INTEGER or CARDINAL constant (i.e., it *) (* cannot be a variable). *) PROCEDURE LONG(hi, lo: CARDINAL): LONGINT; (* Return a LONGINT value that has "hi" as its 2 high order bytes, *) (* and "lo" as its 2 low order bytes: *) (* ---------------------------------------------- *) (* | ' | ' | *) (* | hi | lo | *) (* | byte4 ' byte3 | byte2 ' byte1 | *) (* ---------------------------------------------- *) (* bit 31 bit 0 *) PROCEDURE LONG(x: T): LONGINT; (* Second form of LONG *) PROCEDURE LONG(x: REAL): LONGREAL; (* Third form of LONG *) PROCEDURE SHORT(x: LONGINT): INTEGER; (* Return the INTEGER value corresponding to LONGINT "x". No range *) (* checks are performed. *) PROCEDURE SHORT(r: LONGREAL): REAL; (* Second form of SHORT that converts a LONGREAL (64-bit float) to a *) (* REAL (32-bit float). *) PROCEDURE SHIFT(x: T; n: INTEGER): T; (* Return the value of "x" left-shifted by "n" bits. If T is signed *) (* (INTEGER or LONGINT), then an arithmetic shift is performed. *) (* Otherwise (any type other than INTEGER or LONGINT), a logical *) (* shift is done. SHIFT is not allowed on REAL and LONGREAL types. *) END SYSTEM. 0707070000020076221006440001460001440000010435410427416054200004200000004604/usr/local/lib/mod2/Arguments.imp IMPLEMENTATION MODULE Arguments; FROM CLibrary CIMPORT getenv, putenv, NULL, getopt, optind, optarg; FROM ErrorHandling IMPORT ErrorMessage; FROM M2System IMPORT argc, argv, environ; FROM SYSTEM IMPORT ADDRESS, BYTE, WORD, ADR, SHORT, LONG; FROM Strings IMPORT CopyString, StringLen; TYPE CharPtr = POINTER TO CHAR; CharAry = ARRAY [0..120] OF CHAR; PROCEDURE GetArgument (argnum : CARDINAL; VAR arg : ARRAY OF CHAR; VAR length : CARDINAL); VAR argpos : POINTER TO ADDRESS; argptr : POINTER TO CharAry; argposadr : ADDRESS; displacement : LONGCARD; i: CARDINAL; BEGIN IF argnum < ArgCount THEN argposadr := argv; displacement := (4D * LONG(0,argnum)); argpos := argposadr + VAL(ADDRESS,displacement); argptr := argpos^; i := 0; WHILE argptr^[i] <> 0C DO arg[i] := argptr^[i]; INC(i); END; (* Null terminate the argument string *) arg[i] := 0C; length := StringLen(arg); ELSE ErrorMessage("Arg error : not enough arguments") END END GetArgument; PROCEDURE GetEnvironment (name : ARRAY OF CHAR; VAR value : ARRAY OF CHAR; VAR Ok : BOOLEAN); VAR i : INTEGER; charptr : POINTER TO CharAry; envstr, namestr : CharAry; BEGIN CopyString(name, namestr); charptr := (getenv(namestr)); CopyString(charptr^, envstr); IF VAL(CARDINAL,charptr) = NULL THEN Ok := FALSE ELSE Ok := TRUE; IF StringLen(envstr) <= HIGH(value) THEN CopyString(envstr, value); END END (* else ok *) END GetEnvironment; PROCEDURE PutEnvironment (VAR string : ARRAY OF CHAR; VAR Ok : BOOLEAN); VAR result : LONGINT; str : CharAry; BEGIN string[StringLen(string)] := 0C; result := putenv(string); Ok := result = LONG(0, NULL); END PutEnvironment; PROCEDURE GetOpt(optstr : ARRAY OF CHAR; VAR argstr : ARRAY OF CHAR; VAR optnum : LONGINT) : CHAR; VAR ret : LONGINT; optargptr : POINTER TO CharAry; BEGIN ret := getopt(argc, argv, optstr); optnum := optind; optargptr := optarg; CopyString(optargptr^, argstr); RETURN (CHAR(ret)); END GetOpt; BEGIN ArgCount := SHORT(argc); END Arguments. 0707070000020076211006440001460001440000010667700427416054200003600000003376/usr/local/lib/mod2/Clock.imp IMPLEMENTATION MODULE Clock; FROM CLibrary CIMPORT intPtr, timestringPtr, time, ctime, localtime, tmPtr; FROM Storage IMPORT ALLOCATE, DEALLOCATE; FROM SYSTEM IMPORT TSIZE, ADR, LONG; PROCEDURE Time(VAR timerec : TimeRecType); VAR clock : intPtr; timerecptr : tmPtr; nowtime : LONGINT; BEGIN ALLOCATE(clock, LONG(0, TSIZE(LONGINT))); nowtime := time(clock); clock^ := nowtime; timerecptr := localtime(clock); timerec := timerecptr^; timerec.tm_mon := timerec.tm_mon + 1D; DEALLOCATE(clock); END Time; PROCEDURE ClockTime (VAR currenttime: LONGINT); (* returns current time in system format *) VAR clock : intPtr; BEGIN ALLOCATE(clock, LONG(0, TSIZE(LONGINT))); currenttime := time(clock); DEALLOCATE(clock); (*, TSIZE(LONGINT))*) END ClockTime; PROCEDURE Date (VAR date: ARRAY OF CHAR); (* returns current time as string, min length 26 chars *) VAR clock : intPtr; currenttime : LONGINT; datePtr : timestringPtr; i : CARDINAL; BEGIN ALLOCATE(clock, LONG(0, TSIZE(LONGINT))); currenttime := time(clock); datePtr := ctime(ADR(currenttime)); FOR i := 0 TO 25 DO IF i <= VAL(CARDINAL,HIGH(date)) THEN date[i] := datePtr^[i]; END END; DEALLOCATE(clock); (*, TSIZE(LONGINT)) *) END Date; PROCEDURE ConvertTime (currenttime: LONGINT; VAR date: ARRAY OF CHAR); (* converts time given as argument into string, min length 26 chars *) VAR datePtr: timestringPtr; i : CARDINAL; BEGIN datePtr := ctime(ADR(currenttime)); FOR i := 0 TO 25 DO IF i <= VAL(CARDINAL,HIGH(date)) THEN date[i] := datePtr^[i]; END END; END ConvertTime; BEGIN END Clock. 0707070000020074131006440001460001440000010660220427416054300004300000025615/usr/local/lib/mod2/Conversion.imp IMPLEMENTATION MODULE Conversions; FROM InOut IMPORT WriteString, WriteCard, WriteLn, WriteInt; FROM Strings IMPORT StringLen, CopyString; FROM CLibrary CIMPORT sscanf, sprintf, fltodb__; FROM ErrorHandling IMPORT ErrorMessage; FROM SYSTEM IMPORT BYTE, WORD, ADDRESS, ADR, REG, SETREG, LONG, SHORT; TYPE TemplateType = RECORD CASE : CARDINAL OF 0 : b1, b2, b3, b4 : BYTE | 1 : s1, s2 : (*SHORTWORD*) WORD | 2 : w1 : (*INTEGER*) LONGINT | 3 : set : BITSET END END; NumType = RECORD CASE : CARDINAL OF 0 : lc : LONGINT | 1 : r : REAL | 2 : w1, w2 : WORD END END; VAR Result : BOOLEAN; digs : ARRAY [0..16] OF CHAR; PROCEDURE Done(): BOOLEAN; (* return TRUE if last String/Number conversion was successful *) BEGIN RETURN Result; END Done; PROCEDURE ConvertNumber(num : LONGCARD; len, mindigits, base: CARDINAL; neg: BOOLEAN; VAR str: ARRAY OF CHAR); (* conversion of a number into a string of characters *) (* num must get the absolute value of the number *) (* len is the minimal length of the generated string *) (* mindigits is the minimal number of generated digits*) (* neg means: "the number is negative" for btyp = dec *) VAR digits : ARRAY [1..32] OF CHAR; cnt, ix, maxlen : CARDINAL; dig : LONGCARD; c : CHAR; digCard : CARDINAL; BEGIN cnt := 0; REPEAT INC(cnt); dig := num MOD VAL(LONGCARD,LONG(0, base)); num := num DIV VAL(LONGCARD,LONG(0, base)); digCard := SHORT(dig); digits[cnt] := digs[digCard]; UNTIL num = 0D; IF neg THEN INC(cnt); digits[cnt] := '-'; END; maxlen := HIGH(str) + 1; (* get maximal length *) IF len > maxlen THEN len := maxlen END; IF cnt > maxlen THEN cnt := maxlen END; ix := 0; WHILE len > cnt DO IF len > mindigits THEN str[ix] := " " ELSE str[ix] := "0" END; INC(ix); DEC(len) END; WHILE cnt > 0 DO str[ix] := digits[cnt]; INC(ix); DEC(cnt); END; IF ix < maxlen THEN str[ix] := 0C END; Result := TRUE; END ConvertNumber; (* number to string conversions *) PROCEDURE NumToString (num: WORD; len, base: CARDINAL; VAR s: ARRAY OF CHAR); BEGIN ConvertNumber(LONG(0, VAL(CARDINAL,num)),len,len,base,FALSE,s) END NumToString; PROCEDURE OctToString (num: WORD; len: CARDINAL; VAR s: ARRAY OF CHAR); BEGIN ConvertNumber(LONG(0, VAL(CARDINAL,num)),len,11,10B,FALSE,s) END OctToString; PROCEDURE LongOctToString (num: LONGCARD; len: CARDINAL; VAR s: ARRAY OF CHAR); BEGIN ConvertNumber(num,len,11,10B,FALSE,s) END LongOctToString; PROCEDURE HexToString (num: WORD; len: CARDINAL; VAR s: ARRAY OF CHAR); BEGIN ConvertNumber(LONG(0, VAL(CARDINAL,num)),len,8,10H,FALSE,s) END HexToString; PROCEDURE LongHexToString (num: LONGCARD; len: CARDINAL; VAR s: ARRAY OF CHAR); BEGIN ConvertNumber(num,len,8,10H,FALSE,s) END LongHexToString; PROCEDURE IntToString (num: INTEGER; len: CARDINAL; VAR s: ARRAY OF CHAR); BEGIN ConvertNumber(LONG(0, ABS(num)),len,0,10,num < 0,s) END IntToString; PROCEDURE LongIntToString (num: LONGINT; len: CARDINAL; VAR s: ARRAY OF CHAR); BEGIN ConvertNumber(ABS(num),len,0,10,num < 0D,s) END LongIntToString; PROCEDURE CardToString (num: CARDINAL; len: CARDINAL; VAR s: ARRAY OF CHAR); BEGIN ConvertNumber(LONG(0, num),len,0,10,FALSE,s) END CardToString; (* string to number conversions *) PROCEDURE LongCardToString (num: LONGCARD; len: CARDINAL; VAR s: ARRAY OF CHAR); BEGIN ConvertNumber(num,len,0,10,num < 0D,s) END LongCardToString; PROCEDURE RealToString (num: REAL; decimal: CARDINAL; len: CARDINAL; form : CHAR; VAR s: ARRAY OF CHAR); TYPE FormatType = ARRAY [0..4] OF CHAR; VAR format : FormatType; ResultC, i, hulp : INTEGER; chnum, regnum1, regnum2 : NumType; BEGIN format[0] := '%'; format[1] := '.'; format[2] := digs[decimal]; format[3] := form; format[4] := 0C; Result := FALSE; chnum.r := num; SETREG(0, chnum.lc); fltodb__; regnum1.lc := REG(0); regnum2.lc := REG(1); ResultC := sprintf(s, format, regnum1.lc, regnum2.lc); IF ResultC = -1 THEN s[0] := 0C ELSIF VAL(INTEGER,len) > ResultC THEN s[len] := 0C; hulp := VAL(INTEGER,len) - ResultC; FOR i := len - 1 TO hulp BY -1 DO (* Swift the number to the right*) s[i] := s[ResultC - 1]; DEC(ResultC) END; FOR i := hulp - 1 TO 0 BY -1 DO (* Fill the rest with blanks *) s[i] := ' ' END; Result := TRUE END END RealToString; PROCEDURE StringToOct (s: ARRAY OF CHAR): CARDINAL; VAR i, c : CARDINAL; BEGIN Result := FALSE; i := 0; c := 0; WHILE (s[i] >= '0') AND (s[i] <= '7') DO c := c * 8 + VAL(CARDINAL, ORD(s[i])) - 48; INC(i) END; IF i > 0 THEN Result := TRUE END; RETURN c END StringToOct; PROCEDURE StringToLongOct (s: ARRAY OF CHAR): LONGCARD; VAR i : CARDINAL; c : LONGCARD; BEGIN Result := FALSE; i := 0; c := 0D; WHILE (s[i] >= '0') AND (s[i] <= '7') DO c := c * VAL(LONGCARD,8D) + VAL(LONGCARD,LONG(0, ORD(s[i]) - 48)); INC(i) END; IF i > 0 THEN Result := TRUE END; RETURN c END StringToLongOct; PROCEDURE StringToHex (s: ARRAY OF CHAR): CARDINAL; VAR i, c : CARDINAL; Ch : CHAR; BEGIN Result := FALSE; i := 0; c := 0; Ch := CAP(s[i]); WHILE ((Ch >= '0') AND (Ch <= '9')) OR ((Ch >= 'A') AND (Ch <= 'F')) DO IF (Ch >= '0') AND (Ch <= '9') THEN c := c * 16 + (VAL(CARDINAL, ORD(Ch)) - 48) ELSE c := c * 16 + (VAL(CARDINAL, ORD(Ch)) - 55) END; INC(i); Ch := CAP(s[i]) END; IF i > 0 THEN Result := TRUE END; RETURN c END StringToHex; PROCEDURE StringToLongHex (s: ARRAY OF CHAR): LONGCARD; VAR i : CARDINAL; c : LONGCARD; Ch : CHAR; BEGIN Result := FALSE; i := 0; c := 0D; Ch := CAP(s[i]); WHILE ((Ch >= '0') AND (Ch <= '9')) OR ((Ch >= 'A') AND (Ch <= 'F')) DO IF (Ch >= '0') AND (Ch <= '9') THEN c := c * VAL(LONGCARD,16D) + VAL(LONGCARD,LONG(0, ORD(Ch) - 48)) ELSE (*c := c * 16D + LONG(0, CARDINAL(ORD(Ch)) - 55)*) c := c * VAL(LONGCARD,16D) + VAL(LONGCARD,LONG(0, ORD(Ch) - 55)) END; INC(i); Ch := CAP(s[i]) END; IF i > 0 THEN Result := TRUE END; RETURN c END StringToLongHex; PROCEDURE StringToInt (s: ARRAY OF CHAR): INTEGER; VAR c : INTEGER; signneg, sign : BOOLEAN; i : CARDINAL; BEGIN Result := FALSE; signneg := s[0] = '-'; sign := (s[0] = '+') OR (s[0] = '-'); (* if + or -, then sign = 1 *) c := 0; (* else sign = 0 *) FOR i := ORD(sign) TO VAL(CARDINAL, StringLen(s)) - 1 DO c := c * 10 + VAL(INTEGER,ORD(s[i])) - 48; Result := TRUE; END; IF signneg THEN c := -1 * c END; RETURN c END StringToInt; (**) PROCEDURE StringToLongInt (s: ARRAY OF CHAR): LONGINT; VAR c : LONGINT; signneg, sign : BOOLEAN; i : CARDINAL; BEGIN Result := FALSE; signneg := s[0] = '-'; sign := (s[0] = '+') OR (s[0] = '-'); (* if + or -, then sign = 1 *) c := 0D; (* else sign = 0 *) FOR i := ORD(sign) TO VAL(CARDINAL, StringLen(s)) - 1 DO c := c * 10D + LONG(0, ORD(s[i]) - 48); Result := TRUE; END; IF signneg THEN c := -1D * c END; RETURN c END StringToLongInt; PROCEDURE StringToCard (s: ARRAY OF CHAR): CARDINAL; VAR i, c : CARDINAL; BEGIN Result := FALSE; c := 0; FOR i := 0 TO VAL(CARDINAL, StringLen(s)) - 1 DO c := c * 10 + (VAL(CARDINAL, ORD(s[i])) - 48); Result := TRUE; END; RETURN c END StringToCard; (* number to number conversions *) (**) PROCEDURE StringToLongCard (s: ARRAY OF CHAR): LONGCARD; VAR i : CARDINAL; c : LONGCARD; BEGIN Result := FALSE; c := 0D; FOR i := 0 TO VAL(CARDINAL, StringLen(s)) - 1 DO c := c * VAL(LONGCARD,10D) + VAL(LONGCARD,LONG(0, ORD(s[i]) - 48)); Result := TRUE; END; RETURN c END StringToLongCard; (* number to number conversions *) PROCEDURE StringToReal (s: ARRAY OF CHAR): REAL; TYPE FormatType = ARRAY [0..2] OF CHAR; VAR format : FormatType; r : REAL; ResultC : INTEGER; BEGIN Result := FALSE; format[0] := '%'; format[1] := 'f'; format[2] := 0C; ResultC := sscanf(s, format, ADR(r)); IF ResultC # 1 THEN ErrorMessage('CRASH IN MODULE Conversions PROCEDURE StringToReal') ELSE Result := TRUE END; RETURN r END StringToReal; PROCEDURE ByteToLongInt (num: BYTE): LONGINT; VAR Template : TemplateType; BEGIN WITH Template DO b4 := num; IF 7 IN set THEN b1 := BYTE(255); b2 := BYTE(255); b3 := BYTE(255) ELSE b1 := BYTE(0); b2 := BYTE(0); b3 := BYTE(0); END; Result := TRUE; RETURN w1 END END ByteToLongInt; PROCEDURE WordToLongInt (num: WORD): LONGINT; VAR Template : TemplateType; BEGIN WITH Template DO s2 := num; IF 15 IN set THEN b1 := BYTE(255); b2 := BYTE(255) ELSE b1 := BYTE(0); b2 := BYTE(0); END; Result := TRUE; RETURN w1 END END WordToLongInt; BEGIN CopyString("0123456789ABCDEF", digs); END Conversions. 0707070000020045051006440001460001440000010524410424461640200004000000006622/usr/local/lib/mod2/Coroutine.s file "Coroutine.s" data even 2 global _Coroutine_currentprocess _Coroutine_currentprocess: long _Coroutine_main # always points to control blk of # currently running coroutine _Coroutine_main: # Control blk for main coroutine long 1 # status = running initially long 0 # entry point (not used) long 0x7fffffff # size (unlimited) long 0 # space to save stack pointer text global Coroutine Coroutine: rts # Main body of Coroutine module (doesn't # do anything, but is necessary for # Modula-2 run-time startup. # # PROCEDURE NEWPROCESS (p: PROC; stackaddr: ADDRESS; # stacksize: CARDINAL; VAR cor: ADDRESS); # # Create a new coroutine representing parameterless procedure "p". # "stackaddr" is the starting address of an area used for the coroutine # control block used internally by these routines, as well as for this # coroutine's stack use (local data + calls to other procedures). # "stacksize" is the size in BYTES of the block pointed to by "stackaddr". # This should be at least 512 bytes. # A pointer to the coroutine control block is returned in "cor", which is # used for subsequent calls to TRANSFER. # global Coroutine_NEWPROCESS Coroutine_NEWPROCESS : link %fp, &0 # Set up the frame pointer movm.l &0x80c0, -(%sp) # Saves registers d0,a0,& a1 mov.l 16(%fp), %a0 # Get start addr of stack area clr.l (%a0) # Indicate process not yet started mov.l 20(%fp), 4(%a0) # Get entry point of process mov.l 12(%fp), 8(%a0) # Get size of stack mov.l 8(%fp), %a1 # Get the address of the process var mov.l %a0, (%a1) # Save coroutine control block movm.l (%sp)+, &0x0301 # Restore registers unlk %fp # Reset frame pointer mov.l (%sp)+, %a3 # Get return address add.l &16, %sp # Pop 4 parameters off stack jmp (%a3) # Return to calling routine # # PROCEDURE TRANSFER (VAR source, VAR destination: ADDRESS); # # transfer control from coroutine "source" to coroutine "destination" # global Coroutine_TRANSFER Coroutine_TRANSFER : link %fp, &0 # Set up the frame pointer movm.l &0xfffe, -(%sp) # Saves registers except sp mov.l _Coroutine_currentprocess, %a2 # Get current process mov.l 8(%fp), %a0 # Get the address of the destination cor mov.l (%a0), %a1 # Get the process to switch to(destn) mov.l %sp, 12(%a2) # Save stack ptr for the old coroutine mov.l 12(%fp), %a0 # Get the address of the source cor mov.l %a2, (%a0) # Return pointer to the old coroutine mov.l %a1, _Coroutine_currentprocess # New current coroutine tst.l (%a1) # Has new process been run before? beq.b firstime # No, start it # Resume execution of the called coroutine mov.l 12(%a1), %sp # Restore stack pointer movm.l (%sp)+, &0x7fff # Restore registers unlk %fp # Reset frame pointer mov.l (%sp)+, %a3 # Get return address addq.l &8, %sp # Pop 2 parameters off stack jmp (%a3) # Return to calling routine firstime: # Start coroutine for the first time at start of procedure mov.l &0x1, (%a1) # Set status on, indicate running mov.l 4(%a1), %a4 # Get start addr of coroutine add.l 8(%a1), %a1 # Add frame size to control block addr mov.l %a1, %fp # Set frame pointer to top of frame mov.l %fp, %sp # ... also stack pointer jsr (%a4) # and call the procedure # Will return here if procedure terminates, terminate whole program also mov.l &0xff, %d0 #exit code 255 jsr _exit 0707070000020074171006440001460001440000010430360427416054300004300000000656/usr/local/lib/mod2/ErrorHandl.imp IMPLEMENTATION MODULE ErrorHandling; FROM FileSystem IMPORT WriteString, WriteChar, Stderr, EOL; PROCEDURE HaltMessage (Str : ARRAY OF CHAR); BEGIN WriteString(Stderr, Str); WriteChar(Stderr, EOL); HALT END HaltMessage; PROCEDURE ErrorMessage (Str : ARRAY OF CHAR); BEGIN WriteString(Stderr, Str); WriteChar(Stderr, EOL) END ErrorMessage; BEGIN END ErrorHandling. 0707070000020050721006440001460001440000010430370427416054300004300000012711/usr/local/lib/mod2/FileInform.imp IMPLEMENTATION MODULE FileInformation; FROM CLibrary CIMPORT statPtr, stattype, stat, fstat, NULL, DevType, InoType, OffType; FROM FileSystem IMPORT ShowStatus; FROM Storage IMPORT ALLOCATE, DEALLOCATE; FROM SYSTEM IMPORT TSIZE, WORD, LONG; CONST NULLd = 0D; PROCEDURE GetMode (path : ARRAY OF CHAR) : WORD; VAR buf : statPtr; BEGIN ALLOCATE(buf, LONG(0, TSIZE(stattype))); IF stat(path, buf) = NULLd THEN RETURN buf^.st_mode ELSE ShowStatus END; DEALLOCATE(buf) END GetMode; PROCEDURE GetIno (path : ARRAY OF CHAR) : InoType; VAR buf : statPtr; BEGIN ALLOCATE(buf, LONG(0, TSIZE(stattype))); IF stat(path, buf) = NULLd THEN RETURN buf^.st_ino ELSE ShowStatus END; DEALLOCATE(buf) END GetIno; PROCEDURE GetDev (path : ARRAY OF CHAR) : DevType; VAR buf : statPtr; BEGIN ALLOCATE(buf, LONG(0, TSIZE(stattype))); IF stat(path, buf) = NULLd THEN RETURN buf^.st_dev ELSE ShowStatus END; DEALLOCATE(buf) END GetDev; PROCEDURE GetRdev (path : ARRAY OF CHAR) : DevType; VAR buf : statPtr; BEGIN ALLOCATE(buf, LONG(0, TSIZE(stattype))); IF stat(path, buf) = NULLd THEN RETURN buf^.st_rdev ELSE ShowStatus END; DEALLOCATE(buf) END GetRdev; PROCEDURE GetNlink (path : ARRAY OF CHAR) : WORD; VAR buf : statPtr; BEGIN ALLOCATE(buf, LONG(0, TSIZE(stattype))); IF stat(path, buf) = NULLd THEN RETURN buf^.st_nlink ELSE ShowStatus END; DEALLOCATE(buf) END GetNlink; PROCEDURE GetUid (path : ARRAY OF CHAR) : WORD; VAR buf : statPtr; BEGIN ALLOCATE(buf, LONG(0, TSIZE(stattype))); IF stat(path, buf) = NULLd THEN RETURN buf^.st_uid ELSE ShowStatus END; DEALLOCATE(buf) END GetUid; PROCEDURE GetGid (path : ARRAY OF CHAR) : WORD; VAR buf : statPtr; BEGIN ALLOCATE(buf, LONG(0, TSIZE(stattype))); IF stat(path, buf) = NULLd THEN RETURN buf^.st_gid ELSE ShowStatus END; DEALLOCATE(buf) END GetGid; PROCEDURE GetSize (path : ARRAY OF CHAR) : OffType; VAR buf : statPtr; BEGIN ALLOCATE(buf, LONG(0, TSIZE(stattype))); IF stat(path, buf) = NULLd THEN RETURN buf^.st_size ELSE ShowStatus END; DEALLOCATE(buf) END GetSize; PROCEDURE GetAtime (path : ARRAY OF CHAR) : LONGINT; VAR buf : statPtr; BEGIN ALLOCATE(buf, LONG(0, TSIZE(stattype))); IF stat(path, buf) = NULLd THEN RETURN buf^.st_atime ELSE ShowStatus END; DEALLOCATE(buf) END GetAtime; PROCEDURE GetMtime (path : ARRAY OF CHAR) : LONGINT; VAR buf : statPtr; BEGIN ALLOCATE(buf, LONG(0, TSIZE(stattype))); IF stat(path, buf) = NULLd THEN RETURN buf^.st_mtime ELSE ShowStatus END; DEALLOCATE(buf) END GetMtime; PROCEDURE GetCtime (path : ARRAY OF CHAR) : LONGINT; VAR buf : statPtr; BEGIN ALLOCATE(buf, LONG(0, TSIZE(stattype))); IF stat(path, buf) = NULLd THEN RETURN buf^.st_ctime ELSE ShowStatus END; DEALLOCATE(buf) END GetCtime; PROCEDURE fGetMode (filedescr: LONGINT) : WORD; VAR buf : statPtr; BEGIN ALLOCATE(buf, LONG(0, TSIZE(stattype))); IF fstat(filedescr, buf) = NULLd THEN RETURN buf^.st_mode ELSE ShowStatus END; DEALLOCATE(buf) END fGetMode; PROCEDURE fGetIno (filedescr: LONGINT) : InoType; VAR buf : statPtr; BEGIN ALLOCATE(buf, LONG(0, TSIZE(stattype))); IF fstat(filedescr, buf) = NULLd THEN RETURN buf^.st_ino ELSE ShowStatus END; DEALLOCATE(buf) END fGetIno; PROCEDURE fGetDev (filedescr: LONGINT) : DevType; VAR buf : statPtr; BEGIN ALLOCATE(buf, LONG(0, TSIZE(stattype))); IF fstat(filedescr, buf) = NULLd THEN RETURN buf^.st_dev ELSE ShowStatus END; DEALLOCATE(buf) END fGetDev; PROCEDURE fGetRdev (filedescr: LONGINT) : DevType; VAR buf : statPtr; BEGIN ALLOCATE(buf, LONG(0, TSIZE(stattype))); IF fstat(filedescr, buf) = NULLd THEN RETURN buf^.st_rdev ELSE ShowStatus END; DEALLOCATE(buf) END fGetRdev; PROCEDURE fGetNlink (filedescr: LONGINT) : WORD; VAR buf : statPtr; BEGIN ALLOCATE(buf, LONG(0, TSIZE(stattype))); IF fstat(filedescr, buf) = NULLd THEN RETURN buf^.st_nlink ELSE ShowStatus END; DEALLOCATE(buf) END fGetNlink; PROCEDURE fGetUid (filedescr: LONGINT) : WORD; VAR buf : statPtr; BEGIN ALLOCATE(buf, LONG(0, TSIZE(stattype))); IF fstat(filedescr, buf) = NULLd THEN RETURN buf^.st_uid ELSE ShowStatus END; DEALLOCATE(buf) END fGetUid; PROCEDURE fGetGid (filedescr: LONGINT) : WORD; VAR buf : statPtr; BEGIN ALLOCATE(buf, LONG(0, TSIZE(stattype))); IF fstat(filedescr, buf) = NULLd THEN RETURN buf^.st_gid ELSE ShowStatus END; DEALLOCATE(buf) END fGetGid; PROCEDURE fGetSize (filedescr: LONGINT) : OffType; VAR buf : statPtr; BEGIN ALLOCATE(buf, LONG(0, TSIZE(stattype))); IF fstat(filedescr, buf) = NULLd THEN RETURN buf^.st_size ELSE ShowStatus END; DEALLOCATE(buf) END fGetSize; PROCEDURE fGetAtime (filedescr: LONGINT) : LONGINT; VAR buf : statPtr; BEGIN ALLOCATE(buf, LONG(0, TSIZE(stattype))); IF fstat(filedescr, buf) = NULLd THEN RETURN buf^.st_atime ELSE ShowStatus END; DEALLOCATE(buf) END fGetAtime; PROCEDURE fGetMtime (filedescr: LONGINT) : LONGINT; VAR buf : statPtr; BEGIN ALLOCATE(buf, LONG(0, TSIZE(stattype))); IF fstat(filedescr, buf) = NULLd THEN RETURN buf^.st_mtime ELSE ShowStatus END; DEALLOCATE(buf) END fGetMtime; PROCEDURE fGetCtime (filedescr: LONGINT) : LONGINT; VAR buf : statPtr; BEGIN ALLOCATE(buf, LONG(0, TSIZE(stattype))); IF fstat(filedescr, buf) = NULLd THEN RETURN buf^.st_ctime ELSE ShowStatus END; DEALLOCATE(buf) END fGetCtime; BEGIN END FileInformation. 0707070000020076341006440001460001440000010451420427416054500004300000054371/usr/local/lib/mod2/FileSystem.imp IMPLEMENTATION MODULE FileSystem; FROM SYSTEM IMPORT WORD, BYTE, ADR, ADDRESS, LONG; FROM Strings IMPORT CopyString, AppendString, StringLen; FROM CLibrary CIMPORT EOF, NULL, NFILE, IOREAD, IOWRT, IONBF, IOMYBUF, IOEOF, IOERR, IOUNK, IORW, EOK, EPERM, ENOENT, ESRCH, EINTR, EIO , ENXIO, E2BIG, ENOEXEC, EBADF, ECHILD, EAGAIN, ENOMEM, EACCES, EFAULT, ENOTBLK, EBUSY, EEXIST, EXDEV, ENODEV, ENOTDIR, EISDIR, EINVAL, ENFILE, EMFILE, ENOTTY, ETXTBSY, EFBIG, ENOSPC, ESPIPE, EROFS, EMLINK, EPIPE, EDOM, ERANGE , ENOMSG, EIDRM, EDEADLK, L_SET, NAME_MAX, FileBlock, FileRange, Stream, charPtr, _iob,errno, creat, close, fopen, fdopen, freopen, fclose, fflush, rewind, setbuf, fgetc, fputc, fputs, fseek, ftell, link, unlink, fread, fwrite, getcwd, mktemp; TYPE (* File = Stream; *) FileConnection = RECORD (* info for a given open file *) file : File; filename : FileName END; FileTabType = ARRAY FileRange OF FileConnection; TemplateType = RECORD CASE : CARDINAL OF 0 : b1, b2, b3, b4 : BYTE | 1 : s1, s2 : WORD END END; VAR FileTab : FileTabType; (* table of open files *) Status : BOOLEAN; (* whether the last I/O operation succeeded *) FileCount : FileRange; PROCEDURE WriteChar (VAR f : File; ch : CHAR); (* * Write character "ch" to file "f". *) BEGIN Status := (*EOF*)-1D <> fputc(LONG(0,VAL(CARDINAL,ch)), f) END WriteChar; PROCEDURE WriteString (VAR f : File; str : ARRAY OF CHAR); (* * Write string "str" to file "f". *) BEGIN Status := (*EOF*)-1D <> fputs(str, f) END WriteString; PROCEDURE SearchFile (VAR f : File) : CARDINAL; (* * Look for file "f" in the table of open files. * Return NFILE if it is not there. *) VAR i : CARDINAL; BEGIN (* start with three - 0-2 represent stdin, stdout, stderr. *) FOR i := 3 TO NFILE - 1 DO IF f = FileTab[i].file THEN RETURN i END END; RETURN NFILE END SearchFile; PROCEDURE Assign (VAR f : File; FileName : ARRAY OF CHAR); (* * Put file "f" in the open file table. *) VAR i, j , len, high : CARDINAL; Goon : BOOLEAN; BEGIN i := 0; Goon := TRUE; (* look for the first open slot *) WHILE (i < NFILE) AND Goon DO IF FileTab[i].file = NIL THEN (* found one *) Goon := FALSE; WITH FileTab[i] DO file := f; (* now copy the filename in *) j := 0; len := StringLen(FileName); high := HIGH(filename); WHILE (j < len) AND (j <= high) DO filename[j] := FileName[j]; INC(j) END; (* make sure it is null-terminated *) IF j <= high THEN filename[j] := 0C END END ELSE INC(i) END END END Assign; PROCEDURE DisAssign (VAR f : File); (* * Take file "f" out of the open file table. *) VAR i : CARDINAL; Goon : BOOLEAN; BEGIN i := 0; Goon := TRUE; WHILE (i < NFILE) AND Goon DO IF FileTab[i].file = f THEN FileTab[i].file := NIL; Goon := FALSE ELSE INC(i) END END END DisAssign; PROCEDURE Done () : BOOLEAN; (* * Return indication of whether the last FileSystem operation succeeded. *) BEGIN RETURN Status END Done; PROCEDURE ShowStatus; (* * Print message indicating what the error was for the last I/O that failed. *) BEGIN CASE VAL(CARDINAL,errno) OF EPERM : WriteString(Stderr, "Not super-user") | ENOENT : WriteString(Stderr, "No such file or directory") | ESRCH : WriteString(Stderr, "No such process") | EINTR : WriteString(Stderr, "Interrupted system call") | EIO : WriteString(Stderr, "I/O error") | ENXIO : WriteString(Stderr, "No such device or address") | E2BIG : WriteString(Stderr, "Arg list too long") | ENOEXEC : WriteString(Stderr, "Exec format error") | EBADF : WriteString(Stderr, "Bad file number") | ECHILD : WriteString(Stderr, "No children") | EAGAIN : WriteString(Stderr, "No more process") | ENOMEM : WriteString(Stderr, "Not enough core") | EACCES : WriteString(Stderr, "Permission denied") | EFAULT : WriteString(Stderr, "Bad address") | ENOTBLK : WriteString(Stderr, "Block device required") | EBUSY : WriteString(Stderr, "Mount device busy") | EEXIST : WriteString(Stderr, "File exists") | EXDEV : WriteString(Stderr, "Cross-device link") | ENODEV : WriteString(Stderr, "No such device") | ENOTDIR : WriteString(Stderr, "Not a directory") | EISDIR : WriteString(Stderr, "Is a directory") | EINVAL : WriteString(Stderr, "Invalid argument") | ENFILE : WriteString(Stderr, "File table overflow") | EMFILE : WriteString(Stderr, "Too many open files") | ENOTTY : WriteString(Stderr, "Not a typewriter") | ETXTBSY : WriteString(Stderr, "Text file busy") | EFBIG : WriteString(Stderr, "File too large") | ENOSPC : WriteString(Stderr, "No space left on device") | ESPIPE : WriteString(Stderr, "Illegal seek") | EROFS : WriteString(Stderr, "Read only file system") | EMLINK : WriteString(Stderr, "Too many links") | EPIPE : WriteString(Stderr, "Broken pipe") | EDOM : WriteString(Stderr, "Math arg out of domain of func") | ERANGE : WriteString(Stderr, "Math result not representable") | ENOMSG : WriteString(Stderr, "No message of desired type") | EIDRM : WriteString(Stderr, "IPC identifier removed") | EDEADLK : WriteString(Stderr, "File region locking deadlock") | EOK : ; ELSE WriteString(Stderr, "Unknown error") END; WriteChar(Stderr, EOL) END ShowStatus; PROCEDURE Close (VAR f : File); (* * Close file "f", and remove it from the open file table. *) VAR retval: LONGINT; BEGIN (* don't close stdin, stdout, or stderr *) IF (f <> Stdin) AND (f <> Stdout) AND (f <> Stderr) THEN retval := fclose(Stream(f)); Status := TRUE; DisAssign(f) ELSE Status := FALSE END END Close; PROCEDURE Delete (filename : ARRAY OF CHAR); (* * Remove "filename" from the file system *) BEGIN Status := unlink(filename) = 0D (* unlink returns 0 if successful *) END Delete; PROCEDURE Rename (old, new : ARRAY OF CHAR); (* * Rename file "old" to "new" *) BEGIN IF link(old, new) = 0D (* NULL *) THEN Delete(old) ELSE Status := FALSE END END Rename; PROCEDURE ReadMode (VAR f : File) : BOOLEAN; (* * Is file "f" opened with read permission? *) VAR f1 : Stream; BEGIN f1 := Stream(f); RETURN IOREAD IN BITSET(f1^.flag); END ReadMode; PROCEDURE WriteMode (VAR f : File) : BOOLEAN; (* * Is file "f" opened with write permission? *) VAR f1 : Stream; BEGIN f1 := Stream(f); RETURN IOWRT IN BITSET(f1^.flag); END WriteMode; PROCEDURE ReadWriteMode (VAR f : File) : BOOLEAN; (* * Is file "f" opened with both read and write permission? *) VAR f1 : Stream; BEGIN f1 := Stream(f); RETURN IORW IN BITSET(f1^.flag); END ReadWriteMode; PROCEDURE FileNotBuffered (VAR f : File) : BOOLEAN; VAR f1 : Stream; BEGIN f1 := Stream(f); RETURN IONBF IN BITSET(f1^.flag); END FileNotBuffered; PROCEDURE FileBigBuffer (VAR f : File) : BOOLEAN; VAR f1 : Stream; BEGIN f1 := Stream(f); RETURN IOMYBUF IN BITSET(f1^.flag); END FileBigBuffer; PROCEDURE BufferingStatusUnknown (VAR f : File) : BOOLEAN; VAR f1 : Stream; BEGIN f1 := Stream(f); RETURN IOUNK IN BITSET(f1^.flag); END BufferingStatusUnknown; PROCEDURE Eof (VAR f : File) : BOOLEAN; (* * Check EOF flag for "f" *) VAR f1 : Stream; BEGIN f1 := Stream(f); RETURN IOEOF IN BITSET(f1^.flag); END Eof; PROCEDURE ErrorOnFile (VAR f : File) : BOOLEAN; (* * Was there an I/O error on "f"? *) VAR f1 : Stream; BEGIN f1 := Stream(f); RETURN IOERR IN BITSET(f1^.flag); END ErrorOnFile; PROCEDURE GetPos (VAR f : File; VAR position: LONGINT); (* * Get the byte offset in the file corresponding to the current * position of the file pointer. This is the location in the file where * the next I/O operation will take place. *) BEGIN position := ftell(Stream(f)); END GetPos; PROCEDURE Reset (VAR f : File); (* * Move the file pointer back to the start of the file *) BEGIN Status := rewind(Stream(f)) = 0D (* rewind returns 0 if succeeded *) END Reset; PROCEDURE SetPos (VAR f : File; position : LONGINT); (* * Move the file pointer to byte offset "position" *) BEGIN Status := fseek(Stream(f), position, L_SET) = 0D (* fseek returns *) (* 0 if succeeded *) END SetPos; PROCEDURE ReadByte (VAR f : File; VAR b : BYTE); VAR Result : INTEGER; BEGIN IF NOT Eof(f) THEN Result := fgetc(Stream(f)); b := BYTE(Result); Status := Result <> EOF END END ReadByte; PROCEDURE ReadWord (VAR f : File; VAR s : WORD); VAR template : TemplateType; BEGIN WITH template DO ReadByte(f, b1); IF NOT Eof(f) THEN ReadByte(f, b2); s := s1 ELSE s := WORD(0) END END END ReadWord; PROCEDURE ReadLongWord (VAR f : File; VAR lw : ARRAY OF BYTE); VAR stat : ARRAY [1..4] OF BOOLEAN; i : INTEGER; BEGIN FOR i := 1 TO 4 DO ReadByte(f, lw[i]); stat[i] := Status; END; Status := stat[1] AND stat[2] AND stat[3] AND stat[4]; END ReadLongWord; PROCEDURE WriteByte (VAR f : File; b : BYTE); BEGIN Status := (*EOF*) -1D <> fputc(LONG(0,VAL(CARDINAL,b)), f) (* @@ *) END WriteByte; PROCEDURE WriteWord (VAR f : File; s : WORD); VAR template : TemplateType; BEGIN WITH template DO s1 := s; Status := ((*EOF*)-1D <> fputc(LONG(0,VAL(CARDINAL,b1)), f)) AND ((*EOF*)-1D <> fputc(LONG(0,VAL(CARDINAL,b2)), f)); END END WriteWord; PROCEDURE WriteLongWord (VAR f : File; w : ARRAY OF BYTE); VAR stat : ARRAY [1..4] OF BOOLEAN; i : INTEGER; BEGIN FOR i := 1 TO 4 DO WriteByte(f, w[i]); stat[i] := Status; END; Status := stat[1] AND stat[2] AND stat[3] AND stat[4]; END WriteLongWord; PROCEDURE Flush (VAR f : File); (* * Flush file "f"s I/O buffers out to disk. *) BEGIN Status := fflush(Stream(f)) = 0D (* NULL *) END Flush; PROCEDURE ReadChar (VAR f : File; VAR ch : CHAR); VAR Result : INTEGER; BEGIN IF NOT Eof(f) THEN Result := fgetc(Stream(f)); ch := CHAR(Result); Status := Result <> EOF END END ReadChar; PROCEDURE ReadRecord (VAR f : File; VAR bufPtr : ARRAY OF BYTE; requestedBytes : CARDINAL; VAR read : CARDINAL); BEGIN read := fread(bufPtr, 1, requestedBytes, f); Status := TRUE; IF read <> requestedBytes THEN Status := NOT Eof(f) END; END ReadRecord; PROCEDURE WriteRecord (VAR f : File; VAR bufPtr : ARRAY OF BYTE; requestedBytes : CARDINAL; VAR written : CARDINAL); BEGIN written := fwrite(bufPtr, 1, requestedBytes, f); Status := written <> 0 END WriteRecord; PROCEDURE GetName (VAR f : File; VAR filesname : ARRAY OF CHAR); (* * Get the name of the file opened on "f" *) VAR i, fd : CARDINAL; BEGIN fd := SearchFile(f); WITH FileTab[fd] DO FOR i := 0 TO HIGH(filesname) DO filesname[i] := filename[i] END END END GetName; PROCEDURE FileNameLengthCheck (fn : ARRAY OF CHAR; VAR fnresult : ARRAY OF CHAR); (* * Check the length of filename "fn", making sure all components * of the path are <= NAME_MAX (14 chars), which is a UNIX limitation. *) VAR lenstr, startpos, lengte, fnresultpos : CARDINAL; stop, ext : BOOLEAN; PROCEDURE Length (pos : CARDINAL; VAR ext : BOOLEAN) : CARDINAL; (* * Return the length of the current file name component in the path. * "ext" returns whether or not it has an extension. *) VAR len : CARDINAL; BEGIN len := 0; ext := FALSE; WHILE (fn[pos] <> '/') AND (fn[pos] <> 0C ) DO INC(pos); INC(len); IF fn[pos] = '.' THEN ext := TRUE END END; RETURN len END Length; PROCEDURE CopyFileName (start, end, len : CARDINAL; ext : BOOLEAN); (* * Copy the path component, truncating at NAME_MAX, if necessary *) VAR i, j : CARDINAL; BEGIN IF len <= NAME_MAX (* 14 *) THEN FOR i := start TO end DO IF fnresultpos <= HIGH(fnresult) THEN fnresult[fnresultpos] := fn[i]; INC(fnresultpos) END END ELSIF ext THEN FOR i := start TO start + NAME_MAX - 4 DO IF fnresultpos <= HIGH(fnresult) THEN fnresult[fnresultpos] := fn[i]; INC(fnresultpos) END END; i := start + NAME_MAX - 3; WHILE fn[i] <> '.' DO INC(i) END; FOR j := i TO i + 3 DO IF fnresultpos <= HIGH(fnresult) THEN fnresult[fnresultpos] := fn[j]; INC(fnresultpos) END END ELSE FOR i := start TO start + NAME_MAX DO IF fnresultpos <= HIGH(fnresult) THEN fnresult[fnresultpos] := fn[i]; INC(fnresultpos) END END END END CopyFileName; BEGIN (* FileNameLengthCheck *) fnresultpos := 0; startpos := 1; lengte := Length(startpos, ext) ; stop := FALSE; lenstr := StringLen(fn); WHILE NOT stop DO CopyFileName(startpos - 1, startpos + lengte - 1, lengte, ext); IF startpos + lengte <> lenstr THEN startpos := startpos + lengte + 1; lengte := Length(startpos, ext) ELSE stop := TRUE END END; IF fnresultpos <= HIGH(fnresult) THEN fnresult[fnresultpos] := 0C END END FileNameLengthCheck; PROCEDURE Parse (filename : ARRAY OF CHAR; VAR resultname : ARRAY OF CHAR); (* * "Parse" a file name to make an absolute path out of it. Need to * store absolute path in open file table to avoid name conflicts. *) CONST Max = 127; TYPE pwdtype = ARRAY [0..Max] OF CHAR; PathType = (Absolute, DotSlash, DotDotSlash, FileInDirectory); VAR pwd, fn : pwdtype; Ptr : ADDRESS; len : CARDINAL; PROCEDURE StartCase() : PathType; (* * Determine what type of path it is (relative, absolute, in current * directory, ...). *) BEGIN CASE CAP(filename[0]) OF '/' : RETURN Absolute | 'A'..'Z' : RETURN FileInDirectory | '.' : CASE filename[1] OF '.' : RETURN DotDotSlash | '/' : RETURN DotSlash END END END StartCase; PROCEDURE MakeAbsolutePath (fn : ARRAY OF CHAR; VAR Resultname : ARRAY OF CHAR); (* * Make an absolute path out of "fn". *) VAR indexrname, startpos, High, lastpos, i : CARDINAL; EndString , Deleted : BOOLEAN; Case : PathType; PROCEDURE FindNextRelatif (VAR fn : ARRAY OF CHAR; VAR lastpos : CARDINAL): PathType; VAR len : CARDINAL; BEGIN len := StringLen(fn); WHILE lastpos < len DO IF fn[lastpos] = '.' THEN INC(lastpos); IF fn[lastpos] = '/' THEN RETURN DotSlash ELSIF fn [lastpos] = '.' THEN INC(lastpos); IF fn[lastpos] = '/' THEN RETURN DotDotSlash END END END; INC(lastpos) END; RETURN Absolute END FindNextRelatif; BEGIN indexrname := 0; startpos := 0; High := HIGH(Resultname); lastpos := 0; EndString := FALSE; WHILE NOT EndString DO Case := FindNextRelatif(fn, lastpos); CASE Case OF Absolute : FOR i := startpos TO lastpos DO (* one more for zero char *) IF indexrname <= High THEN Resultname[indexrname] := fn[i]; INC(indexrname) END END; EndString := TRUE | DotSlash : FOR i := startpos TO lastpos - 2 DO IF indexrname <= High THEN Resultname[indexrname] := fn[i]; INC(indexrname) END END; startpos := lastpos + 1 | DotDotSlash : FOR i := startpos TO lastpos - 3 DO IF indexrname <= High THEN Resultname[indexrname] := fn [i]; INC(indexrname); END END; DEC(indexrname, 2); Deleted := FALSE; WHILE (indexrname >= 0) AND NOT Deleted DO IF Resultname[indexrname] <> '/' THEN DEC(indexrname) ELSE Deleted := TRUE END END; INC(indexrname); startpos := lastpos + 1 END END END MakeAbsolutePath; BEGIN (* Parse *) CASE StartCase() OF Absolute : CopyString(filename, fn) | FileInDirectory, DotSlash, DotDotSlash : Ptr := getcwd(pwd, Max); len := StringLen(pwd); IF len < HIGH(pwd) THEN pwd[len] := '/' END; AppendString(pwd, filename, fn); END; MakeAbsolutePath(fn, resultname); (* now make sure all the components are <= NAME_MAX (14) in length *) FileNameLengthCheck(resultname, resultname); END Parse; PROCEDURE Open (VAR f : File; filename : ARRAY OF CHAR; mode : ModeType); (* * Open file "filname" with mode "mode", returning "f" if successful. *) VAR Str : ARRAY [0..2] OF CHAR; fn : FileName; BEGIN (* check the mode *) CASE mode OF O_RDONLY : CopyString("r", Str) | O_WRONLY : CopyString("w", Str) | O_APPEND : CopyString("a", Str) | O_RDWR : CopyString("r+",Str) | O_WRUPDATE : CopyString("w+", Str) | O_APPENDUPDATE : CopyString("a+", Str) END; (* open it *) f := File(fopen(filename, Str)); (* see if fopen was successful *) Status := VAL(CARDINAL,f) <> NULL; IF Status THEN (* get an absolute path out of the filename *) Parse(filename, fn); (* enter the file in the open file table *) Assign(f, fn) END END Open; PROCEDURE Create (VAR f : File; filename : ARRAY OF CHAR); (* * Create file "filename", returning "f" for use in subsequent I/O for that * file. The file is opened for read/write access. *) VAR Str : ARRAY [0..2] OF CHAR; retval: LONGINT; BEGIN Str[0] := 'w'; Str[1] := 0C; f := File(fopen(filename, Str)); IF VAL(CARDINAL,f) <> NULL THEN retval := fclose(Stream(f)); Open(f, filename, O_RDWR); ELSE Status := FALSE END END Create; PROCEDURE CreateTempfile (VAR f : File; filename : ARRAY OF CHAR); (* * Create and open a file that has a unique name *) VAR charptr : ADDRESS (*charPtr*); fn : ARRAY [0..50] OF CHAR; BEGIN CopyString(filename, fn); charptr := mktemp(fn); IF VAL(CARDINAL,charptr) <> NULL THEN Create(f, fn) ELSE Status := FALSE END END CreateTempfile; PROCEDURE Release (VAR f : File); (* * Remove open file "f" if it was opened for write access. * Otherwise, just close it. *) VAR fd : CARDINAL; BEGIN IF WriteMode(f) OR ReadWriteMode(f) THEN fd := SearchFile(f); Close(f); IF fd <> NFILE THEN Delete(FileTab[fd].filename) ELSE WriteString(Stderr, "FileSystem.Release: File not found in FileTab"); WriteChar(Stderr, EOL) END ELSE Close(f) END END Release; BEGIN (* main body of FileSystem *) Status := FALSE; (* set up stdin, stdout, and stderr, which are first 3 entries in _iob *) (* each entry in the C library file table, _iob, is 14 bytes in size *) Stdin := ADR(_iob); Stdout := ADDRESS(LONG(Stdin) + 14D); Stderr := ADDRESS(LONG(Stdin) + 28D); Base_iob := ADR(_iob); FileTab[0].file := Stdin; FileTab[1].file := Stdout; FileTab[2].file := Stderr; (* Initialize the rest of the open file table *) FOR FileCount := 3 TO NFILE - 1 DO WITH FileTab[FileCount] DO file := NIL; filename[0] := 0C; END END END FileSystem. 0707070000020076351006440001460001440000010450460427416054600003600000027375/usr/local/lib/mod2/InOut.imp IMPLEMENTATION MODULE InOut; FROM SYSTEM IMPORT ADDRESS; IMPORT FileSystem, Conversions, Terminal; FROM Strings IMPORT CopyString, StringLen; FROM FileSystem IMPORT File, ModeType, Create, Open, Close, ReadChar, WriteChar, Eof, Stdin, Stdout, ShowStatus, FileName; FROM Conversions IMPORT StringToInt, StringToCard, StringToOct, StringToHex, StringToReal, IntToString, CardToString, OctToString, HexToString, RealToString, StringToLongInt, StringToLongCard, LongCardToString, LongIntToString, StringToLongOct, StringToLongHex, LongOctToString, LongHexToString; VAR buf : ARRAY [0..127] OF CHAR; PROCEDURE TestStatus(filename: ARRAY OF CHAR); BEGIN Done := FileSystem.Done(); IF NOT Done THEN FileSystem.WriteString(FileSystem.Stderr, filename); FileSystem.WriteString(FileSystem.Stderr, ": "); ShowStatus; END; END TestStatus; PROCEDURE OpenInput(filename: ARRAY OF CHAR); (* * Try to open "filename" to serve as input file "in". * Done := "file was succesfully opened". * If open, subsequent input is read from this file. *) VAR fname: FileName; BEGIN CloseInput; (* Make a copy of the filename to make sure it is null-terminated *) CopyString(filename, fname); (* attempt to open the file read-only *) Open(in, filename, O_RDONLY); (* make sure it worked *) TestStatus(filename); END OpenInput; PROCEDURE OpenOutput(filename: ARRAY OF CHAR); (* * Create and open "filename" to serve as the output file "out". * Done := "file was succesfully created. * If open, subsequent output is written on this file. *) VAR fname: FileName; BEGIN CloseOutput; (* Make a copy of the filename to make sure it is null-terminated *) CopyString(filename, fname); (* create it *) Create(out,filename); (* make sure it worked *) TestStatus(filename); END OpenOutput; PROCEDURE CloseInput; (* * Closes input file (if it is not stdin). * Returns input to terminal. *) BEGIN IF VAL(CARDINAL,in) # VAL(CARDINAL,Stdin) THEN Close(in); END; in := Stdin; TestStatus("CloseInput: "); END CloseInput; PROCEDURE CloseOutput; (* * Closes output file (if it is not stdout). * Returns output to terminal. *) BEGIN IF VAL(CARDINAL,out) # VAL(CARDINAL,Stdout) THEN Close(out); END; out := Stdout; TestStatus("CloseOutput: "); END CloseOutput; PROCEDURE Read(VAR ch: CHAR); (* Done := NOT Eof(in) *) BEGIN IF VAL(CARDINAL,in) = VAL(CARDINAL,NIL) THEN (* read from stdin *) Terminal.Read(ch); IF ch = 32C (*^Z*) THEN ch := 0C; Done := FALSE; ELSE Done := TRUE; END; ELSIF Eof(in) THEN ch := 0C; Done := FALSE ELSE ReadChar(in,ch); Done := NOT Eof(in) END; IF Done THEN termCH := ch END; END Read; PROCEDURE ReadLn; (* skip to the beginning of the next input line *) VAR ch : CHAR; BEGIN IF termCH <> CHAR(EOL) THEN REPEAT Read(ch) UNTIL (ch = CHAR(EOL)) OR NOT Done END; termCH := 0C; END ReadLn; PROCEDURE ReadString(VAR s: ARRAY OF CHAR); (* read string, i.e. sequence of characters not containing blanks nor control characters; leading blanks are ignored. Input is terminated by any character <= " "; this character is assigned to termCH *) VAR ch : CHAR; ix : CARDINAL; BEGIN REPEAT Read(ch) UNTIL (ch > " ") OR NOT Done; (* skip blanks and control chars. *) ix := 0; WHILE (ix <= HIGH(s)) AND (ch > " ") AND Done DO s[ix] := ch; INC(ix); Read(ch) END; IF ix <= HIGH(s) THEN s[ix] := 0C END; termCH := ch END ReadString; PROCEDURE ReadInt(VAR i: INTEGER); (* read string and convert to integer. Syntax: integer = ["+"|"-"]digit{digit}. Leading blanks are ignored. Done := "integer was read" *) VAR sign : BOOLEAN; BEGIN ReadString(buf); IF Done THEN sign := buf[0] = "-"; i := StringToInt(buf); Done := Conversions.Done(); IF (i < 0) AND Done AND NOT sign THEN Done := FALSE END; (* overflow *) END END ReadInt; PROCEDURE ReadLongInt(VAR i: LONGINT); (* read string and convert to integer. Syntax: integer = ["+"|"-"]digit{digit}. Leading blanks are ignored. Done := "integer was read" *) VAR sign : BOOLEAN; BEGIN ReadString(buf); IF Done THEN sign := buf[0] = "-"; i := StringToLongInt(buf); Done := Conversions.Done(); IF (i < 0D) AND Done AND NOT sign THEN Done := FALSE END; (* overflow *) END END ReadLongInt; PROCEDURE ReadCard(VAR c: CARDINAL); (* read string and convert to cardinal. Syntax: cardinal = digit{digit}. Leading blanks are ignored. Done := "cardinal was read" *) BEGIN ReadString(buf); Done := Done AND (buf[0] <> "-"); IF Done THEN c := StringToCard(buf); Done := Conversions.Done(); END END ReadCard; PROCEDURE ReadLongCard(VAR c: LONGCARD); (* read string and convert to cardinal. Syntax: cardinal = digit{digit}. Leading blanks are ignored. Done := "cardinal was read" *) BEGIN ReadString(buf); Done := Done AND (buf[0] <> "-"); IF Done THEN c := StringToLongCard(buf); Done := Conversions.Done(); END END ReadLongCard; PROCEDURE ReadOct(VAR c: CARDINAL); (* read string and convert to cardinal. Syntax: cardinal = octdigit{octdigit}. Leading blanks are ignored. Done := "octal cardinal was read" *) BEGIN ReadString(buf); Done := Done AND (buf[0] <> "-"); IF Done THEN c := StringToOct(buf); Done := Conversions.Done(); END END ReadOct; PROCEDURE ReadLongOct(VAR c: LONGCARD); (* read string and convert to cardinal. Syntax: cardinal = octdigit{octdigit}. Leading blanks are ignored. Done := "octal longcard was read" *) BEGIN ReadString(buf); Done := Done AND (buf[0] <> "-"); IF Done THEN c := StringToLongOct(buf); Done := Conversions.Done(); END END ReadLongOct; PROCEDURE ReadHex(VAR c: CARDINAL); (* read string and convert to cardinal. Syntax: cardinal = hexdigit{hexdigit}. Leading blanks are ignored. Done := "hexa cardinal was read" *) BEGIN ReadString(buf); Done := Done AND (buf[0] <> "-"); IF Done THEN c := StringToHex(buf); Done := Conversions.Done(); END END ReadHex; PROCEDURE ReadLongHex(VAR c: LONGCARD); (* read string and convert to cardinal. Syntax: cardinal = hexdigit{hexdigit}. Leading blanks are ignored. Done := "hexa cardinal was read" *) BEGIN ReadString(buf); Done := Done AND (buf[0] <> "-"); IF Done THEN c := StringToLongHex(buf); Done := Conversions.Done(); END END ReadLongHex; PROCEDURE ReadReal (VAR r : REAL); BEGIN ReadString(buf); r := StringToReal(buf); Done := Conversions.Done() END ReadReal; PROCEDURE Write(ch: CHAR); BEGIN WriteChar(out,ch); END Write; PROCEDURE WriteLn; BEGIN WriteChar(out, CHAR(EOL)) END WriteLn; PROCEDURE WriteString(s: ARRAY OF CHAR); BEGIN FileSystem.WriteString(out, s); END WriteString; PROCEDURE WriteInt(i: INTEGER; n: CARDINAL); (* write integer i with (at least) n characters on file "out". If n is greater then the number of digits needed, blanks are added preceding the number *) VAR l1, l2, ix : INTEGER; BEGIN IntToString(i,n,buf); l2 := StringLen(buf) - 1; l1 := INTEGER(n) - l2; ix := 2; WHILE ix <= l1 DO WriteChar(out," "); INC(ix); END; FileSystem.WriteString(out, buf); END WriteInt; PROCEDURE WriteLongInt(i: LONGINT; n: CARDINAL); (* write integer i with (at least) n characters on file "out". If n is greater then the number of digits needed, blanks are added preceding the number *) VAR l1, l2, ix : INTEGER; BEGIN LongIntToString(i,n,buf); l2 := StringLen(buf) - 1; l1 := INTEGER(n) - l2; ix := 2; WHILE ix <= l1 DO WriteChar(out," "); INC(ix); END; FileSystem.WriteString(out, buf); END WriteLongInt; PROCEDURE WriteCard(c: CARDINAL; n: CARDINAL); VAR l1, l2, ix : INTEGER; BEGIN CardToString(c,n,buf); l2 := StringLen(buf) - 1; l1 := INTEGER(n) - l2; ix := 2; WHILE ix <= l1 DO WriteChar(out," "); INC(ix); END; FileSystem.WriteString(out, buf); END WriteCard; PROCEDURE WriteLongCard(c: LONGCARD; n: CARDINAL); VAR l1, l2, ix : INTEGER; BEGIN LongCardToString(c,n,buf); l2 := StringLen(buf) - 1; l1 := INTEGER(n) - l2; ix := 2; WHILE ix <= l1 DO WriteChar(out," "); INC(ix); END; FileSystem.WriteString(out, buf); END WriteLongCard; PROCEDURE WriteOct(c: CARDINAL; n: CARDINAL); VAR l1, l2, ix : INTEGER; BEGIN OctToString(c,n,buf); l2 := StringLen(buf) - 1; l1 := INTEGER(n) - l2; ix := 2; WHILE ix <= l1 DO WriteChar(out," "); INC(ix); END; FileSystem.WriteString(out, buf); END WriteOct; PROCEDURE WriteLongOct(c: LONGCARD; n: CARDINAL); VAR l1, l2, ix : INTEGER; BEGIN LongOctToString(c,n,buf); l2 := StringLen(buf) - 1; l1 := INTEGER(n) - l2; ix := 2; WHILE ix <= l1 DO WriteChar(out," "); INC(ix); END; FileSystem.WriteString(out, buf); END WriteLongOct; PROCEDURE WriteHex(c: CARDINAL; n: CARDINAL); VAR l1, l2, ix : INTEGER; BEGIN HexToString(c,n,buf); l2 := StringLen(buf) - 1; l1 := INTEGER(n) - l2; ix := 2; WHILE ix <= l1 DO WriteChar(out," "); INC(ix); END; FileSystem.WriteString(out, buf); END WriteHex; PROCEDURE WriteLongHex(c: LONGCARD; n: CARDINAL); VAR l1, l2, ix : INTEGER; BEGIN LongHexToString(c,n,buf); l2 := StringLen(buf) - 1; l1 := INTEGER(n) - l2; ix := 2; WHILE ix <= l1 DO WriteChar(out," "); INC(ix); END; FileSystem.WriteString(out, buf); END WriteLongHex; PROCEDURE PrintReal (r : REAL; d, n : CARDINAL; form : CHAR); VAR l1, l2, ix : INTEGER; BEGIN RealToString(r,d,n,form,buf); l2 := StringLen(buf) - 1; l1 := INTEGER(n) - l2; ix := 2; WHILE ix <= l1 DO WriteChar(out," "); INC(ix); END; FileSystem.WriteString(out, buf); END PrintReal; PROCEDURE WriteReal (r : REAL; d, n : CARDINAL); BEGIN PrintReal(r,d,n,'f'); END WriteReal; PROCEDURE WriteEReal (r : REAL; d, n : CARDINAL); BEGIN PrintReal(r,d,n,'e'); END WriteEReal; BEGIN in := File(Stdin); out := File(Stdout); termCH := 0C; END InOut. 0707070000020076361006440001460001440000010454120427416054700004100000063041/usr/local/lib/mod2/M2System.impIMPLEMENTATION MODULE M2System; (* HS 19.02.86 *) FROM SYSTEM IMPORT ADDRESS, ADR, BYTE, INLINE, SETREG, REG, LONG; FROM Terminal IMPORT WriteLn, WriteString; FROM FileSystem IMPORT ShowStatus; FROM CLibrary CIMPORT signal, SignalProc, SigIll, SigFpe, exit, dbtofl__, fltodb__, dbtol__, ltodb__, dbadd__, dbsub__, dbmul__, dbdiv__, ldiv__; CONST (* Register usage and dedicated registers : *) (* D-Register pool for expression evaluation. *) D0 = 0; (* freely used, never reserved *) D1 = 1; (* freely used, never reserved *) D2 = 2; (* D-pool, reserved when used *) D3 = 3; (* D-pool, reserved when used *) D4 = 4; (* D-pool, reserved when used *) D5 = 5; (* D-pool, reserved when used *) D6 = 6; (* D-pool, reserved when used *) D7 = 7; (* D-pool, reserved when used *) (* A-Register pool for address calculations. *) A0 = 0; (* A-pool, reserved when used *) A1 = 1; (* A-pool, reserved when used *) A2 = 2; (* A-pool, reserved when used *) A3 = 3; (* A-pool, reserved when used *) (* Dedicated A-Registers. *) SB = 4; (* SB = A4 : static base pointer *) A5 = 5; (* A5 is n e v e r used ! *) MP = 6; (* MP = A6 : procedure mark/frame pointer *) SP = 7; (* SP = A7 : active stack pointer *) (* Instruction size for simple types. *) byte = 0; word = 1; long = 2; (* Addressing Mode Categories. *) DDIR = 0; (* D-Reg. direct *) ADIR = 10B; (* A-Reg. direct *) AIDR = 20B; (* (An) *) AINC = 30B; (* (An)+ *) ADEC = 40B; (* -(An) *) AOFF = 50B; (* d16(An) *) AIDX = 60B; (* d8(An,Rx) *) XXXW = 70B; (* absolute short *) XXXL = 71B; (* absolute long *) PREL = 72B; (* d16(PC) *) IMM = 74B; (* immediate or SR*) (* MC68000 instruction mnemonics. *) (* ----------------------------- *) (* Special purpose. *) UNLK = 047136B; (* UNLK MP *) LINK = 047126B; (* LINK MP,#d16 *) LEASP = 047757B; (* LEA d16(SP),SP *) INCSP = 050217B; (* ADDQ.L #n,SP *) DECSP = 050617B; (* SUBQ.L #n,SP *) MOVEMDEC = 044347B; (* MOVEM.L registers,-(SP) *) MOVEMINC = 046337B; (* MOVEM.L (SP)+,registers *) MVEMSP = 027400B; (* MOVE.L ea,-(SP) : push *) MVESPP = 020037B; (* MOVE.L (SP)+,ea : pop *) (* Instructions without operand. *) NOP = 047161B; RTE = 047163B; RTS = 047165B; RTD = 047164B; TRAPV= 047166B; ILL = 045374B; (* Branches : with a displacement. *) BRA = 060000B; BSR = 060400B; BHI = 061000B; BLS = 061400B; BCC = 062000B; BCS = 062400B; BNE = 063000B; BEQ = 063400B; BVC = 064000B; BVS = 064400B; BPL = 065000B; BMI = 065400B; BGE = 066000B; BLT = 066400B; BGT = 067000B; BLE = 067400B; (* Branches : a register and a displacement. *) DBT = 050310B; DBRA = 050710B; DBHI = 051310B; DBLS = 051710B; DBCC = 052310B; DBCS = 052710B; DBNE = 053310B; DBEQ = 053710B; DBVC = 054310B; DBVS = 054710B; DBPL = 055310B; DBMI = 055710B; DBGE = 056310B; DBLT = 056710B; DBGT = 057310B; DBLE = 057710B; (* Set according to condition an effective address. *) ST = 050300B; (* Operand is a specific register. *) SWAP = 044100B; EXTW = 044200B; (* EXT.W byte to word *) EXTL = 044300B; (* EXT.L word to long *) (* Operand is an effective address. *) CLR = 041000B; NEG = 042000B; TST = 045000B; COM = 043000B; (* synonym for NOT *) JMP = 047300B; JSR = 047200B; PEA = 044100B; TAS = 045300B; INC1 = 051000B; (* ADDQ #1,ea *) DEC1 = 051400B; (* SUBQ #1,ea *) (* Operand is an immediate value. *) TRAP = 047100B; (* TRAP #vector *) EMUF = 170000B; (* Line F *) EMUA = 120000B; (* Line A *) (* Operands are a register and an effective address. *) ADD = 150000B; SUB = 110000B; CMP = 130000B; EORL = 130400B; (* synonym for exclusive OR *) ANDL = 140000B; (* synonym for AND *) ORL = 100000B; (* synonym for inclusive OR *) CHK = 040600B; LEA = 040700B; DIVS = 100700B; DIVU = 100300B; MULS = 140700B; MULU = 140300B; ADDAL= 150700B; (* ADDA.L ea,An *) CMPAL= 130700B; (* CMPA.L ea,AN *) SUBAL= 110700B; (* SUBA.L ea,AN *) EXGL = 140500B; (* EXG.L Dn,Dm *) (* Immediate data within op. and an effective address. *) ADDQ = 050000B; SUBQ = 050400B; (* Shift register by count. *) ASL = 160400B; ASR = 160000B; LSL = 160410B; LSR = 160010B; ROL = 160430B; ROR = 160030B; (* Immediate data within extension and an effective address. *) ADDI = 003000B; ANDI = 001000B; CMPI = 006000B; EORI = 005000B; ORI = 000000B; SUBI = 002000B; (* Bit manipulation. *) BTST = 000400B; BCHG = 000500B; BCLR = 000600B; BSET = 000700B; (* Move groups. *) MOVEB = 010000B; (* group 1 *) MOVEW = 030000B; (* group 3 *) MOVEL = 020000B; (* group 2 *) MOVEAW = 030100B; (* MOVEA.W ea,An *) MOVEAL = 020100B; (* MOVEA.L ea,An *) MOVEQ = 070000B; (* MOVE.L #imm,Dn *) MOVEFRSR = 040300B; (* MOVE.W SR,ea *) MOVETOSR = 043300B; (* MOVE.W ea,SR *) MOVETOCCR = 042300B; (* MOVE ea to CCR, size is word *) MOVEFRCCR = 041300B; (* MOVE CCR to ea, size is word, MC68010 only *) MOVETOUSP = 047140B; (* MOVE An to USP, size is long *) MOVEFRUSP = 047150B; (* MOVE USP to An, size is long *) (* Left shift constants. *) LS3 = 10B; LS4 = 20B; LS5 = 40B; LS6 = 100B; LS7 = 200B; LS8 = 400B; LS9 = 1000B; LS10 = 2000B; LS11 = 4000B; LS12 = 10000B; (* concerning the STATUS register. *) TBIT = 100000B; (* trace bit *) SBIT = 020000B; (* supervisor bit *) NBIT = 8; (* negative bit *) ZBIT = 4; (* zero bit *) VBIT = 2; (* overflow bit *) CBIT = 1; (* carry bit *) CLRALLI = 174377B; (* enable (AND) all interrupts *) SETALLI = 3400B; (* disable (OR) all interrupts *) (* exception vector numbers : multiply number *) (* by 4 to get the absolute address. *) INITSSP = 0; INITPC = 1; BUSERR = 2; ADRERR = 3; ILLINS = 4; ZERDIV = 5; CHKINS = 6; TRAPVINS = 7; PRIVVIO = 8; TRACE = 9; EM1010 = 10; EM1111 = 11; FORMERR = 14; UNINVE = 15; (* MC68010 only *) (* The following type is used by the 64-bit float arithmetic routines *) TYPE LongRealConvType = RECORD CASE :BOOLEAN OF TRUE: lo, hi: LONGINT; | FALSE: longreal: LONGREAL; END; END; VAR convert: LongRealConvType; (* used for 64-bit float operations *) retval: LONGINT; (* return value for call to "signal" *) PROCEDURE PutPC(p : ADDRESS); (* display the PC of the exception trap onto the terminal. *) VAR s : ARRAY [0..23] OF CHAR; c,i : CARDINAL; BEGIN s := ' at address 0x--------.'; i := 22; REPEAT DEC(i); c := VAL(CARDINAL, p MOD 16D); p := p DIV 16D; IF (c < 10) THEN c := c + 60B ELSE c := c + 67B END; s[i] := CHR(c); UNTIL i = 14; s[23] := 0C; WriteString(s); WriteLn; END PutPC; PROCEDURE HALTX; (* *) (* This procedure is called by the compiler *) (* for Program-Halt or for some compiler- *) (* generated error-halts and by System for *) (* some error exits. *) (* *) (* The calling sequence is : *) (* *) (* MOVEQ Halt-Index,D0 *) (* JSR (BSR) System.HALTX *) (* *) (* *) (* All pool registers free for HALTX. *) (* *) (* *) (* Halt-Indices in the range OF -10 .. +10 *) (* are reserved for the compiler and for the *) (* Runtime System. *) (* *) (* The Halt-Index indicates the reason for *) (* the Program-Halt as follows : *) (* *) (* X = -8 : line 1111 emulator *) (* X = -7 : privilege violation *) (* X = -6 : arithmetic overflow (TRAPV) *) (* X = -5 : index/range error (CHK) *) (* X = -4 : zero divide *) (* X = -3 : illegal instruction *) (* X = -2 : address error *) (* X = -1 : bus error *) (* X = 0 : Program Halt *) (* X = 1 : case index out of range (if no *) (* ELSE-clause in CASE-statement) *) (* X = 2 : no-return from function error *) (* X = 3 : IEEE arithmetic overflow *) (* X = 4 : call to unimpl. System routine *) (* *) (* *) (* Note : there is NO return from this *) (* ---- procedure. *) (* *) TYPE Why = [ -10 .. 10 ]; VAR pc : ADDRESS; (* Halt program-counter *) i : Why; (* service number *) ch : CHAR; BEGIN (* HALTX *) INLINE(MOVEAL + AOFF + MP, 4); (* Halt program counter*) pc := REG(ADIR+A0) - 4D; (* save program counter (return address) *) i := VAL(INTEGER, REG(D0)); (* save service number *) CASE i OF (* -8 : PutString(' line 1111 emulator.'); | -7 : PutString(' privilege violation.'); | -6 : PutString(' arithmetic overflow (TRAPV).'); | -5 : PutString(' index/range error (CHK).'); | -4 : PutString(' zero divide.'); | -3 : PutString(' illegal instruction.'); | -2 : PutString(' address error.'); | -1 : PutString(' bus error.'); | *) 0 : WriteString('Program Halted'); | 1 : WriteString('Case index out of range'); | 2 : WriteString('No-return from function error'); | 3 : WriteString('IEEE floating point arithmetic overflow'); | 4 : WriteString('REM operation on floats not implemented'); | 5 : WriteString('Index/Range error or arithmetic overflow/underflow'); | 6 : WriteString('Division by zero'); | 7 : WriteString('NEW: Heap Overflow'); ELSE WriteString('Unknown index to M2System.HALTX'); END; PutPC(pc); exit(1D + LONG(0, i)); END HALTX; (* 32-bit unsigned arithmetic for a long CARDINAL type *) PROCEDURE MULU32; BEGIN INLINE(MOVEMDEC, {10..13}); (* MOVEM D5-D2,-(SP) *) (* copy the 2 factors into registers D1 and D2 : *) SETREG(D1, REG(D1)); (* MOVE.L D1,D1 *) SETREG(D2, REG(D0)); (* MOVE.L D0,D2 *) INLINE(02601H,02801H,02A02H,04844H,04845H); INLINE(0C2C2H,0C4C4H,0C6C5H,0C8C5H,04841H); INLINE(0D242H,04285H,0D985H,0D243H,0D985H); INLINE(04841H,04242H,04243H,04842H,04843H); INLINE(0D483H,0D484H); (* the result is a 64-bit product as follows : *) (* the lower 32 bits are in register D1, whereas *) (* the upper 32 bits are in register D2. *) SETREG(D0, REG(D1)); (* MOVE.L D1,D0 *) SETREG(D1, REG(D2)); (* MOVE.L D2,D1 *) (* set overflow-bit if D1 is NOT zero, otherwise *) (* the overflow-bit is cleared. *) INLINE(4A81H, 6704H, 003CH, 0002H); (* Caution : the instructions generated below *) (* ------- must NOT change the condition codes!*) INLINE(MOVEMINC, {D2..D5}); (* MOVEM (SP)+,D2-D5 *) END MULU32; PROCEDURE DIVU32; BEGIN INLINE(MOVEMDEC, {11..13}); (* MOVEM D4-D2,-(SP) *) SETREG(D2, REG(D1)); (* MOVE.L D1,D2 *) SETREG(D1, REG(D0)); (* MOVE.L D0,D1 *) INLINE (0B4BCH, 0000H,0FFFFH, 621EH); INLINE ( 4243H, 82C2H, 680EH); INLINE ( 3801H, 4241H, 4841H, 82C2H, 3601H, 3204H, 82C2H); INLINE ( 4843H, 3601H, 4241H, 4841H, 601EH); INLINE ( 4283H, 3601H, 4843H, 4241H, 4841H, 383CH, 000FH); INLINE (0E38BH,0E391H,0B282H, 6504H, 9282H, 5243H, 51CCH,0FFF2H); (* D1 contains the remainder, D3 the quotient. *) SETREG(D0, REG(D3)); (* MOVE.L D3,D0 *) SETREG(D1, REG(D1)); (* MOVE.L D1,D1 *) INLINE(MOVEMINC, {D2..D4}); (* MOVEM (SP)+,D2-D4 *) END DIVU32; (* 32-bit signed arithmetic for a long INTEGER type *) PROCEDURE MULS32; BEGIN INLINE(MOVEMDEC, {8..13}); (* MOVEM D7-D2,-(SP) *) (* copy the 2 factors into registers D1 and D2 : *) SETREG(D1, REG(D1)); (* MOVE.L D1,D1 *) SETREG(D2, REG(D0)); (* MOVE.L D0,D2 *) INLINE(02601H,02801H,02A02H,02C01H,04287H,04844H,04845H); INLINE(0C2C2H,0C4C4H,0C6C5H,0C8C5H,04841H); INLINE(0D242H,0D987H,0D243H,0D987H); INLINE(04841H,04242H,04243H,04842H,04843H); INLINE(0D483H,0D484H,04845H,04A86H,06A02H); INLINE(09485H,04A85H,06A02H,09486H); (* the result is a 64-bit product as follows : *) (* the lower 32 bits are in register D1, whereas *) (* the upper 31 bits plus the sign are in D2. *) SETREG(D0, REG(D1)); (* MOVE.L D1,D0 *) SETREG(D1, REG(D2)); (* MOVE.L D2,D1 *) (* set overflow-bit if D1 is NOT the sign-extension *) (* of D0, otherwise the overflow-bit is cleared. *) INLINE(4A80H, 6A02H, 4681H, 4A81H, 6704H, 003CH, 0002H); (* Caution : the instructions generated below *) (* ------- must NOT change the condition codes!*) INLINE(MOVEMINC, {D2..D7}); (* MOVEM (SP)+,D2-D7 *) END MULS32; PROCEDURE DIVS32; BEGIN (* Assert: dividend already in D0 *) (* put divisor on the stack *) ldiv__(REG(D1)); (* from C library *) (* result in D0 *) END DIVS32; (* 32-bit IEEE floating point arithmetic procedures *) PROCEDURE FADDs (adder, addend : REAL) : REAL; BEGIN (* software develloped on a SMAKY6/SMAKY8 system, then keyed in from the hex listing. each line corresponds to one commented part in the source. arithmetic is done with rounding. -0 are always detected and converted to +0 (operands, result). author : 27.4.1983 P. FINK ETH. *) SETREG(D4, adder); (* MOVE.L adder,D4 *) SETREG(D6, addend); (* MOVE.L addend,D6 *) INLINE (0E39CH,0E39EH, 2004H, 9086H, 6402H,0C946H); INLINE ( 1604H,0C63CH, 0001H, 0800H, 0000H, 6704H, 08C3H, 0001H); INLINE (0E19CH, 4245H, 1A04H, 56C4H,0E29CH, 4204H,0E19EH, 4247H, 1E06H, 56C6H,0E29EH, 4206H); INLINE ( 3005H, 9047H,0B07CH, 0018H, 622EH,0E0AEH); INLINE ( 0803H, 0001H, 660AH); INLINE (0D886H, 6404H,0E294H, 5245H, 601CH); INLINE ( 9886H, 6B18H, 6716H,0B8BCH, 0000H,0FFFFH, 6208H, 9A7CH, 0010H, 4844H, 6B06H, 5345H,0E38CH, 6AFAH); INLINE (0D8BCH, 0000H, 0080H, 6404H, 0E294H, 5245H); INLINE ( 4204H, 4A84H, 6602H, 4245H, 4A45H, 6E04H, 4284H, 6018H,0BA7CH, 00FFH, 6D08H); INLINE (NOP, MOVEQ + 3); HALTX; (* HALTX(3) *) INLINE (0E38CH, 1805H,0E09CH,0E213H,0E294H); RETURN VAL(REAL, REG(D4)); (* return value in D4 *) END FADDs; PROCEDURE FSUBs (minuend, subtrahend : REAL) : REAL; BEGIN (* change sign of source op. and call FADDs : *) SETREG(D0, subtrahend); (* MOVE.L subtrahend,D0 *) INLINE (0840H, 001FH); (* BCHG #31,D0 *) RETURN FADDs( minuend, VAL(REAL, REG(D0)) ); END FSUBs; PROCEDURE FMULs (multiplicand, multiplier : REAL) : REAL; BEGIN SETREG(D4, multiplicand); (* MOVE.L multiplicand,D4 *) SETREG(D6, multiplier); (* MOVE.L multiplier,D6 *) INLINE ( 2E04H,0BD87H); INLINE ( 4844H, 3A04H,0CA7CH, 7F80H, 676CH,0EE4DH, 0C87CH, 007FH, 887CH, 0080H, 4846H, 3E06H,0CE7CH, 7F80H, 6758H,0EE4FH, 0CC7CH, 007FH, 8C7CH, 0080H); INLINE (0DA47H, 9A7CH, 007EH, 6D46H); INLINE ( 2004H, 4840H, 4846H,0C0C6H, 4240H, 4840H); INLINE ( 3204H,0C2C6H,0D081H); INLINE ( 2204H, 4841H, 4846H,0C2C6H,0D081H); INLINE (0C8C6H, 4844H,0D880H); INLINE ( 6B04H,0E38CH, 5345H); INLINE (0D8BCH, 0000H, 0080H, 6404H,0E294H, 5245H); INLINE ( 4A45H, 6B0EH,0BA7CH, 00FFH, 6D0CH); INLINE (NOP, MOVEQ + 3); HALTX; (* HALTX(3) *) INLINE ( 4284H, 600AH); INLINE (0E38CH, 1805H,0E09CH,0E397H,0E294H); RETURN VAL(REAL, REG(D4)); (* return value in D4 *) END FMULs; PROCEDURE FDIVs (dividend, divisor : REAL) : REAL; BEGIN SETREG(D4, dividend); (* MOVE.L dividend,D4 *) SETREG(D6, divisor); (* MOVE.L divisor,D6 *) INLINE ( 2E04H,0BD87H); INLINE (0E38EH,0E19EH, 4247H, 1E06H, 6606H); (* floating pt. division by zero error *) INLINE (MOVEQ + 6); HALTX; INLINE (1C3CH, 0001H,0E29EH, 0E38CH,0E19CH, 4245H, 1A04H, 6756H, 183CH, 0001H,0E29CH); INLINE ( 9A47H,0DA7CH, 007FH); INLINE ( 4846H,0E28CH, 88C6H, 3004H, 4244H, 88C6H, 4844H, 3800H); INLINE ( 2006H, 4840H,0C0C4H,0E288H, 80C6H,0C0BCH, 0000H,0FFFFH, 0E388H, 4844H, 9880H); INLINE ( 6B04H,0E38CH, 5345H); INLINE (0D8BCH, 0000H, 0080H, 6404H,0E294H, 5245H); INLINE ( 4A45H, 6B0EH,0BA7CH, 00FFH, 6D0CH); INLINE (NOP, MOVEQ + 3); HALTX; (* HALTX(3) *) INLINE ( 4284H, 600AH); INLINE (0E39CH, 1805H,0E09CH,0E397H,0E294H); RETURN VAL(REAL, REG(D4)); (* return value in D4 *) END FDIVs; PROCEDURE FREMs (dividend, divisor : REAL) : REAL; BEGIN INLINE(MOVEQ + 4); HALTX; (* HALTX(4) *) END FREMs; PROCEDURE FCMPs (first, second : REAL); (* result in CCR *) (* result is returned in the condition code register: N Z V *) BEGIN SETREG(D0, first); (* MOVE.L first,D0 *) SETREG(D1, second); (* MOVE.L second,D1 *) INLINE ( 2400H, 6A06H, 0A80H, 7FFFH,0FFFFH, 0C4BCH, 7F80H, 0000H, 6602H, 4280H); INLINE ( 2401H, 6A06H, 0A81H, 7FFFH,0FFFFH, 0C4BCH, 7F80H, 0000H, 6602H, 4281H); INLINE (0B081H); (* result in CCR ! *) END FCMPs; PROCEDURE FNEGs (toNeg : REAL) : REAL; BEGIN SETREG(D0, toNeg); (* MOVE.L toNeg,D0 *) INLINE(0840H, 001FH); (* BCHG #31,D0 *) RETURN VAL(REAL, REG(D0)); (* return value in D0 *) END FNEGs; PROCEDURE FABSs (toAbs : REAL) : REAL; BEGIN SETREG(D0, toAbs); (* MOVE.L toAbs,D0 *) INLINE(ANDI + long*LS6 + D0, 07FFFH, 0FFFFH); RETURN VAL(REAL, REG(D0)); (* return value in D0 *) END FABSs; PROCEDURE FLOATs (toFloat : LONGINT) : REAL; BEGIN SETREG(D0, toFloat); (* MOVE.L toFloat,D0 *) INLINE ( 4A80H, 672AH, 323CH, 009EH); INLINE (0B0BCH, 0000H,0FFFFH, 6206H, 4840H, 927CH, 0010H); INLINE (0B0BCH, 00FFH,0FFFFH, 6204H,0E188H, 5141H); INLINE (0E388H, 55C9H,0FFFCH); INLINE ( 1001H,0E098H,0E288H); RETURN VAL(REAL, REG(D0)); (* return value in D0 *) END FLOATs; PROCEDURE TRUNCs (toTrunc : REAL) : LONGINT; BEGIN SETREG(D0, toTrunc); (* MOVE.L toTrunc,D0 *) INLINE ( 4A80H, 6A0AH,0C0BCH, 7F80H, 0000H, 6716H, 6020H); INLINE (0E388H,0E198H, 4241H, 1200H, 103CH, 0001H,0E298H); INLINE ( 927CH, 007FH, 6C04H, 4280H, 601AH); INLINE ( 927CH, 001FH, 4441H, 6C08H); INLINE (NOP, MOVEQ + 3); HALTX; (* HALTX(3) *) INLINE (0E2A8H); INLINE (0B0BCH, 0000H,0FFFFH, 62EEH); RETURN VAL(LONGINT, REG(D0)); (* return value in D0 *) END TRUNCs; (* 64-bit IEEE floating point arithmetic procedures. *) (* *) (* The calling sequence for the emulation library routines is as follows: *) (* *) (* The first operand is put in registers D0 (low order word) and D1 (high *) (* order word). *) (* The second operand is placed on the stack (low - decrement stack - high) *) (* Call the appropriate routine from the C library. *) (* Pop 8 bytes off the stack pointer whuere the second operand was. *) (* The result will be in registers D0 (low order word) and D1 (high word). *) PROCEDURE FADDd (adder, addend : LONGREAL) : LONGREAL; BEGIN INLINE(4CEEH, 0003H, 0010H); (* MOVEM.L 10.w(%fp), &<%d0,%d1> (adder) *) INLINE(4CEEH, 000CH, 0008H); (* MOVEM.L 8.w(%fp), &<%d2,%d3> (addend) *) INLINE(MOVEMDEC, {12..13}); (* MOVEM.L D3-D2,-(SP) (put addend on stack) *) dbadd__; (* from C Library *) INLINE(504FH); (* ADDQ.W &8,(SP) - pop parameter space *) convert.lo := REG(D0); convert.hi := REG(D1); RETURN convert.longreal; END FADDd; PROCEDURE FSUBd (minuend, subtrahend : LONGREAL) : LONGREAL; BEGIN INLINE(4CEEH, 0003H, 0010H); (* MOVEM.L 10.w(%fp), &<%d0,%d1> (minuend) *) INLINE(4CEEH, 000CH, 0008H); (* MOVEM.L 8.w(%fp), &<%d2,%d3> (subtrahend) *) INLINE(MOVEMDEC, {12..13}); (* MOVEM.L D3-D2,-(SP) (put subtr. on stack) *) dbsub__; (* from C Library *) INLINE(504FH); (* ADDQ.W &8,(SP) - pop parameter space *) convert.lo := REG(D0); convert.hi := REG(D1); RETURN convert.longreal; END FSUBd; PROCEDURE FMULd (multiplicand, multiplier : LONGREAL) : LONGREAL; BEGIN INLINE(4CEEH, 0003H, 0010H); (* MOVEM.L 10.w(%fp), &<%d0,%d1> (mul..cand) *) INLINE(4CEEH, 000CH, 0008H); (* MOVEM.L 8.w(%fp), &<%d2,%d3> (multiplier) *) INLINE(MOVEMDEC, {12..13}); (* MOVEM.L D3-D2,-(SP) (multiplier to stack) *) dbmul__; (* from C Library *) INLINE(504FH); (* ADDQ.W &8,(SP) - pop parameter space *) convert.lo := REG(D0); convert.hi := REG(D1); RETURN convert.longreal; END FMULd; PROCEDURE FDIVd (dividend, divisor : LONGREAL) : LONGREAL; BEGIN INLINE(4CEEH, 0003H, 0010H); (* MOVEM.L 10.w(%fp), &<%d0,%d1> (dividend) *) INLINE(4CEEH, 000CH, 0008H); (* MOVEM.L 8.w(%fp), &<%d2,%d3> (divisor) *) INLINE(MOVEMDEC, {12..13}); (* MOVEM.L D3-D2,-(SP) (divisor to stack) *) dbdiv__; (* from C Library *) INLINE(504FH); (* ADDQ.W &8,(SP) - pop parameter space *) convert.lo := REG(D0); convert.hi := REG(D1); RETURN convert.longreal; END FDIVd; PROCEDURE FREMd (dividend, divisor : LONGREAL) : LONGREAL; BEGIN INLINE(MOVEQ + 4); HALTX; (* HALTX(4) *) END FREMd; PROCEDURE FCMPd (first, second : LONGREAL); (* result in CCR *) BEGIN INLINE(4CEEH, 0003H, 0010H); (* MOVEM.L 10.w(%fp), &<%d0,%d1> (first) *) INLINE(4CEEH, 000CH, 0008H); (* MOVEM.L 8.w(%fp), &<%d2,%d3> (second) *) INLINE(MOVEMDEC, {12..13}); (* MOVEM.L D3-D2,-(SP) (put second on stack *) dbsub__; (* from C Library *) INLINE(504FH); (* ADDQ.W &8, %sp - pop parameter space *) INLINE(4A80H); (* TST.L %d0 - to set CCR *) (* result in CCR *) END FCMPd; PROCEDURE FNEGd (toNeg : LONGREAL) : LONGREAL; BEGIN (* just changes the high (sign) bit of the high longword of the longreal *) convert.longreal := toNeg; SETREG(D0, convert.hi); INLINE(0840H, 001FH); (* BCHG #31,D0 *) convert.hi := REG(D0); RETURN convert.longreal; END FNEGd; PROCEDURE FABSd (toAbs : LONGREAL) : LONGREAL; BEGIN (* just sets the high (sign) bit of the high longword of the longreal *) convert.longreal := toAbs; SETREG(D0, convert.hi); INLINE(ANDI + long*LS6 + D0, 07FFFH, 0FFFFH); convert.hi := REG(D0); RETURN convert.longreal; END FABSd; PROCEDURE FLOATd (toFloat : LONGINT) : LONGREAL; BEGIN SETREG(D0, toFloat); ltodb__; convert.lo := REG(D0); convert.hi := REG(D1); RETURN convert.longreal; END FLOATd; PROCEDURE TRUNCd (toTrunc : LONGREAL) : LONGINT; BEGIN convert.longreal := toTrunc; SETREG(D0, convert.lo); SETREG(D1, convert.hi); dbtol__; RETURN VAL(LONGINT,REG(D0)); END TRUNCd; (* conversions form single to double and vice versa *) PROCEDURE FLONG (toConvert : REAL) : LONGREAL; BEGIN SETREG(D0, toConvert); fltodb__; convert.lo := REG(D0); convert.hi := REG(D1); RETURN convert.longreal; END FLONG; PROCEDURE FSHORT (toConvert : LONGREAL) : REAL; BEGIN convert.longreal := toConvert; SETREG(D0, convert.lo); SETREG(D1, convert.hi); dbtofl__; RETURN VAL(REAL,REG(D0)); END FSHORT; PROCEDURE SigHandler(sig: LONGINT); VAR retval: LONGINT; BEGIN (* ignore subsequent signals of the same kind so can get work done *) retval := signal(sig, VAL(SignalProc, 1D)); (* SIG_IGN *) IF sig = SigIll THEN (* Either index/range or arithmetic underflow/overflow error. *) (* Former is triggered by CHK instruction, latter by TRAPV. *) INLINE(MOVEQ + 5); ELSE (* ASSERT: sig = SigFpe *) (* division by zero *) INLINE(MOVEQ + 6); END; HALTX; END SigHandler; BEGIN (* System *) (* catch illegal instruction, which is either range or overflow error *) retval := signal(SigIll, SigHandler); IF retval = -1D THEN (* error! *) WriteString("ERROR: cannot catch SIGILL signal: "); ShowStatus; exit(1D); END; (* catch "floating pt. exception" signal, which is division by zero *) retval := signal(SigFpe, SigHandler); IF retval = -1D THEN (* error! *) WriteString("ERROR: cannot catch SIGILL signal: "); ShowStatus; exit(1D); END; END M2System. 0707070000020076371006440001460001440000010415460427416055000004100000025346/usr/local/lib/mod2/MathLib0.impIMPLEMENTATION MODULE MathLib0; FROM InOut IMPORT WriteLn, WriteString; FROM Conversions IMPORT RealToString, StringToInt; CONST (*MaxInt = 2147483647;*) eps = 1.49011611938477E-8; HalfPi = 1.570796326794897; LnMaxReal = 7.09196208642162E2; LnMinReal = -7.06893623549175E2; Ymax = 6.71088640000000E7; MinSinR = 1; MaxSinR = 8; (*MaxFloat = 3.40282346638528860E+38;*) TYPE LnType = ARRAY [1..4] OF REAL; VAR LnA, LnB, ExpP, ExpQ : LnType; LnC1 : REAL; ArcTanP, ArcTanQ, ArcTanA : ARRAY [0..3] OF REAL; SinR : ARRAY [MinSinR..MaxSinR] OF REAL; SinC : ARRAY [1..2] OF REAL; PROCEDURE frexp(x : REAL; VAR iexp : INTEGER) : REAL; VAR fraction, factor : REAL; sign : INTEGER; BEGIN fraction := x; iexp := 0; IF x < 0.5 THEN sign := -1; factor := 2.0; ELSE sign := 1; factor := 0.5; END; WHILE (fraction < 0.5) OR (fraction >= 1.0) DO fraction := fraction * factor; iexp := iexp + sign; END; IF x < 0.0 THEN RETURN (-1.0 * fraction) ELSE RETURN fraction END; END frexp; PROCEDURE ldexp(x : REAL; iexp : INTEGER) : REAL; VAR sum, factor : REAL; sign : INTEGER; BEGIN sum := x; IF iexp < 0 THEN sign := 1; factor := 0.5; ELSE sign := -1; factor := 2.0; END; WHILE iexp <> 0 DO sum := sum * factor; iexp := iexp + sign; END; RETURN sum; END ldexp; PROCEDURE sqrt(x : REAL) : REAL; (* Return the square root of x. *) VAR y : REAL; iexp, loopct : INTEGER; BEGIN loopct := 4; IF x < 0.0 THEN MathStatus := InValid; WriteString("Negative number!"); WriteLn; RETURN 0.0; ELSIF x = 0.0 THEN MathStatus := Valid; RETURN x; ELSE y := frexp(x, iexp); IF (iexp MOD 2 = 1) THEN iexp := iexp - 1; y := y + y; END; y := ldexp(y + 1.0, iexp DIV 2 - 1); REPEAT y := 0.5 * (y + x/y); loopct := loopct - 1; UNTIL loopct = 0; MathStatus := Valid; RETURN y; END; (* if *) END sqrt; PROCEDURE abs (a : REAL) : REAL; (* Return the absolute value of a. *) BEGIN IF a < 0.0 THEN RETURN -a ELSE RETURN a END; END abs; PROCEDURE poly(y : REAL; n : INTEGER; ary : LnType) : REAL; BEGIN IF (n = 2) THEN RETURN (ary[1] * y + ary[2]); ELSE RETURN (poly(y, n - 1, ary) * y + ary[n]); END; END poly; PROCEDURE exp(x : REAL) : REAL; (* Return e**x. *) CONST InvLn2 = 1.4426950408889634074; C1 = 0.693359375; C2 = -2.1219444005469058277E-4; SmallestNegativeValue = -706.0; (* C3 = 1.0E+10; *) VAR x1, x2, y, z : REAL; n : INTEGER; BEGIN MathStatus := InValid; (*MaxFloat := 3.40282346638528860E+8 * (C3)*(C3)*(C3); *) z := x; IF (x < 0.0) THEN x := -x; END; IF (x < eps) THEN RETURN (1.0 + y); END; IF (z < SmallestNegativeValue) THEN RETURN 0.0; END; IF (z > LnMaxReal) THEN RETURN MAX(REAL); END; MathStatus := Valid; n := entier(x * InvLn2 ); y := FLOAT(n); (* Reduce *) x1 := x; x2 := x - x1; x := x1 - y * C1; x := x + x2; x := x - (y * C2); IF (z < 0.0) THEN x := -x; n := -n; END; y := x * x; x := x * poly(y, 3, ExpP); RETURN (ldexp(0.5 + x/(poly(y, 4, ExpQ) - x), n + 1)); END exp; PROCEDURE ln(x : REAL) : REAL; (* Return the natural log of x. *) CONST C0 = 0.70710678118654752440; C2 = -2.121944400546905827679E-4; VAR y : REAL; iexp: INTEGER; BEGIN MathStatus := Valid; IF (x <= 0.0) THEN WriteString(" Range Error!! "); MathStatus := InValid; RETURN LnMinReal; END; y := 1.0; x := frexp(x, iexp); IF (x < C0) THEN iexp := iexp - 1; y := 0.5; END; x := (x - y)/(x + y); x := x + x; y := x * x; x := x + (x * y * poly(y, 3, LnA)/poly(y, 4, LnB)); y := FLOAT(iexp); x := x + y * C2; RETURN (x + y * LnC1); END ln; PROCEDURE arctan(x : REAL) : REAL; (* Return the arctangent of x. *) CONST Smallest = 1.0E-7; Biggest = 1.0E15; MaxArctan = 1.57079632679490; SqrtThree = 1.73205080756888; SqrtThreeLessOne = 0.732050807568877; TwoLessSqrtThree = 0.267949192431123; VAR f, g, R, P, Q, Result : REAL; n : CARDINAL; BEGIN MathStatus := Valid; f := abs(x); IF f=Biggest THEN MathStatus := InValid; RETURN MaxArctan; ELSIF x<=-Biggest THEN MathStatus := InValid; RETURN -MaxArctan; END; IF f>1.0 THEN f := 1.0/f; n := 2; ELSE n := 0; END; IF f>TwoLessSqrtThree THEN f := (((SqrtThreeLessOne*f-0.5)-0.5)+f)/(SqrtThree+f); n := n+1; (* ignore scale f step for floating-point implementations *) END; IF abs(f)1 THEN Result := -Result; END; Result := ArcTanA[n]+Result; IF x<0.0 THEN Result := -Result; END; RETURN Result; END arctan; PROCEDURE truncate(x : REAL) : INTEGER; (* Return the truncated REAL x. *) VAR s, str, num : ARRAY [0..31] OF CHAR; j, i, out : INTEGER; BEGIN i := 0; j := 0; RealToString(x, 6, 1, 'f', str); WHILE str[i] <> '.' DO s[j] := str[i]; i := i + 1; j := j + 1; END; s[j] := 0C; out := StringToInt(s); RETURN out; END truncate; PROCEDURE entier(x : REAL) : INTEGER; (* Return the nearest INTEGER to the REAL x. *) VAR Sign : BOOLEAN; y : REAL; BEGIN Sign := FALSE; IF x<0.0 THEN Sign := TRUE; x := -x; END; IF x>=(real(MAX(INTEGER)) + 0.5) THEN MathStatus := InValid; IF Sign THEN RETURN MIN(INTEGER); ELSE RETURN MAX(INTEGER); END; END; MathStatus := Valid; y := x + 0.5; IF Sign THEN RETURN (-1)*truncate(y); ELSE RETURN truncate(y); END; END entier; PROCEDURE sin(x : REAL) : REAL; (* Return the sine of x. *) VAR i : CARDINAL; n : INTEGER; x1, x2, xn, y, sgn, f, g, R, Result : REAL; str:ARRAY[0..20] OF CHAR; BEGIN IF x<0.0 THEN sgn := -1.0; y := -x; ELSE sgn := 1.0; y := x; END; IF y>Ymax THEN MathStatus := InValid; RETURN 0.0; END; n := entier(y/(HalfPi * 2.0)); IF MathStatus=InValid THEN RETURN 0.0; END; xn := FLOAT(n); IF ODD(n) THEN sgn := -sgn; END; (* determine f *) x1 := FLOAT(truncate(abs(x))); x2 := abs(x)-x1; f := ((x1-xn*SinC[1])+x2)-xn*SinC[2]; IF abs(f)Ymax THEN MathStatus := InValid; RETURN 0.0; END; n := entier(y/(HalfPi*2.0)); IF MathStatus=InValid THEN RETURN 0.0; END; xn := FLOAT(n); IF ODD(n) THEN sgn := -sgn; END; xn := xn-0.5; (* determine f *) x1 := FLOAT(truncate(abs(x))); x2 := abs(x)-x1; f := ((x1-xn*SinC[1])+x2)-xn*SinC[2]; IF abs(f) 0.0) THEN RETURN x; ELSE MathStatus := InValid; WriteString("Range Error!!"); WriteLn; RETURN 0.0; END; END; neg := FALSE; IF (x < 0.0) THEN neg := TRUE; x := -x; END; IF (x <> 1.0) THEN x := ln(x); IF (x < 0.0) THEN x := -x; y := -y; END; IF (y > LnMaxReal/x) THEN MathStatus := InValid; WriteString("The power is too big!!"); WriteLn; RETURN (MAX(REAL)); END; IF (y < LnMinReal/x) THEN MathStatus := InValid; WriteString("The power is too small!!"); WriteLn; RETURN 0.0; END; x := exp(x*y); IF neg THEN RETURN -x; ELSE RETURN x; END; END; END pow; PROCEDURE real(x : INTEGER) : REAL; (* Return the REAL representation of the INTEGER x. *) BEGIN MathStatus := Valid; RETURN (FLOAT(x)); END real; (*************************** MAIN *************************************) BEGIN ArcTanP[0] := -0.136887688941919E2; ArcTanP[1] := -0.205058551958617E2; ArcTanP[2] := -0.849462403513207E1; ArcTanP[3] := -0.837582993681501E0; ArcTanQ[0] := 0.410663066825758E2; ArcTanQ[1] := 0.861573495971302E2; ArcTanQ[2] := 0.595784361425973E2; ArcTanQ[3] := 0.150240011600286E2; ArcTanA[0] := 0.0; (* pi/6 *) ArcTanA[1] := 0.523598775598299; ArcTanA[2] := HalfPi; (* pi/3 *) ArcTanA[3] := 1.04719755119660; SinR[1] := -0.166666666666667E0; SinR[2] := 0.833333333333332E-2; SinR[3] := -0.198412698412018E-3; SinR[4] := 0.275573192101528E-5; SinR[5] := -0.250521067982746E-7; SinR[6] := 0.160589364903716E-9; SinR[7] := -0.764291780689105E-12; SinR[8] := 0.272047909578888E-14; SinC[1] := 3217.0/1024.0; SinC[2] := -8.90891020676154E-6; LnA[3] := -0.64124943423745581147E2; LnA[2] := 0.16383943563021534222E2; LnA[1] := -0.78956112887491257267; LnB[4] := -0.76949932108494879777E3; LnB[3] := 0.31203222091924532844E3; LnB[2] := -0.35667977739034646171E2; LnB[1] := 1.0; LnC1 := 355.0/512.0; ExpP[3] := 0.25; ExpP[2] := 0.75753180159422776666E-2; ExpP[1] := 0.31555192765684646356E-4; ExpQ[4] := 0.5; ExpQ[3] := 0.56817302698551221787E-1; ExpQ[2] := 0.63121894374398503557E-3; ExpQ[1] := 0.75104028399870046114E-6; END MathLib0. 0707070000020076401006440001460001440000010507450427416055000003600000015324/usr/local/lib/mod2/Procs.impIMPLEMENTATION MODULE Procs; FROM SYSTEM IMPORT ADDRESS, ADR, TSIZE, LONG; FROM Coroutine IMPORT NEWPROCESS, TRANSFER; FROM Storage IMPORT ALLOCATE, DEALLOCATE; FROM InOut IMPORT WriteString, WriteLn; FROM ErrorHandling IMPORT HaltMessage; FROM CLibrary CIMPORT exit; (* TYPE SIGNAL = POINTER TO ProcessDescriptor; ProcessDescriptor = RECORD next: SIGNAL;*) (* linked list of active coroutines *) (* queue: SIGNAL;*) (* queue of coroutines waiting on specific signal *) (* cor: PROCESS;*) (* control block maintained by the system *) (* ready: BOOLEAN; *) (* flag for ready or blocked state *) (* paddr: ADDRESS;*) (* address of low-level process control block *) (* psize: CARDINAL;*) (* size allocated to process *) (* priority: INTEGER;*) (* user-assigned priority - main program always = -1*) (* main: BOOLEAN;*) (* indicates whether is main coroutine or child *) (* END; *) VAR cp: SIGNAL; (* current coroutine *) dummy: SIGNAL; (* used by StopProcess to transfer from so don't fill *) (* valid cor field with address of killed coroutine *) PROCEDURE StartProcess (P: PROC; worksize: CARDINAL; pri: INTEGER); (* maintain active coroutine list, create new coroutine, and start it *) VAR sig0: SIGNAL; wspaceaddr: ADDRESS; BEGIN sig0 := cp; ALLOCATE(wspaceaddr, LONG(0, worksize)); (* workspace for coroutine *) ALLOCATE(cp, LONG(0, TSIZE(ProcessDescriptor))); (* insert cp in active coroutine list *) WITH cp^ DO next := sig0^.next; sig0^.next := cp; ready := TRUE; paddr := wspaceaddr; psize := worksize; queue := NIL; priority := pri; main := FALSE; END; (* allocate the coroutine and start it executing *) NEWPROCESS (P, wspaceaddr, worksize, cp^.cor); TRANSFER(sig0^.cor, cp^.cor); END StartProcess; PROCEDURE schedule (start: SIGNAL): SIGNAL; (* searches for the next ready coroutine with the highest priority, * returning a pointer to its ProcessDescriptor. If none are ready, * the program is halted with a deadlock error message *) VAR temp, nextcor: SIGNAL; BEGIN temp := start; (* find the first ready coroutine *) IF (NOT start^.ready) THEN temp := start^.next; WHILE ((NOT temp^.ready) AND (temp <> start)) DO temp := temp^.next END; (* check for deadlock *) IF (NOT temp^.ready) THEN HaltMessage("ERROR: Deadlock"); END END; (* assert: temp^.ready = TRUE *) nextcor := temp; temp := temp^.next; WHILE temp <> start DO WITH temp^ DO IF ((priority > nextcor^.priority) AND ready ) THEN nextcor := temp; END; END; temp := temp^.next; END; RETURN nextcor; END schedule; PROCEDURE StopProcess; (* inactivates the current coroutine, starting the next ready one with the * highest priority *) VAR temp1: SIGNAL; BEGIN IF (cp^.main) (* must handle the main coroutine specially - can only * terminate it if all other coroutines are terminated *) THEN IF (cp <> cp^.next) THEN (* attempt to terminate main while child coroutine(s) still on * active coroutine list *) WriteLn; HaltMessage ("ERROR: deadlock: terminating main with blocked children"); ELSE (* normal termination from main *) WriteLn; WriteString ("Normal termination from main"); WriteLn; exit (0); END ELSE (* Normal Stop request from child coroutine *) (* find the node before the one to be eliminated *) temp1 := cp; WHILE temp1^.next <> cp DO temp1 := temp1^.next; END; (* unlink cp from the active coroutine list and deallocate its space *) temp1^.next := cp^.next; (* cannot call DEALLOCATE from a child process *) DEALLOCATE (cp^.paddr);(*, cp^.psize); *) DEALLOCATE (cp);(*, TSIZE (ProcessDescriptor));*) cp := schedule(temp1^.next); (* start up the next active coroutine *) TRANSFER (dummy^.cor, cp^.cor); END END StopProcess; PROCEDURE SEND (VAR sentsig: SIGNAL); (* if at least one coroutine is waiting for "sendsig", start up the coroutine which has been waiting on the queue the longest (FIFO). Nothing happens if no coroutines are waiting *) VAR sig0: SIGNAL; BEGIN IF sentsig <> NIL THEN sig0 := cp; (* grab the first coroutine on the queue *) cp := sentsig; (* remove the new active coroutine from the queue and flag it as ready *) WITH cp^ DO sentsig := queue; ready := TRUE; queue := NIL; END; (* start it up *) TRANSFER (sig0^.cor, cp^.cor) END END SEND; PROCEDURE WAIT (VAR waitsig: SIGNAL); (* put cp on the queue for "waitsig" *) VAR sig0, sig1: SIGNAL; BEGIN IF waitsig = NIL THEN waitsig := cp (* no other coroutines waiting *) ELSE (* are others waiting; put cp on the end of the queue *) sig0 := waitsig; sig1 := sig0^.queue; (* get to the end of the queue *) WHILE sig1 <> NIL DO sig0 := sig1; sig1 := sig0^.queue; END; sig0^.queue := cp END; sig0 := cp; (* inactivate the waiting process *) sig0^.ready := FALSE; (* get the next ready coroutine with the highest priority *) cp := schedule(cp^.next); (* start up the next process *) TRANSFER (sig0^.cor, cp^.cor) END WAIT; PROCEDURE Awaited (signal: SIGNAL): BOOLEAN; (* check if any coroutines waiting on this signal *) BEGIN RETURN signal <> NIL END Awaited; PROCEDURE Init (VAR signal: SIGNAL); (* compulsory initialization of a signal *) BEGIN signal := NIL END Init; (* main body of Procs module. Initialization code which sets up the * ProcessDescriptor for the main body of the user module, as well as the * dummy ProcessDescriptor used by StopProcess. *) BEGIN ALLOCATE (cp, LONG(0, TSIZE(ProcessDescriptor))); WITH cp^ DO next := cp; ready := TRUE; (* ASSERT: cor := mainprogram *) paddr := NIL; psize := 0; queue := NIL; main := TRUE; priority := -1; (* only want main program to finish if all other child coroutines are done or blocked. Users of this module should assign priorities >= 0 to the coroutines they start with "StartProcess" *) END; ALLOCATE (dummy, LONG(0, TSIZE(ProcessDescriptor))); WITH dummy^ DO (* none of these fields actually get used! *) next := NIL; ready := FALSE; paddr := NIL; psize := 0; queue := NIL; main := FALSE; priority := -2; END; END Procs. 0707070000020076411006440001460001440000010421020427416055000004000000001765/usr/local/lib/mod2/Storage.imp IMPLEMENTATION MODULE Storage; FROM CLibrary CIMPORT malloc, free, realloc, NULL; FROM ErrorHandling IMPORT ErrorMessage; FROM SYSTEM IMPORT ADDRESS, LONG; PROCEDURE ALLOCATE (VAR p : ADDRESS; size : LONGCARD); BEGIN p := malloc(size); IF p = VAL(ADDRESS, LONG(NULL)) THEN ErrorMessage('Storage.ALLOCATE: Heap overflow.') END END ALLOCATE; PROCEDURE DEALLOCATE (VAR p : ADDRESS); BEGIN free(p) END DEALLOCATE; PROCEDURE REALLOCATE (VAR p : ADDRESS; size : LONGINT); BEGIN p := realloc(p, size); IF VAL(CARDINAL,p) = NULL THEN ErrorMessage('Heap overflow.') END END REALLOCATE; PROCEDURE Available (size : LONGINT) : BOOLEAN; VAR p : ADDRESS; BEGIN p := malloc(size); IF VAL(CARDINAL,p) = NULL THEN RETURN(FALSE); ELSE RETURN(TRUE); END; DEALLOCATE(p); END Available; BEGIN END Storage. 0707070000020076421006440001460001440000010455270427416055100004000000004364/usr/local/lib/mod2/Strings.imp IMPLEMENTATION MODULE Strings; FROM CLibrary CIMPORT NULL, charPtr; FROM SYSTEM IMPORT ADR; PROCEDURE StringLen (Str : ARRAY OF CHAR) : CARDINAL; VAR i, j : CARDINAL; BEGIN i := 0; WHILE Str[i] <> 0C DO INC(i); END; RETURN(i); END StringLen; PROCEDURE CopyString (Str1 : ARRAY OF CHAR; VAR Str2 : ARRAY OF CHAR); VAR len, i, j : CARDINAL; BEGIN j := 0; len := StringLen(Str1) - 1; FOR i := 0 TO len DO IF j < HIGH(Str2) THEN Str2[j] := Str1[i]; INC(j) END END; IF j <= HIGH(Str2) THEN Str2[j] := 0C END END CopyString; PROCEDURE AppendString (Str1, Str2 : ARRAY OF CHAR; VAR Str3 : ARRAY OF CHAR); VAR len, i, j : CARDINAL; BEGIN CopyString(Str1, Str3); j := StringLen(Str3); len := StringLen(Str2) - 1; FOR i := 0 TO len DO IF j < HIGH(Str3) THEN Str3[j] := Str2[i]; INC(j) END END; IF j <= HIGH(Str3) THEN Str3[j] := 0C END END AppendString; PROCEDURE CmpString (Str1, Str2 : ARRAY OF CHAR) : INTEGER; VAR j : CARDINAL; BEGIN j := 0; WHILE (Str1[j] = Str2[j]) DO IF (Str1[j] = 0C) THEN RETURN (0); END; INC(j) END; IF (Str1[j]) > (Str2[j]) THEN RETURN (1); ELSE RETURN (-1); END; END CmpString; PROCEDURE CmpNString (Str1, Str2 : ARRAY OF CHAR; n : CARDINAL) : INTEGER; VAR j : CARDINAL; BEGIN j := 0; WHILE (Str1[j] = Str2[j]) AND (j <= (n - 1)) DO IF (Str1[j] = 0C) OR (j = (n - 1)) THEN RETURN (0); END; INC(j) END; IF (Str1[j]) > (Str2[j]) THEN RETURN (1); ELSE RETURN (-1); END; END CmpNString; PROCEDURE StringChr (Str : ARRAY OF CHAR; c : CHAR) : charPtr; VAR j : CARDINAL; chrptr : charPtr; BEGIN chrptr := charPtr(NULL); j := 0; WHILE (Str[j] <> c) AND (Str[j] <> 0C) DO INC(j) END; IF (Str[j] = c) THEN chrptr := ADR(Str[j]); END; RETURN (chrptr); END StringChr; BEGIN END Strings. 0707070000020076431006440001460001440000010451360427416055100004100000003233/usr/local/lib/mod2/Terminal.imp IMPLEMENTATION MODULE Terminal; IMPORT FileSystem; FROM FileSystem IMPORT File, ReadChar, WriteChar, EOL, Base_iob, Flush; FROM SYSTEM IMPORT ADDRESS, LONG; VAR mustagain : BOOLEAN; oldch : CHAR; Screen, Keyboard : File; PROCEDURE Read (VAR ch : CHAR); BEGIN IF mustagain THEN ch := oldch; mustagain := FALSE ELSE ReadChar(Keyboard, ch); oldch := ch END END Read; PROCEDURE ReadString (VAR Str : ARRAY OF CHAR); VAR ch : CHAR; i : CARDINAL; BEGIN i := 0; LOOP IF i > HIGH(Str) THEN EXIT END; Read(ch); IF ch = EOL THEN EXIT END; Str[i] := ch; INC(i) END; IF i <= HIGH(Str) THEN Str[i] := 0C END; IF (ch = EOL) OR (i > HIGH(Str)) THEN ReadAgain END END ReadString; PROCEDURE ReadAgain; BEGIN mustagain := TRUE END ReadAgain; PROCEDURE ReadLn; VAR ch : CHAR; BEGIN REPEAT Read(ch); UNTIL ch = EOL; mustagain := FALSE END ReadLn; PROCEDURE Write (ch : CHAR); BEGIN WriteChar(Screen, ch); IF ch = EOL THEN Flush(Screen) END; END Write; PROCEDURE WriteString (Str : ARRAY OF CHAR); BEGIN FileSystem.WriteString(Screen, Str) END WriteString; PROCEDURE WriteLn; BEGIN Write(EOL) END WriteLn; BEGIN mustagain := FALSE; oldch := 0C; Keyboard := File(Base_iob); (* stdin *) Screen := File(VAL(LONGINT, Base_iob) + 14D) (* stdout *) END Terminal. 0707070000020076231006440001460001440000010424230427416055200003500000004534/usr/local/lib/mod2/Makefile.SUFFIXES: .def .sym .imp .o # # Destinations for symbol files and the library archive # SYMDEST = /usr/local/lib/mod2 LIBDEST = /usr/lib # # Name of the library archive # LIBRARY = libmod2.a # # Flags to mod2 for compiling library source # M2DEFFLAGS = M2IMPFLAGS = # # Symbol files produced by compilation of the definition modules # SYMFILES = Arguments.sym CLibrary.sym Clock.sym Conversion.sym Coroutine.sym \ ErrorHandl.sym FileInform.sym FileSystem.sym InOut.sym M2System.sym \ MathLib0.sym Storage.sym Strings.sym Terminal.sym Procs.sym # # COFF files produced by compilation of the implementation modules # OBJECTS = Arguments.o Clock.o Conversions.o Coroutine.o ErrorHandlin.o \ FileInformat.o FileSystem.o InOut.o M2System.o \ MathLib0.o Storage.o Strings.o Terminal.o Procs.o # # The beast we are really interested in # ${LIBRARY}: ${OBJECTS} ar r $@ $? # # Transformation rules # .def.sym: mod2 ${M2DEFFLAGS} $< .imp.o: mod2 ${M2IMPFLAGS} $< # # Appropriate definition and implementation module dependencies # Arguments.o: Arguments.sym Arguments.imp CLibrary.sym ErrorHandl.sym \ M2System.sym Strings.sym Clock.sym: CLibrary.sym Clock.o: Storage.sym Clock.sym Clock.imp Conversions.o: Conversion.sym Conversion.imp InOut.sym Strings.sym \ CLibrary.sym ErrorHandl.sym mod2 ${M2IMPFLAGS} Conversion.imp Coroutine.o: Coroutine.sym FileSystem.sym: CLibrary.sym FileSystem.o: FileSystem.sym CLibrary.sym FileSystem.imp Strings.sym ErrorHandlin.o: ErrorHandl.sym ErrorHandl.imp FileSystem.sym mod2 ${M2IMPFLAGS} ErrorHandl.imp FileInform.sym: CLibrary.sym FileInformat.o: FileInform.sym FileInform.imp Storage.sym FileSystem.sym mod2 ${M2IMPFLAGS} FileInform.imp M2System.o: M2System.sym M2System.imp Terminal.sym CLibrary.sym MathLib0.o: MathLib0.sym MathLib0.imp InOut.sym Conversion.sym Procs.o: Procs.sym Coroutine.sym Storage.sym InOut.sym \ ErrorHandl.sym CLibrary.sym Storage.o: Storage.sym Storage.imp CLibrary.sym ErrorHandl.sym Strings.o: Strings.sym Strings.imp Strings.sym: CLibrary.sym InOut.sym: FileSystem.sym InOut.o: InOut.sym InOut.imp Conversion.sym Terminal.sym Strings.sym \ FileSystem.sym Terminal.o: Terminal.sym Terminal.imp FileSystem.sym # # Installation and cleanup scripts # install: ${LIBRARY} ${SYMFILES} cp ${SYMFILES} ${SYMDEST} cp ${LIBRARY} ${LIBDEST} clean: rm -f ${SYMFILES} ${OBJECTS} ${LIBRARY} 0707070000020037620407550001460001440000020401010425331555500003000000000000/usr/local/lib/mod2/doc0707070000020037631006440001460001440000010400610425331511000003700000010100/usr/local/lib/mod2/doc/mod2.1.TH MOD2 1 "May 10, 1988" "UNIX Version 3.5" .SH NAME mod2 \- Modula-2 compiler .SH SYNOPSIS .B mod2 [ .I -rfvc ] [ .I "-o outfile" ] filename [ .I ... ] .SH DESCRIPTION .B Mod2 is a one-pass Modula-2 compiler for the AT&T Unix PC. It compiles the .I filename argument, leaving the executable object code in a file named .I a.out if it does not detect any syntax errors. If .B mod2 detects a syntax error, the offending source line is displayed on stdout (your terminal screen by default), followed by a brief description of the error. .PP .B Mod2 handles several types of files. Regular ASCII text files can contain Modula-2 definition, implementation, or program module source. The compiler also handles Common Object File Format (COFF) object files (see \f2a.out\f1(4)) which are the result of a separate compilation either by .B mod2, the C compiler, .IR cc (1), or the assembler, .IR as (1) (these must have a ".o" extension). Modula-2 source files are given to the compiler for syntax checking and code generation, while object files are simply passed on to .IR ld (1) for the link editing phase. Compiling a definition module produces a "symbol file" in the current directory. This is used by any program that imports this module. Compiling an implementation module produces an unlinked COFF file and compiling a program module produces a linked, executable COFF file which can be executed to run the program. .PP Valid options and their meaning are: .IP \f3\-r\f1 5 Generate code to perform range/index checks at run-time. This detects errors such as attempting to reference a non-existent element of an array, or assigning to a subrange type variable a value outside its range. The error message produced is: \f2Index/Range error or arithmetic overflow/underflow at address 0x000?????.\f1 The address printed is the program counter of the machine instruction that caused the error. You can use .IR adb (1) to try to relate this to a source file line number (this is not easy, though). Default is .IR off . .IP \f3\-f\f1 5 Generate code to perform run-time arithmetic overflow checks. This is caused by performing an arithmetic operation that results in a value larger or smaller than the maximum value for that type. For example, an integer result larger than MAX(INTEGER), which is 32,767, will cause an error if this option is used. The error message produced is: \f2Index/Range error or arithmetic overflow/underflow at address 0x000?????.\f1 Default is .IR off . .IP \f3\-v\f1 5 Verbose. Print messages on stdout about the progress of the compilation. Default is .IR off . Note that the compiler is completely silent unless this option is on, or there is a syntax error. If you just get the Unix prompt back, then the compilation was successful. .IP \f3\-c\f1 5 Suppress the link editing phase. The unlinked object file produced by .B mod2 will be left in a file with a name consisting of at most the first 12 characters of the module name (NOT necessarily the source file name) with a ".o" extension. This is only applicable to program modules. .IP "\f3\-o\f2 filename\f1" 5 Put the executable object file which results from a successful compilation in a file with the name .IR filename . This does NOT apply to symbol files created by compiling a definition module. .SH FILES .nf /usr/local/lib/mod2/*.sym Symbol files for library modules /usr/local/lib/mod2/*.def Definition modules for included libraries /usr/lib/libmod2.a Archive for included libraries *.mod Program module source *.def Definition module source *.sym Symbol file (compiled definition module) *.imp Implementation module source .fi .SH "RETURN STATUS" .B Mod2 returns an exit status of 0 if compilation and linking finishes successfully. If there are syntax errors, or the link editing fails, then the exit status is 1. .SH "SEE ALSO" ld(1), as(1), ar(1) .br adb(1) .br a.out(4), /usr/include/a.out.h .br .IR "Modula-2 on the AT&T Unix PC" , CIS Dept., Kansas State Univ. .br .IR "How to Use the AT&T Unix PC" , CIS Dept., Kansas State Univ. .br .IR "Programming in Modula-2" , 3rd, corrected ed., by Niklaus Wirth. Springer-Verlag, 1985. 0707070000020062231006440001460001440000010557420425331510600004300000014057/usr/local/lib/mod2/doc/builtin.tr.nh .de hd .sp 0.75i .. .de fo 'bp .. .wh 0 hd .wh -0.75i fo .de np .sp .ti -0.5i .ft 3 .ne 1i .. .sp 1.0i .po 0.75i .ll 6.5i .ce 5 .ft 3 PREDEFINED PROCEDURES AND FUNCTIONS .ft 2 in the .ft 3 One-Pass Modula-2 Compiler .ft 2 for the .ft 3 AT&T Unix PC .ft 1 .sp This document describes the predefined procedures available with \f2mod2\f1 to operate on the standard types. Since these routines are built into the language, they do not have to be imported from another module. See the document \f2Data Types and Representation in the One-pass Modula-2 Compiler for the AT&T Unix PC\f1 for a description of the standard types available with this compiler. .sp The following procedures and functions are defined in this implementation of Modula-2: .in +0.5i .np PROCEDURE ABS(\f2x\f3: \f2Type\f3): \f2Type\f3; .ft 1 .br Return the absolute value of \f2x\f1. The type of the result is the same type as \f2x\f1. \f2Type\f1 may be any type that can have a negative value, namely INTEGER, LONGINT, REAL, or LONGREAL. .np PROCEDURE CAP(\f2ch\f3: CHAR): CHAR; .ft 1 .br If \f2ch\f1 is a lower case letter, then the corresponding capital letter is returned. If \f2ch\f1 is a capital letter, then the same letter is returned. .np PROCEDURE CHR(\f2x\f3: \f2Type\f3): CHAR; .ft 1 .br Return the character which has the ordinal value \f2x\f1. \f3CHR(\f1x\f3)\f1 is equivalent to \f3VAL(CHAR, \f1x\f3)\f1. For example, \f3CHR(65)\f1 returns "A", and \f3CHR(97)\f1 returns "a". \f2Type\f1 may be any scalar type: BOOLEAN, CHAR, CARDINAL, INTEGER, enumerated, subrange, LONGCARD, or LONGINT. .np PROCEDURE DEC(VAR \f2x\f3: \f2Type\f3); .ft 1 .br Decrement \f2x\f1 by 1. \f2Type\f1 may be any scalar type: BOOLEAN, CHAR, CARDINAL, INTEGER, enumerated, subrange, LONGCARD, or LONGINT. .np PROCEDURE DEC(VAR \f2x\f3: \f2Type1\f3; \f2n\f3: \f2Type2\f3); .ft 1 .br Decrement \f2x\f1 by \f2n\f1. \f2Type1\f1 may be any scalar type: BOOLEAN, CHAR, CARDINAL, INTEGER, enumerated, subrange, LONGCARD, or LONGINT. \f2Type2\f1 may be an INTEGER, LONGINT, CARDINAL, or LONGCARD. .np PROCEDURE EXCL(VAR \f2s\f3: \f2Type1\f3; \f2i\f3: \f2Type2\f3); .ft 1 .br Remove the element \f2i\f1 from set \f2s\f1. In set notation, s := s - {i}. \f2Type1\f1 is any \f3SET\f1 type. \f2Type2\f1 is any legal member of \f2Type1\f1. .np PROCEDURE FLOAT(\f2x\f3: \f2Type\f3): REAL; .ft 1 .br Return the value of type REAL that corresponds to the integral value \f2x\f1. For example, \f3FLOAT(4)\f1 = 4.0. \f2Type\f1 can be an INTEGER, CARDINAL, or LONGINT. .np PROCEDURE FLOATD(\f2x\f3: \f2Type\f3): LONGREAL; .ft 1 .br Return the value of type LONGREAL (64-bit float) that corresponds to the integral value \f2x\f1. For example, \f3FLOAT(4D)\f1 = 4.0. \f2Type\f1 can be an INTEGER, CARDINAL, or LONGINT. .np PROCEDURE HALT; .ft 1 .br Halt execution of the program. A termination message of the following form is printed before the program exits: .sp 0.1i .ti +1i .ft 2 Program Halted at address 0x000?????. .ft 1 .sp 0.1i The address displayed is the address of the machine instruction that called \f3HALT\f1. The exit status of the program is set to 1. .np PROCEDURE HIGH(\f2a\f3: ARRAY OF \f2Type1\f3): \f2Type2\f3; .ft 1 .br Return the upper index bound of array \f2a\f1. For example, if \f2a\f1 was declared as \f3ARRAY [0..9] OF CHAR\f1, then \f3HIGH(\f1a\f3)\f1 would return 9. The type of the value returned corresponds to the type of the array index, or \f3CARDINAL\f1 if it is referencing a dynamic array. \f2Type1\f1 can be any legal type identifier. .np PROCEDURE INC(VAR \f2x\f3: \f2Type\f3); .ft 1 .br Increment \f2x\f1 by 1. \f2Type\f1 may be any scalar type: BOOLEAN, CHAR, CARDINAL, INTEGER, enumerated, subrange, LONGCARD, or LONGINT. .np PROCEDURE INC(VAR \f2x\f3: \f2Type1\f3; \f2n\f3: \f2Type2\f3); .ft 1 .br Increment \f2x\f1 by \f2n\f1. \f2Type1\f1 may be any scalar type: BOOLEAN, CHAR, CARDINAL, INTEGER, enumerated, subrange, LONGCARD, or LONGINT. \f2Type2\f1 may be an INTEGER, LONGINT, CARDINAL, or LONGCARD. .np PROCEDURE INCL(VAR \f2x\f3: \f2Type1\f3; \f2i\f3: \f2Type2\f3); .ft 1 .br Include the element \f2i\f1 in set \f2s\f1. In set notation, s := s + {i}. \f2Type1\f1 is any SET type. \f2Type2\f1 is any legal member of \f2Type1\f1. .np PROCEDURE MAX(\f2Type\f3): \f2Type\f3; .ft 1 .br Return the maximum value of type \f2Type\f1. For example, \f3MAX(INTEGER)\f1 returns 32,767, and \f3MAX(CARDINAL)\f1 yields 65,535. \f3MAX\f1 is not defined for type LONGREAL. .np PROCEDURE MIN(\f2Type\f3): \f2Type\f3; .ft 1 .br Return the minimum value of type \f2Type\f1. For example, \f3MIN(INTEGER)\f1 returns -32,767, while \f3MIN(CARDINAL)\f1 = 0; \f3MIN\f1 is not defined for type LONGREAL. .np PROCEDURE ODD(\f2x\f3: \f2Type\f3): BOOLEAN; .ft 1 .br Return whether or not \f2x\f1 has an odd value. \f3ODD(\f1x\f3)\f1 is equivalent to x \f3MOD\f1 2 \f3<>\f1 0. \f2Type\f1 is restricted to INTEGER, CARDINAL, LONGINT, LONGCARD, or ADDRESS. .np PROCEDURE ORD(\f2x\f3: \f2Type\f3): CARDINAL; .ft 1 .br Return the ordinal number of \f2x\f1 in the set of values defined by type \f2Type\f1. For example, \f3ORD('\f1a\f3')\f1 returns 97, and \f3ORD('\f1A\f3')\f1 returns 65. \f2Type\f1 may be any scalar type: BOOLEAN, CHAR, CARDINAL, INTEGER, enumerated, subrange, LONGCARD, or LONGINT. .np PROCEDURE SIZE(\f2x\f3: \f2Type\f3): CARDINAL; .ft 1 .br Returns the number of bytes required to store variable \f2x\f1. \f2Type\f1 can be any legal type identifier. .np PROCEDURE TRUNC(\f2r\f3: REAL): CARDINAL; .ft 1 .br Return the integral part of the truncation of the single-precision float number \f2r\f1. For example, \f3TRUNC(\f12.7\f3)\f1 returns 2. .np PROCEDURE TRUNCD(\f2r\f3: LONGREAL): LONGCARD; .ft 1 .br Return the integral part (LONGINT type) of the truncation of the double-precision float number \f2r\f1. .np PROCEDURE VAL(\f2Type1\f3; \f2x\f3: \f2Type2\f3): \f2Type1\f3; .ft 1 .br Return the value \f2x\f1 converted to type \f2Type1\f1. This is the same as the type transfer functions available in Modula-2. Consequently, \f3VAL(CARDINAL, \f2x\f3)\f1 is the same as \f3CARDINAL(\f2x\f3)\f1. \f2Type1\f1 and \f2Type2\f1 can be any legal type identifier. 0707070000020034411006440001460001440000010407640425331510600004300000021622/usr/local/lib/mod2/doc/datarep.tr.nh .de hd 'sp 0.75i .. .de fo 'bp .. .wh 0 hd .wh -0.75i fo .de np .sp .ti -0.5i .ft 3 .ne 1i .. .sp 1.0i .po 0.75i .ll 6.5i .ce 5 .ft 3 DATA TYPES AND THEIR REPRESENTATION .ft 2 in the .ft 3 One-Pass Modula-2 Compiler .ft 2 for the .ft 3 AT&T Unix PC .ft 1 .sp This document describes all the data types available with \f2mod2\f1, along with information on how these types are represented internally. The CPU of the AT&T Unix PC is Motorola Corporation's MC68010. Thus, data representation follows the limitations of this 16/32-bit processor. For example, a "word" of memory in the MC68010 processor occupies 16 bits (two 8-bit bytes), while a 32-bit item is called a "long word." Since the MC68010 is not a full 32-bit microprocessor, machine instructions are not available for all 32-bit arithmetic operations. As a consequence, the basic types \f3INTEGER\f1 and \f3CARDINAL\f1 occupy 16 bits instead of 32 bits. Considering the extreme limitations of 16-bit data types, this implementation of Modula-2 provides 32-bit signed and unsigned integer data types, \f3LONGINT\f1 and \f3LONGCARD\f1, respectively. However, some of the arithmetic operations (namely multiplication and division) have to be implemented in software so performance is sacrificed. .sp Floating point arithmetic is also implemented in software since the Unix PCs do not employ a floating point processor. This compiler provides both single (32-bit) and double (64-bit) precision floating point with the types \f3REAL\f1 and \f3LONGREAL\f1, respectively. Representation is based on the IEEE floating point standard. .sp The following data types are defined in this implementation of Modula-2: .in +0.5i .np BITSET .ft 1 .br Occupies one word of memory. Members of this type map directly into the bits of the word in memory occupied by a variable of this type. In the MC68010 processor, bits are numbered 0 to 15 from right to left, with bit 15 being the most significant bit. .np BOOLEAN .ft 1 .br Occupies one byte. This type could be represented as an enumerated type: .sp 0.1i .ti +0.75i \f3TYPE BOOLEAN = (FALSE, TRUE);\f1 .sp 0.1i since \f3FALSE = CARDINAL(0)\f1 and \f3TRUE = CARDINAL(1)\f1. .np CARDINAL .ft 1 .br Occupies one word, representing an unsigned integer. Since it occupies only 16 bits, the maximum value is 2\u\s-2\&16\s+2\d - 1. \f3MAX(CARDINAL)\f1 = 65535. \f3MIN(CARDINAL)\f1 = 0. .np CHAR .ft 1 .br Occupies one byte for ASCII character representation. Since the MC68010 cannot handle odd addresses, a variable of this type may actually occupy a full word of the stack or data segment. Arrays with an elemental type of \f3CHAR\f1 will pack 2 characters into a word, but the overall space occupied by the array will be word-aligned. In other words, if the array has an odd number of characters in it, the compiler will allocate an extra byte to guarantee that the array is word-aligned. .np INTEGER .ft 1 .br Occupies one word, representing a signed integer. Since it only occupies 16 bits, with one of those bits being the sign bit (bit 15), the maximum value is 2\u\s-2\&15\s+2\d - 1. \f3MAX(INTEGER)\f1 = 32767. \f3MIN(INTEGER)\f1 = -32767. .np LONGCARD .ft 1 .br Occupies two memory words (one long word), giving a 32-bit representation of non-negative integers. \f3MAX(LONGCARD)\f1 = 4,294,967,295 = 2\u\s-2\&32\s+2\d - 1. \f3MIN(LONGCARD)\f1 = 0. .np LONGINT .ft 1 .br Occupies two memory words (one long word), giving a 32-bit representation of signed integers. \f3MAX(LONGINT)\f1 = 2,147,483,647 = 2\u\s-2\&31\s+2\d - 1. \f3MIN(LONGINT)\f1 = -2,147,483,648. Bit 31 (left-most) is the sign bit. .np LONGREAL .ft 1 .br Occupies four words (two long words) to give 64-bit double precision floating point representation. Bits in this four-word type are numbered 0 to 63 from right to left. Bit 63 is the sign bit. Bits 52 through 62 represent the exponent biased by 1023, and bits 0 through 51 represent the fractional component. \f3MIN\f1 and \f3MAX\f1 are not defined for this data type, although the values the emulator can handle range from -1.797693E+308 to 1.797693E+308. .np PROC .ft 1 .br Occupies two words (one long word). When given an appropriate value, its contents are interpreted as the address of the first instruction of the subroutine it represents. .np REAL .ft 1 .br Occupies two words (one long word), representing a 32-bit single precision floating point number. Bits are numbered 0 to 31 from right to left. Bit 31 is the sign bit. Bits 23 through 30 hold the exponent, and bits 0 to 22 hold the fractional part. \f3MAX(REAL)\f1 = 1.701412E+38. \f3MIN(REAL)\f1 = -1.701412E+38. .np ARRAY \f2Types .ft 1 .br The amount of storage occupied by an array depends on its base type. You can determine the amount by multiplying the number of elements in the array by the size of the base type, then rounding up to the nearest even number (to ensure word-alignment). .np RECORD \f2Types .ft 1 .br The amount of memory occupied by a record depends on the size and number of its fields. Each field will occupy the amount of space its base type requires, modified by the constraint that fields are word-aligned. Thus, if a field uses an odd number of bytes, an extra byte will be allocated to ensure that the next field is word-aligned. CHAR and BOOLEAN types, which normally occupy just 1 byte, are handled differently. More than 1 ADJACENT field of EITHER of these types will be packed together so that each field only occupies one byte. The compiler just guarantees that the field immediately following the block of adjacent byte-sized fields will be word-aligned. Some of the CHAR and/or BOOLEAN fields will actually fall on an odd boundary. An illustration is in order. Consider the following array: .sp 0.1i .in +0.75i .ft 3 .TS l l l. TYPE rectype = RECORD c1, c2: CHAR; b1: BOOLEAN; c3: CHAR; i1: INTEGER; r1: REAL; END; .TE .ft 1 .in -0.75i .sp 0.1i The fields with their alignments are as follows: .sp 0.15i .ps 8 .vs 10p .TS c c c c c c c c c c | c | c | c | c | c s | c s s s |. byte1 byte2 byte3 byte4 byte5 byte6 byte7 byte8 byte9 byte10 = c1 c2 b1 c3 i1 r1 = .TE .sp 0.15i .ps 10 .vs 12p Fields are stored at contiguous successive locations in memory. A pointer to a record holds the address of the first field in the record. .np .ft 2 Enumeration Types .ft 1 .br Occupies one BYTE of memory (although if included in a structured type such as a record, it will be word-aligned). The first value of the enumeration has a value of 0, the second 1, the third 2, and so on. Since the type only occupies one byte, the maximum number of constants in an enumeration is 256 (numbered 0 through 255). .np .ft 2 Subrange Types .ft 1 .br Subranges are stored in the same manner as their base type. For example, an subrange of integers such as [0..99] occupies one word. .np SET \f2Types .ft 1 .br Occupies one word of memory. As a consequence, a SET type can have at most only 16 elements. This is an unfortunate restriction since it does not permit a type \f3SET OF CHAR\f1. An element \f2e\f1 is considered to be a member of a set if the \f2e\f1\u\s-4th\s+4\d bit in the set has a value of 1. If the bit is clear (0), then \f2e\f1 is not a member of the set. Again, bits are numbered 0 to 15 from right to left. .np POINTER \f2Types .ft 1 .br Occupy two memory words, representing a 32-bit address in memory. \f3NIL\f1 is a constant that represents a pointer with an undefined value, \f2i.e.\f1, it points to nothing. The contents of a pointer with a value of \f3NIL\f1 is 0. No run-time checks are performed to prevent dereferencing of a \f3NIL\f1 pointer. Such action will simply produce unpredictable results. The procedure \f3ALLOCATE\f1 from module \f3Storage\f1 is used to allocate space for a new instance of a pointer type. Pointer types are compatible with types \f3ADDRESS\f1 and \f3LONGINT\f1, although the latter type is not assignment compatible. .in 0 .sp 2 The following three types are not defined as part of the language, but instead are available from the built-in pseudo-module \f3SYSTEM\f1. If you want to use any of the following three types, you must import them. For example: .sp 0.1i .ti +0.5i .ft 3 FROM SYSTEM IMPORT BYTE, WORD, ADDRESS; .ft 1 .sp 0.1i The data types and their representations are: .in +0.5i .np BYTE .ft 1 .br Occupies one byte of memory, representing the smallest addressable unit in memory. The contents are uninterpreted. One of the key uses of this type is for a generic open array parameter: \f3ARRAY OF BYTE\f1 is compatible with EVERYTHING (note that most other implementations use \f3ARRAY OF WORD\f1 for this purpose). .np WORD .ft 1 .br Occupies one uninterpreted word of memory beginning at an even address. It is compatible with all types which have a size of two bytes, so it is often used as a generic formal parameter. .np ADDRESS .ft 1 .br Occupies two words of memory (one long word), representing a word-aligned memory address. Its type is \f3POINTER TO BYTE\f1. It is compatible with \f3LONGINT\f1 as well as all pointer types. 0707070000020035541006660001460001440000010401000425331511000004200000121343/usr/local/lib/mod2/doc/howto.upc.de sh .sp 2 .ne 1i .. .ds tt '''p. %' .de hd 'sp 2 .ft 1 .if \\n%>1 .tl \\*(tt .el .sp .ft 'sp .. .wh 0 hd .wh -4 fo .de pp .sp .ne 5 .ti +0.25i .. .ll 6.5i .po 1.0i .lt 6.5i .ds U U\s-2NIX\s+2 .de fo 'sp 2 .ft 1 .tl '\u*\d\*U is a trademark of AT&T Bell Laboratories''' .ft 'bp .. .nh .ft 3 .ce 3 HOW TO USE THE AT&T \*U\u*\d PC .sp \f2Dept. of Computing and Information Sciences Kansas State University\f1 .sp \f3Introduction\f1 .pp This document is designed to help you use the AT&T \*U PC workstation for work in your Computing and Information Sciences (CIS) classes. The \*U PC has many features which promote its use in a variety of roles: it functions well as a standalone computer, as a multiuser micro, as a client or server system on a local area network, or as a terminal connected to a host minicomputer. These features that help make it so versatile include a high-resolution graphics display screen, a mouse pointing device, a window/menu-based user interface, an internal modem, floppy and hard disk drives, paged memory, and, of course, the \*U operating system. Each \*U PC in the CIS department has one 40 Mbyte hard disk, three RS-232 ports, 2 Mbytes of main memory, and a STARLAN local area network interface. This configuration is known as a model 3B1 \*U PC (smaller configurations are called model 7300). .pp Since the \*U PCs have a Modula-2 compiler, they will be used by all the undergraduate courses which use Modula-2. This includes Algorithmic Processes (CMPSC300), Operating Systems (CMPSC520), and Data Structures (CMPSC560). Furthermore, many of the \*U PCs in the labs are connected to the CIS department Equinox data switch. They can therefore be used as terminals on any of the CIS minicomputers. This document will describe how to interact with the \*U PC, how to use it as a terminal on a host minicomputer, how to use utilities such as the Modula-2 compiler, how to get printouts, and how to use the floppy disk drive to make your own backups. So that you can "learn by doing", it would be best if you sit down at a \*U PC and try the things described below as you read about them. .sh \f3Where Are They?\f1 .pp The CIS department has \*U PCs for general student use located in three different labs. Rooms 126 and 128 in Nichols Hall have 12 and 10 \*U PCs, respectively. Fairchild 117 also has 10 \*U PCs. The Nichols Hall labs are open from 6am to 10pm, Monday through Saturday, and from 10am to 10pm Sunday. The Fairchild lab is open 24 hours/day, 7 days a week. Several \*U PCs are also scattered around in graduate student and faculty offices. These are not for general student use, however. .pp All the \*U PCs in the labs are connected to the CIS department STARLAN network. You can use this network for remote logins, file transfer, and print service, but that will not be explained here. The systems in Nichols 126 and Fairchild 117 also have a serial port connected to the CIS department Equinox data switch. You can therefore use these systems as terminals on any of the CIS department minicomputers. This connection can also be used for transferring files. However, you must first learn how to login on the system, before any of these other features are explained. .sh \f3Logging In and the Office Environment\f1 .sp \f2Logging In\f1 .pp Each \*U PC in the labs is set up with a generic account with a login name \f2student\f1. When you sit down at a \*U PC, the screen may be blank even though the power is on. This is due to the \*U PCs being equipped with a "screen saver" feature which causes the screen to go blank after 10 minutes or so. Moving the mouse will turn the screen back on. You should then see the following login prompt: .sp .nf .ne 1i .in +0.5i .ft 3 Welcome to the AT&T UNIX pc Please login: .fi .ft 1 .de fo 'bp .. .sp .in -0.5i You can now type "student" followed by a \f2Return\f1 to log in. The system should NOT prompt you for a password. If it does, just press \f2Return\f1 and try to login as "student" again. Be careful not to make any mistakes when typing the login name. If it continues to ask you for a password, tell one of the persons listed below under the section titled "Who Do I Contact About Problems?" so they can remove the password. In the mean time, move to a different machine and login there. .pp If you find a \*U PC that has the power turned off, go ahead and turn it back on (the on/off rocker switch is on the back of the computer, near the top, just to the right of center). You will probably want to move a different machine to login, though, because it takes about five minutes for the system to boot. .pp When you successfully login, you will be in what is known as the \f2Office\f1. Your screen should look like this: .br .ne 5.0i .sp 5.5i \f2The Office Window\f1 .pp The screen pictured above consists of the status line along the top of the screen, and the Office window in the upper left-hand corner of the work area. The Office window displays a menu that lists the various categories of tasks you can perform in this environment. In reality, you only need to use two of the menu items for the majority of the CIS department courses: \f2Telephone\f1 and \f2Full-Screen UNIX\f1. You can use the \f2Telephone\f1 menu to connect to the CIS department data switch, and \f2Full-Screen Unix\f1 to run utilities such as the Modula-2 compiler. .pp You can choose items from a menu by moving the mouse until the small arrow points to the appropriate item, resulting in that item being highlighted. The above picture of the \*U PC Office menu, for example, shows the \f2Telephone\f1 item highlighted. You can then select that item by either pressing the left button on the mouse or pressing the \f2Enter\f1 key on the keyboard (not the \f2Return\f1 key - that has a different effect). .sp \f2Window Icons\f1 .pp Before we move on, we should describe some of the other features in the office window (and most other windows, for that matter). Notice the small \f2icons\f1 (pictures that illustrate an action) in each corner of the border around the office window. Each of these has a specific function. The one in the upper left corner that has 2 arrows opposite of each other in a small box is called the \f2Window Move\f1 icon. This allows you to move the window around on the screen. You are free to rearrange windows in the work area however you like. To do this, move the mouse so that the tip of the pointer arrow on the screen is in that box. Then press the left button on the mouse and hold it down while you move the mouse to "drag" the window to the desired location. When the window is located where you want it, simply release the left mouse button. The window will stay at that spot. .pp You will notice that the icon in the lower right corner of the window also has two arrows in it. This icon is used for reshaping the window, and is called the \f2Window Shape\f1 icon. To reshape the window, move the pointer to that icon, then press the left button of the mouse without letting go. While still pressing the mouse button, move the pointer around to get the desired size. The upper left corner of the window will remain anchored while you do this. .pp The icon in the upper right corner (box with a question mark in it) is called the \f2Help\f1 icon. As you might expect, this icon will give you information about items listed in that window. In some cases, you will get information about the item currently highlighted in the menu. For example, the following figure is the result of selecting the help icon of the office window when \f2Telephone\f1 is highlighted. .br .bp In other cases, you may get general help information about the topic the current active window relates to. Basically, if you are unsure about something related to the current window, select the \f2Help\f1 icon to see if you can find an answer there. If the answer is not there, you should consult the manuals. .pp Bringing up the help window pictured above revealed two more icons along the lower right border. These two fat arrows are called the \f2Scroll\f1 icons. They only appear if the entire file will not fit in the window. They can be used to scroll through the contents of the window. Selecting the up arrow moves you up towards the beginning of the file, while selecting the down arrow moves you towards the end. The distance you move in the file is determined by which button on the mouse you press while pointing to a scroll icon determines how far you scroll. The left button just scrolls a few lines at a time. Pressing the middle button moves a page at a time. The right button jumps to the beginning or end of the file displayed in the window, depending on if you are pointing to the up or down arrow, respectively. .pp Finally, the icon in the lower left corner is known as the \f2Exit\f1 icon. When you select this icon, the window is closed. This means that it will disappear from the screen. Only do this, of course, when you are finished using that window. Be aware that closing the office window will log you out. However, it will only do this if no other windows are open and after you confirm that you really want to logout. .sh \f3Working With Windows\f1 .pp Now that we have introduced you to the window icons and using the mouse, let's briefly discuss how to work with windows. The AT&T \*U PC Owner's Manual defines a window as a "section of the screen surrounded by a border and containing a portion of your work or information necessary to perform your work." You can have more than one window open at any time, but you will only have one \f2active\f1 window. The \f2active\f1 window is the one on top with the highlighted border. Most of the commands you enter will have their effect on this window. The analogy of the multi-window work area is that of a desk top with piles of papers. The paper on top is the one you are working on at the moment (this is analogous to the \f2active\f1 window). Parts of other papers below it may be showing, but you typically will not be working on them. When you want to work on something else, you move that paper to the top. In the \*U PC, you do this by changing the \f2active\f1 window. .pp You can select a new \f2active\f1 window in several ways. The easiest way is to simply move the pointer arrow to any portion of that window that is showing and press the left mouse button. This window will then be brought to the top (so that no other window is covering any part of it) and its border highlighted. It is possible, however, that the window you want to start working on is completely covered up by other windows on top of it. You therefore cannot just "point and click." This is where the \f2Window Manager\f1 icon comes into use. In the far upper right-hand corner of your screen (actually the farthest right icon in the "status line") is a small box with a \f3W\f1 in it. This is the \f2Window Manager\f1 icon. If you move the pointer to this box and press the left mouse button, a menu will appear in the upper right-hand corner that lists all the windows currently open in your work area, including any that are completely covered up. You can now simply select from this menu the window you want, and it will become the \f2active\f1 window. Note that you can also get this same menu of open windows by pressing the \f2Rsume\f1 key in the upper right hand corner of the keyboard. .sh \f3Using the Telephone Manager\f1 .pp Now that you know how to manipulate windows and use the mouse, let's describe how to do some constructive work. As mentioned earlier, you can use the \*U PC as a terminal on one of the CIS department minicomputers by utilizing the serial connection to the Equinox data switch. This is accomplished via the \f2Telephone Manager\f1, which is accessed by selecting the \f2Telephone\f1 entry in the Office menu. When you select this, you get what is known as the \f2Call Screen\f1. Your screen will look like this: .br .ne 5.5i .sp 5.5i All you have to do to connect to the data switch is select the \f2dataswitch\f1 entry in the call screen. Once the work area on the screen goes blank, you are connected. Now you can press the \f2Return\f1 key to get the prompt from the data switch that looks like this: .sp .nf .ft 3 .in +.5i DSS::XXX KSU Dept. of Computing & Information Sciences Select Destination: .in -.5i .sp .fi .ft 1 You can now select the system you want to login on, and use the \*U PC the same way you would use regular terminals. Of course, you have to know the terminal type when asked during the login process on the minicomputer you are connected to. Going through the telephone manager's call screen, you are emulating a DEC VT100 terminal. Therefore, when you get the prompt asking for your terminal type, enter "vt100". .pp While you are logged in on a minicomputer in this way, you can easily go back to a different window to work locally on your \*U PC. All you have to do is select the \f2Window Manager\f1 icon in the upper right hand corner as described earlier, and open the window you want to work in. You will remain connected through the data switch while you do this. You can then easily jump back to the data switch connection by either moving the pointer to a part of the screen that shows the connection and press the left mouse button, or go back to the window manager menu and select the window titled \f2Asynch Emulator\f1. .pp When you are done working on a minicomputer through the data switch, go ahead and logout of that minicomputer. This gets you back to the data switch, but does not exit the asynchronous terminal emulator (the program in the telephone manager that controls the communications through the serial port to the data switch). You can then login on a different system if you want. If you are completely done, then press \f2Shift-Exit\f1 (hold the shift key down, and tap the \f2Exit\f1 key down, which is in the upper right-hand corner of the keyboard). This will get you back to the \f2Call Screen\f1 window. .sh \f3Using "Full-Screen UNIX"\f1 .sp \f2Invoking the shell\f1 .pp There are two ways to run an interactive command interpreter, known as the \f2shell\f1, on the \*U PC. One is through a window with a border, accomplished by selecting \f2UNIX System\f1 from the office menu. When you get the prompt from the shell (a dollar sign, "$"), you can enter regular \*U commands to do your work. You can open more than one of these \*U windows at a time, so it is a convenient way to execute several commands simultaneously. For example, you can run a large CPU-intensive program in one window while using the editor interactively in another window. The drawback to running the shell in a bordered window is that you do not get the full 23 lines and 80 columns on the screen that you are used to working with on regular data terminals. Depending on how you shape your windows, you can only get at most 18 lines and 76 columns. .pp The other way to run a shell is to select \f2Full-Screen UNIX\f1 from the office menu. Instead of giving you a window with a border, this runs a shell in a borderless window that takes up the entire screen. This way, you get a full 23-line by 80 column work area. This window is listed as \f2Unknown Contents\f1 in the \f2Window Manager\f1 menu. I think you will find it best to do your editing and compiling in this environment since it allows you to view a larger amount of information at one time. Since running \*U in this way takes up the entire screen, any other windows you have open will be covered up. You just need to use the window manager to bring a hidden window to the top (see the section titled "Working With Windows" for a description of how to do this). This .sp \f2Terminating the shell\f1 .pp Whether your shell is running in a window with a border or on the full screen, you terminate it by pressing Ctrl-D (hold the \f2Ctrl\f1 key down and press \f2D\f1). This must be the first thing you type on a new line (when you have the "$" prompt). This signals the shell that you are done entering commands, so it closes the window and returns you to the office menu. .sp \f2Interrupting a command\f1 .pp Sometimes it is necessary to stop the execution of a program before it terminates normally. This could occur when you start a program and decide later that it was not what you wanted to run. Another possibility is starting a program that has an infinite loop in it. If you start such a program, it may appear to be doing nothing since the cursor may just sit there. The only symptom is that you never get the shell prompt (a "$") back. A good clue that you have an infinite loop is that an icon will appear in the lower right corner of the screen which has enclosed in a box the AT&T symbol along with the word "working". This means the CPU is busy running something. If this icon does not go away, and you never get your prompt back, then you probably have an infinite loop. In either case, you can abort the running process by pressing the \f2Del\f1 key. This is the shift of the \f2Esc\f1 key in the upper left corner of the keyboard. .pp It is possible for a program to disable this interrupt, though. If pressing \f2Del\f1 does not kill the process (the "working" icon stays lit and you still do not get the shell prompt), then try "Ctrl-\\" (hold the \f2Ctrl\f1 key down and press the backslash, "\\"). This sends a different type of signal to the process, which usually will kill it. .sp \f2Using the Korn shell - "ksh"\f1 .pp There are several popular command interpreters available with the \*U operating system. One is known as the "Bourne shell", named after its author, another is "C shell" named after its C-like syntax, and another is the "Korn shell", again named after its author, David Korn. The \*U PCs in the CIS department have been set up to use the Korn shell, or \f2ksh\f1, by default. Thus, whenever you open a new \*U window, you will run \f2ksh\f1. .pp \f2Ksh\f1 has many useful features that we will not describe in this document (such as aliases and job control). We refer you to the AT&T \*U PC System V User's Manual, section 1, for more information about these and other features of \f2ksh\f1. There is one feature worth mentioning, though, since it will make your work much easier. This is the \f2history\f1 mechanism. As you execute commands in \f2ksh\f1, it keeps a record of what you have run. \f2Ksh\f1 then provides a mechanism to quickly re-execute a previous command without having to type it over again. Furthermore, it allows you to use editor commands to alter previous commands before re-executing them. You will find this extremely convenient as you jump back and forth between editing, compiling, and executing a program you are developing. .pp First of all, just typing "r" will re-execute the last command you entered. If you want to run a older command, though, then you have several options. The first option requires that you know the number of the command you want to execute again. Typing the command "history", or "h" for short, will show you a numbered list of the commands you have executed recently. You re-execute a command simply by typing "r ", where "" is the number of the desired command. .pp A second way to re-execute a command involves referencing a command by its name rather than its number. To do this, you type "r " where "" is replaced by the command name you want to run again. This way, you don't have to run "history" first to find out the number. However, this method only allows you to execute the last instance of that particular command. You have to do something different if you want to execute an older instance of that command. For example, let's say you were editing a file named "prog1.mod" with the full-screen editor, "vi". You then compiled it with the command line "mod2 -v prog1.mod", and executed the result by typing "a.out". When you run it, though, you find you have a logic error. You therefore need to go back and edit the source, re-compile it, and re-execute. You can do this quickly with \f2ksh\f1 by typing "r vi". This re-executes the most recent "vi" command, which in this case was "vi" on the file "prog1.mod". Once you make the necessary changes in the file and exit the editor, type "r mod2" to re-execute "mod2 -v prog1.mod" without having to type the whole command line again. Once it compiles properly, you can simply type "a.out" again to execute it (you could use "r a.out", but this is a waste of time since it will actually take longer than just typing "a.out"). .pp The third way to execute a command again with \f2ksh\f1 (called \f2command re-entry\f1) also allows you to modify any of the commands saved in the command history. You will find this \f2in-line editing\f1 option most useful. To perform in-line editing, you must enter \f2Vi Editing Mode\f1. Do this by pressing the \f2Esc\f1 key found in the upper left-hand corner of the keyboard. Once you do this, you are in effect editing your command history with the "vi" editor. You can view this as editing a file that has the oldest command saved at the top of the file, and the most recent command at the bottom. Pressing \f2Esc\f1 then puts you at the bottom of the file. .pp While in this mode, the command line acts as a one-line "window" into that file. You therefore use "vi" cursor movement commands to move the window to the command you want to re-enter. For example, you can use the "k" or "-" keys to display successively older commands (\f2i.e.\f1, move up in the file), and "j" or "+" to see newer ones (move down). A quicker way to find a command is to use the "/" or "?" commands to search for particular patterns. For example, if you want to re-execute a "mod2" command, enter "/mod2" to search for the last occurrence of "mod2". If that is not the one you want, press "n" to search farther back in the history for the next oldest invocation of "mod2" ("n" is short for "next"). Once you find the command you are looking for, just press \f2Return\f1 to execute it. .pp If you want to change the command, though, then you can use "vi" text modification commands to alter the command line displayed. First, use cursor movement commands such as the space bar, "w", "e", or "b" to move the cursor to the place in the command line that you want to change. You can then use "i", "a", "dw", "dW", "r", etc. to make the necessary changes, just like you would if you were editing a regular file with "vi". To see a complete list of these commands, read the manual entry for \f2ksh\f1 in the AT&T \*U PC System V User's Manual, Volume II. Once you have made all the changes you want to make to the command line, just press \f2Return\f1 to execute the modified command. Isn't this fun? .sh \f3Getting Printouts\f1 .pp The \*U PCs in the CIS department labs have access to several printers by way of the STARLAN local area network. The \*U PCs in both Nichols 126 and 128 can print on the AT&T 479 dot matrix printer in Nichols 128 by using the "lp" command. This is simple to use. All you have to do is give "lp" the name(s) of the file(s) you want to print, and it will ship the file(s) over the network to the server system to be queued for printing. For example, if you have two files named "Prog1.mod" and "Prog1.out" that you want printed, enter the following command line to have them printed in N128: .sp .1i .ti +0.5i .ft 3 $ lp Prog1.mod Prog1.out .ft 1 .sp .1i You can also use this printer to get a screen dump printed. If you want to print a reasonable duplicate of what your \*U PC screen looks like at a particular moment, hold the \f2Shift\f1 key down and press \f2Print\f1 (a key on the middle right side of the keyboard). This will again ship the screen dump over the network to be queued for printing. The figures printed earlier in this document showing the student office and other menus were printed this way. .pp The \*U PCs in Fairchild 117 also have an AT&T 479 dot matrix printer connected to them on the network. This printer is only accessible from the \*U PCs in that room. You should use "lp" the same way as described above to get printouts of files on that printer. It can also print a dump of your \*U PC screen if you like. .pp Other printers in the department are also accessible over the network. You can use these commands the same way you use "lp"; just give them the list of files to be printed. The following table summarizes the command names, locations, and types of printers available from the \*U PCs in all three labs. .sp 0.2i .ne 2.2i .TS center; c s s s lb lb lb lb l l l lf2. CIS Dept. Printers Accessible from the UNIX PCs .sp 0.12i Room Hours Model,Type Command name .br _ .br _ .sp Nichols 126 6 am-10pm, M-Sa Centronics LW/855 lprvax1 10am-10pm, Su band printer .sp 0.075i _ .sp 0.075i Nichols 128 same as Nichols 126 AT&T 479 dot matrix lp .sp 0.075i _ .sp 0.075i Fairchild 117 24 hrs, 7 days AT&T 479 dot matrix lp .sp _ .br _ .TE .sp 0.2i .sh \f3Logging Out\f1 .pp Normally, you would just log out of a \*U system, and your files would remain safely on the hard disk. This is not acceptable on the \*U PCs in the CIS department, however, since that would mean that your files are there accessible to the next person who logs in as "student". Consequently, the logout process has been modified such that \f3ALL FILES created during your login session as "student" ARE REMOVED FROM THE HARD DISK\f1. As you can see now, it is very important that you back up your files onto floppy disk \f3BEFORE YOU LOGOUT\f1. Several ways to do this are explained below. It is up to you to make sure you do this before you logout! Once you logout and the files are removed, there is no way to restore them from the hard disk. They are gone! Part of the logout process will warn you about this and ask you to confirm that you really want to logout, so you have a chance to back out if you need to. .pp When you are done working on the \*U PC, you need to log out. To do this, you must first close all windows except the Office window. If you are running \f2Full-Screen UNIX\f1, then simply type a ctrl-D (hold the \f2Ctrl\f1 key down and press the \f2D\f1). If you have any other windows open, then close them (make that window the active window, then click on the \f2Exit\f1 icon in the lower left-hand corner of of the window). When the Office window is the only one left, you can logout simply by closing this window. Again, move the pointer to the \f2Exit\f1 icon in the lower left corner of the window, then press the left mouse button or the \f2Enter\f1 key. You will be asked in a new window to confirm that you really want to log out. Press the \f2Enter\f1 key again to continue the logout process. You should then get the "Please login:" prompt again. .pp At this point, you can safely leave the computer. \f3DO NOT turn off the computer or dim the display screen\f1. Leave it running for the next person. You may damage the file system if you turn off the power. There is a specific shut down procedure that must be run before turning off the power. You should NEVER do this. You also do not need to dim the display since they are equipped with a "screen saver" that automatically turns it off. .sh \f3Using the Floppy Disk Drive\f1 .pp All the \*U PCs are equipped with a floppy disk drive located on the left front area of the computer, just below the monitor (it may be hidden if the keyboard is locked down - just move the keyboard in this case). These drives take double-sided, double-density, soft-sectored diskettes. Each one holds about 320 kilobytes of data. .pp As with any other floppy disk system, the diskettes must first be formatted. The format recognized by the \*U PC is unique to this machine. However, there are facilities for reading and writing MS-DOS diskettes. This is done through the \f2Floppydisk\f1 entry in the office menu, and will not be explained here. .pp There are two ways you can format a floppy disk. One way is simply to select \f2Floppydisk\f1 from the office menu to get the \f2Floppy\f1 window. This has a \f2Floppy Disk Format\f1 option that you can select and just follow directions. The other way to format a disk is done while running an interactive shell through \f2Full-Screen UNIX\f1 or \f2UNIX System\f1 in the office menu. When you have the \*U prompt (a "$"), put a floppy disk in the diskette drive and type "fmtflop". This will format the floppy disk and beep when it is done. It should only take about one minute. .pp Once you have a formatted diskette, there are several ways to move files on and off that disk. One way is again through the \f2Floppy\f1 window, but it is actually less convenient for our situation so it will not be explained here. You can read the manual if you want to bother. The other ways are done through an interactive shell. Depending on what you want to copy onto the diskette, you can choose one of two ways to put files on the diskette. .sp .ne 1i \f2Using "mount" and "cp"\f1 .pp If you just have a few files which will not fill up the disk, then you can treat the floppy disk as a regular \*U file system. This involves mounting the floppy disk on a known directory in the file system, then copying the files to that directory. You can mount the floppy disk with the following command: .sp .15i .ti +0.5i .ft 3 $ mount /dev/fp021 /mnt .ft 1 .sp .15i Typing the shorter command, \f2mntflop\f1, will do the same thing: .sp .15i .ti +0.5i .ft 3 $ mntflop .ft 1 .sp .15i From that point on, anything done in the /mnt directory will go onto the floppy disk instead of the system's hard disk. You can create directories there, copy files, remove files, etc. Thus, to copy your files to the floppy, just use the \*U \f2cp\f1 command. For example, if you are working on a Modula-2 program called "Prog1.mod", then you could use the following command to copy it to the floppy disk: .sp .15i .ti +0.5i .ft 3 $ cp Prog1.mod /mnt .ft 1 .sp .15i This puts a copy of the file Prog1.mod with the same name on the floppy disk under directory /mnt. You can type "ls -l /mnt" if you want to make sure the file is there. Once you have copied all the files that you want to backup on the floppy disk, you need to un-mount the floppy to detach it from the /mnt directory. \f3WARNING\f1: if you do not un-mount your floppy before removing it from the floppy drive, you will \f3corrupt the file system\f1 on the disk, and probably not be able to retrieve any files off of it. It is \f3VERY IMPORTANT\f1 that you issue the following command before you remove the diskette: .sp .15i .ti +0.5i .ft 3 $ umount /dev/fp021 .ft 1 .sp .15i Once you run \f2umount\f1 this way and the red light on the floppy disk drive goes off, it is safe to remove the diskette. .pp When you need to get that file back, all you have to do is mount the floppy disk again with either the \f2mount\f1 or \f2mntflop\f1 command, and use \f2cp\f1 to copy the file in the opposite direction - off the floppy onto the hard disk: .sp .15i .ti +0.5i .ft 3 $ cp /mnt/Prog1.mod . .ft 1 .sp .15i The period in the above command line represents the current working directory, so this command copies Prog1.mod off the floppy disk and places the copy in the current directory with the same name. This is one way you can work on the same file on several different \*U PCs. All you need to do is carry the file around on a floppy disk and copy it onto whichever system you are working on at the time. .sp \f2Using cpio\f1 .pp The other way to copy files onto the floppy disk is to use the \*U command called \f2cpio\f1. Be aware that a floppy disk used this way can no longer be mounted as described above. They are incompatible procedures. You will have to format the floppy again if you want to use it as a file system mounted on the /mnt directory. .pp Using \f2cpio\f1 is a convenient way to back up a large number of files onto a set of several floppy disks. The command can recognize when one disk is full, and prompt you for another one. Remember that the floppy disks must be formatted first, so make sure you have enough formatted floppy disks on hand before you start a large, multi-diskette backup (remember that each floppy can hold about 320K). As an example of how to use \f2cpio\f1 for this purpose, let's say you want to backup all the files in your home directory, including all subdirectories and the files they contain. First, make sure you are in your home directory by typing "cd" (\f2cd\f1 with no arguments moves you to your home directory). Now put a formatted floppy disk in the drive and type the following command: .sp .15i .ti +0.5i .ft 3 $ find . -print | cpio -ocB >/dev/rfp021 .ft 1 .sp .15i This will silently copy all your files onto the floppies, prompting you when it needs another diskette. In the above command, \f2find\f1 is used to give a list of file names to the \f2cpio\f1 command which actually writes the files onto the diskette. The diskette is specified by the special file name \f2/dev/rfp021\f1. .pp \f2Cpio\f1 has a number of options that allow you to retrieve files and list the files that are stored on the floppies. The following will list the files on the floppy disk, for example: .sp .15i .ti +0.5i .ft 3 $ cpio -icBvt 1 .tl \\*(tt .el .sp .ps .ft 'sp .ns .. .wh 0 hd .wh -5 fo .de pp .sp .ne 5 .ti +0.25i .. .ll 6.5i .po 1.0i .lt 6.5i .ds U U\s-2NIX\s+2 .de fo 'sp 2 .tl '\u*\d\*U is a trademark of AT&T Bell Laboratories''' 'bp .. .nh .ce 3 \f3MODULA-2 ON THE AT&T UNIX PCs .sp \f2Dept. of Computing and Information Sciences Kansas State University\f1 .sp .ps 12 \f3Introduction\f1 .ps .pp This document describes how to use the Modula-2 compiler on the AT&T \*U PC. We expect the reader to be familiar with the operation of the \*U PC as well as some of the basic commands of the \*U operating system, so they should first read \f2How to Use the AT&T \*U PC\f1. This compiler only runs on the AT&T Unix PC, with the Unix OS version 3.5 or 3.51. It recognizes the language Modula-2 as described in the 3rd, corrected edition of Niklaus Wirth's book, \f2Programming in Modula-2\f1. .pp This is a one-pass compiler, generating native MC68010 machine instructions as it checks the syntax. The MC68010 code is packaged in a file in Common Object File Format (COFF) suitable for inclusion in a library archive (see \f2ar\f1(1)) or linking with the Unix link editor, \f2ld\f1(1). Since the object file is in COFF, it is possible to link in routines written in either the C programming language or assembler (although the former requires some special handling and the latter a knowledge of the Modula-2 procedure call conventions). .sp 2 .ne 10 .ps 12 \f3Getting Started\f1 .ps .pp The first thing you need to do is login on a \*U PC and invoke "Full-screen \*U" to get the "$" prompt from the \*U shell. Once there, you are ready to use an editor (most likely the full-screen editor, \f2vi\f1) to build Modula-2 programs, compile the programs, and execute them. You are expected to know how to use \f2vi\f1, so that is not described here. The name of the command to invoke the compiler is "\f2mod2\f1". A manual page for this command is included with this document, which will be your primary reference on how to use the various options for the compiler. This document will describe a typical scenario for its use. .sp .ne 10 \f2Compiling and Executing Your Program\f1 .pp As mentioned before, you will use \f2mod2\f1 to compile the program. The simplest command line will look like this: .sp 0.1i .ti +.75i .ft 3 $ mod2 file.mod .ft 1 .sp 0.1i If the program has any syntax errors, the error messages will be printed on your terminal screen, along with the offending source line from the program. If there are no syntax errors and the compilation succeeds, then you will simply get the "$" prompt back from \*U and the executable file, named "a.out", will be in the current directory. The file "a.out" is the one you execute to run the program. To do this, simply type: .sp 0.1i .ti +.75i .ft 3 $ a.out .sp 0.1i .ft 1 Any output (including run-time error messages) will then appear on your screen. The "$" prompt will show up again after execution terminates. As an example, suppose the file named "Hello.mod" contains the following Modula-2 program module: .nf .sp .in +0.75i MODULE Hello; FROM InOut IMPORT WriteString, WriteLn; BEGIN WriteString ("Hello world"); WriteLn; END Hello. .sp .in -0.75i .fi The following script shows what you would see if you compiled and ran it (the \f2-v\f1 option on the command line just causes the compiler to report what it is doing as it progresses). Items in bold are typed by the user while those in italics are generated by the computer. .in +0.75i .nf .ne 16 .sp 0.1i $ \f3mod2 -v Hello.mod .ft 2 Modula-2 Compiler for the AT&T Unix PC, Version 1.0 Source file: Hello.mod Input symbol file: /usr/local/lib/mod2/InOut.sym Linking with Unix link editor ... Done linking Executable file: a.out \f1$\f3 a.out\f2 Hello world .ft 1 $ .sp .fi .de fo 'bp .. .ch fo -4 .in -0.75i .ps 12 .ne 10 \f3File Naming Conventions\f1 .ps .pp The compiler can handle six different kinds of files: .sp .in +0.5i .in +\w'\(bu 'u .ti -\w'\(bu 'u \(bu a file containing a regular program module, .br .ti -\w'\(bu 'u \(bu one holding the source for a definition module, .br .ti -\w'\(bu 'u \(bu the "symbol" file produced by compiling a definition module, .br .ti -\w'\(bu 'u \(bu the source for an implementation module, .br .ti -\w'\(bu 'u \(bu the unlinked COFF file produced by compiling an implementation module, and .br .ti -\w'\(bu 'u \(bu the loadable, executable file resulting from successful compilation. .sp .in 0 Names for all these files are restricted in length to 14 characters because this is the file name length limit imposed by the \*U operating system. The compiler puts few restrictions on what each of the types of files must be named. However, there are some conventions that you should follow for consistency and understanding. For one, it is helpful to have the name of the file reflect the name of the module it contains. For example, in the above module named "Hello," you should name the source file "Hello.mod". Secondly, extensions on certain kinds of files should follow these guidelines: .sp .in +0.5i .in +\w'\(bu 'u .ti -\w'\(bu 'u \(bu program modules: "\f2.mod\f1", .br .ti -\w'\(bu 'u \(bu definition modules: "\f2.def\f1", .br .ti -\w'\(bu 'u \(bu symbol files: "\f2.sym\f1" (you don't have a choice in this case), .br .ti -\w'\(bu 'u \(bu implementation modules: "\f2.imp\f1" or "\f2.mod\f1", and .br .ti -\w'\(bu 'u \(bu compiled implementation modules (unlinked): "\f2.o\f1". .in -0.5i .in -\w'\(bu 'u .sp It does not matter what the executable object file is named, although it is called "a.out" by default. For all source files, the extension takes up 4 of the 14 characters allowed in the file name. Therefore, you only have 10 characters to use as the main part of the file name. This is fine if the length of your module name is 10 characters or less. If the module name is longer than 10 characters, you should just truncate it and only use the first 10 characters in the file name (along with the appropriate extension). For example, assume you have a file containing a program module named "ProgramModule". The name of the file in this case should be "ProgramMod.mod" (upper and lower case are distinct - \*U considers the names "programmod.mod" and "ProgramMod.mod" to be different). Note that a side effect of this restriction is that all your module names should be unique in the first 10 characters even though the language itself does not have this restriction. .pp Symbol files deserve special mention here. They are created by \f2mod2\f1 when you compile a definition module, so \f2mod2\f1 determines the symbol file's name. You cannot override this. The file name will be composed of the first 10 characters of the module name (irrespective of the name you gave the file containing the definition module) along with a ".sym" extension. For example, compilation of a file "Buffer.def" containing the definition module "Buffer" will produce a symbol file named "Buffer.sym". The name of the symbol file is important because when you compile the corresponding implementation module (or when you compile another module which imports an object from this module) then the compiler looks for the file "Buffer.sym" to verify that you are using the imported objects properly. If it is named "buffer.sym", or anything else other than "Buffer.sym", then the compiler will not find the file, and the compilation will fail. The moral of the story is to leave it alone. Let the compiler do the work. .sp 2 .ps 12 .ne 10 \f3Using Your Own Definition and Implementation Modules\f1 .ps .pp One of the important features of Modula-2 is the ability to decompose a program into separate modules. This allows you to hide the details of the operations on various data types and separately compile the pieces. Once all the pieces have been compiled, you combine them and execute the program. This section explains how you can accomplish this with the \*U PC Modula-2 compiler. .pp Such a "library module," as we'll call it, has two parts, the definition part and the implementation part. These must be in separate files, and you must compile the definition module before the implementation module. You'll remember that compiling the definition module produces a symbol file. This is used when you compile the implementation module to make sure everything identified in the definition module is accounted for and declared properly in the implementation module. .pp Compiling the implementation part, then, produces an unlinked COFF file with a ".o" extension in the current directory. This contains the machine instructions that implement all the operations described in this library module. At this point, you are ready to compile a program module that imports items from this module. .pp When you compile a program module that uses something from the library module, the compiler will need the symbol file to make sure you are using the imported items correctly. You therefore must have the symbol file is the same directory as the program module. Furthermore, the COFF file produced by compiling the implementation module needs to be available to the \*U link editor when it is time to put together the executable object file for running the program. It is therefore easiest to have that file in the same directory also. Before you can link it, though, you have to tell the compiler what its name is. To do this, you simply add the COFF file name to the command line when invoking \f2mod2\f1 to compile the program module. The following example will illustrate this. .pp Let's say you write a library module named "LibModule". The definition module should be in a file named "LibModule.def", which yields "LibModule.sym" when compiled. The implementation part should be in a file named "LibModule.imp", and yield "LibModule.o" when compiled. You then write a program module named "ProgramModule" which imports something from "LibModule." This should be in a file named "ProgramMod.mod" (note the name truncation to keep within the 14 character file name limit). To compile "ProgramMod.mod" and make sure the code for LibModule is linked with it, you would enter the following command line: .sp 0.1i .ti +0.75i .ft 3 $ mod2 -v ProgramMod.mod LibModule.o .ft 1 .sp 0.1i As long as there are no syntax errors in "ProgramMod.mod", then \f2mod2\f1 will produce the file "a.out" which you can execute to run the program. The entire sequence would be: .sp 0.1i .in +0.75i .nf .ft 3 $ mod2 -v LibModule.def $ mod2 -v LibModule.imp $ mod2 -v ProgramMod.mod LibModule.o $ a.out .ft 1 .fi .in -0.75i .sp 2 .ne 10 .ps 12 \f3Run-Time Error Messages\f1 .ps .pp The run-time error messages provided by \f2mod2\f1 are fairly limited. In some cases, such as dereferencing a pointer that has not have not been given a reasonable value yet, run-time errors that cause the program to abort prematurely will only produce the cryptic \*U error messages to "help" you. Even with the run-time checks turned on (command line options \f2-r\f1 and \f2-f\f1), you still cannot tell what source line caused the error, so you have to utilize liberal output statements in your Modula-2 program to figure out where it is dying. .pp Turning on the range and overflow checking options (options \f2-r\f1 and \f2-f\f1, respectively) does offer some help, though. Be aware that there is a tradeoff in turning on either of these options since it results in larger object files and slightly slower execution (extra machine instructions are generated to perform the checks at run-time). See the manual page included with this document for a description of all the options available. .pp Whenever you see an address listed with the error message, it is referring to the address of the machine instruction that caused the error. It is difficult to match that address with a line number in the source file. If you are proficient with the debugger \f2adb\f1(1), you can figure it out. Here are the messages and their meanings: .sp 0.1i .in +0.4i .ti -0.4i \(bu \f2Index/Range error or arithmetic overflow/underflow at address 0x000?????\f1. .br This error message actually covers two situations. The first one is the index or range error, and is only detected when you use the "\f2-r\f1" option on the command line. It is generated when you either attempt to reference a non-existent element of an array, or assign to a subrange type variable a value outside its range. The second case is detected when you use the "\f2-f\f1" option. This is caused by performing an arithmetic operation that results in a value larger or smaller than the maximum or minimum value allowed for that type. For example, adding 10 + MAX(INTEGER) will produce this error message if the option is turned on. .sp .1i .ti -0.4i \(bu \f2IEEE floating point arithmetic error\f1. .br A floating point operation (either type REAL or LONGREAL) resulted in a value larger or smaller than the maximum or minimum value allowed. .sp .1i .ti -0.4i \(bu \f2Division by zero\f1. .br If this isn't self-explanatory, you're in the wrong business. .sp .1i .ti -0.4i \(bu \f2No return from function error\f1. .br This indicates a call to a function procedure finished without encountering a RETURN statement. This is known as a "fall-through" function. .sp .1i .ti -0.4i \(bu \f2Storage.ALLOCATE: Heap overflow\f1. .br Caused by a call to the procedure ALLOCATE (imported from module "Storage") that asked for a block of memory that was larger than the memory space available on the heap. .sp 0.1i .in -0.4i .pp Finally, the limit for stack and heap space is large. If your program needs more heap or stack space, then \*U continues to give your process additional memory dynamically. If your program gets stuck in infinite recursion, or an infinite loop that has dynamic memory allocation in it, then your program will rapidly consume the memory available on the system. If your program appears to be taking much longer to complete than it should, abort the program by pressing the \f2Del\f1 key (the \f2Shift\f1 of the \f2Esc\f1 key in the upper left corner of the keyboard). .sp 2 .ne 10 .ps 12 \f3How To Get Printouts\f1 .ps .pp There are several situations where you might want a printout. You may simply want to get a listing of the source file to study for logic errors or to turn in a completed (hopefully) assignment. Another case is when you have a large number of syntax errors in your program and want to get a listing of the error messages. Finally, you will need to print the output from one or more runs of the program. Printing a source file is simply a matter of giving the file name to an appropriate printer command. The following sections describe the other two situations. .sp .ne 10 \f2Getting a Listing of Syntax Error Messages\f1 .pp Error messages come in two forms: syntax errors and run-time errors. The former are generated by the compiler, the latter when you execute your program after it has been compiled successfully. We will first deal with syntax errors. You can get a copy of the list of syntax errors as they appear on your terminal screen by utilizing the ability in \*U to re-direct into a file what normally shows up on your screen. This is done with the greater-than sign, ">". The command line .sp 0.1i .ti +0.75i .ft 3 $ mod2 -v file.mod > file.err .ft 1 .sp 0.1i will put the error messages in the file named "file.err." You can then print it with any of the printer commands available, or study it with an editor. .pp Run-time error messages generated during execution of your program can be captured in a file in the same manner. This time, just redirect the output when you execute the program instead of when you compile it. The normal output from your program as well as the run-time error message will both go into the file: .sp 0.1i .ti +0.75i .ft 3 $ a.out > file.rterr .ft 1 .sp 0.1i Whether syntax errors or run-time errors, you can simply give the name of the file that has the captured messages to an appropriate printer command such as "lp" or "lprvax1." .sp .ne 10 \f2Printing the Output Generated by the Execution of Your Program\f1 .pp Instructors will often want you to turn in a copy of the output from a run of your program. There are several ways to do this, but the easiest way is again to redirect into a file what normally goes to your screen. The command line .sp 0.1i .ti +0.75i .ft 3 $ a.out > run.output .ft 1 .sp 0.1i will put the output in the file "run.output." In this case, you will not get any messages on the screen. Again, use the regular printer commands to get the hard copy. .pp The above method has one problem, however. It does not show any input you gave to the program from the keyboard. It is therefore better to use the following method for interactive programs. This way captures your program output in a file by using the \f2script\f1(1) command. Invoking this command causes everything that appears on your screen to also show up in a file named "\f2typescript\f1". Even when you type something on the keyboard, it goes in the file (don't try to use a full-screen editor such as \f2vi\f1, though). Therefore, invoke \f2script\f1, run your program, then type "Ctrl-D" (hold the "Ctrl" key down, and press the "D") to terminate the script session. You can then print the "\f2typescript\f1" file which will have a copy of everything that appeared on your terminal screen, including run-time error messages and keyboard input: .sp 0.1i .nf .in +0.75i .ft 2 $ \f3script\f2 Script started, file is typescript $ \f3a.out\f2 .ps 8 (program output shows up here, as well as in the file "typescript") .ps $ \f3Ctrl-D\f2 Script done, file is typescript $ .ft 1 .in -0.75i .sp 0.1i .fi A manual entry for \f2script\f1(1) is included with this document. 0707070000020042631006660001460001440000010516170425331511100001300000000000TRAILER!!!t. This is known as a "fall-through" function. .sp .1i .ti -0.4i \(bu \f2Storage.ALLOCATE: Heap overflow\f1. .br Caused by a call to the procedure ALLOCATE (imported from module "Storage") that asked for a block of memory that was larger than the memory space available on the heap. .sp 0.1i .in -0.4i .pp Finally, the limit for stack and heap space is large. If your program needs more heap or stack space, then \*U continues to give your process additional