13.07.2015 Views

The PowerPC 604 RISC Microprocessor - eisber.net

The PowerPC 604 RISC Microprocessor - eisber.net

The PowerPC 604 RISC Microprocessor - eisber.net

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

16Pascal Implementation: Compiler and Assembler/InterpreterCompiler Listing 17825826827828829830else writs(output,'Iucmal'i10)andendend ("case 6 )1writeln(output);889890891892893894begin if op ■ plus then sign t ■ pos else sign 1.. neg:insytebolend;it sy » ident thenbegin searchid((konst),1cp);with ler dofollowctp(llink); followctp(rlink)1031 folloOstp(idtype) 893 begin lap t. idtype; (valu 1. values end;832 end ("with") 896 if sign none then833 end ("followctp"); 897 if lap - intptr then836 898 begin if sign . nag then fvalu.ival t. -fvelu.ival end835 begin ("printtables") 899 also036 writeln(output); writeln(output); writeln(output); 900 if lap ■ realptr then837 if tb then lim ii. 0 901 begin838 else begin lim vu top; write(output,' local') end;, 902 if sign . neg then839 writeln(output,' tables '); writeln(output); 903 begin new(lvp,reol);840 marker; 904 if fvalu.velp.rval(1) • '-' then841 for i s• top downto lim do 903 Ivp'.rvel(11 1.. '+'842 followctp(display(i).fneme)1 906 else Ivp".rval(1) s ■ '-';843 writeln(output); 907 (or i 1.. 2 to strglgth do844 if not eol then write(output,' 'ichent+16) 908 lvp".rvel(i) 1.. fvelu.velr.rval(i),845 end ("printtables"); 909 fvelu.valp 1- lvp;866 910 end847 procedure genlabel(var nxtlebt integer); 911848 begin intlabel t ■ intlebel + 1; 912 el:: d error(105)1849 nxtlab s. intlabel 913 ineymbol;850 end ("genlabel"); 914 end851 915 else852 procedure block(feyel ectofeys; fay, symbol; fprocps ctp); 916 if ay • intco<strong>net</strong> then853 var lays symbol; teats booloan; 917 begin it sign ■ neg then vel.ival 1. -val.lvel;854 918 lop t• intptr; fvelu 1- veil ineymbol855 procedure skip(feyss setofeys); 919 end856 ("skip input string until relevant symbol found") 920 else857 begin 921 it ay . roalconat then858 if not eot(input) than 922 begin if sign ■ nag then val.velp".rval(1) :- '859 begin while not(sy in (eye) and (not eof(input)) do ineymbol; 923 lap 1» roalptr; fvalu t. veil ineymbol,060 if not (ey in (eye) then ineymbol 924 end861 end 925 else862 end ("skip") ; 926 begin error(106); ekip((sye) end863 927 end;864 procedure constant(tsys1 sototeys; var fops sip; var (valut valu); 920 if not (sy in (eye) then865 ver lop' stp; lcpt ctp; signs (none,pos,neg); 929 begin orror(6); skip(fsys) end866 lvpt cep; it 2..strglgth; 930 end;867 begin lop 1» nil; fvalu.ival s ■ 0; 931 imp t ■ lap868 if not(sy in constbegsya) then 932 and ("conatent") 1869 begin error(50); ekip(fsys+co<strong>net</strong>begsye) end; 933870 if ey in co<strong>net</strong>begeys then 9)4 function equalbnunde((spl,fsp2t stp); boolesn;871 begin 933 v4r Imin1,1mIn2,1max1,1mes2s integer;872 if sy ■ stringco<strong>net</strong>ey then 036 begin873 begin 937 if s (fspl ■ nil) or (fsp2-nil) then equelbounde l• true874 if lgth ■ 1 then lop 1 .. cherptr 938 else875 else 939876 begin 940 b lie%ounde(fepl,lmin1,1max1);877 new(lsp,arraye); 941 getbounde(fsp2,lmin2,1max2);878 with lep" do 942 equnlbounde 1... (Iminl•Imin2) and (Imaxl-Imax2)879 begin aeltype t- charptr; inxtype s ■ nil; 943 and880 site t. lgthocharsite; form t- arrays 944 end ("equalbounds") ;881 end 945882 end; 946 function comptypes(fspl,(sp21 stp) 1 boolean;083 fvalu t• veil ineymbol 967 ("decide whether structures pointed at by fspl end fep2 are compotible")884 end 948 var nxtl,nxt21 ctp; comp' booleon;885 oleo 949 begi ln teetpl,Iteetp2 1 teetp;886 begin 950887 sign t... none; 951 if fspl • fsp2 then comptypes 1» true808 if (ey . addop) and (op in (plue,minus)) then 952 else(‹

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!