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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

78Pascal Implementation: Compiler and Assemt" -/InterpreterAssembler/Interpreter Listing 79691698699700701702703end;70,71,72,73,74,2 ("etr")1 begin store(bsee(p)+q) 1.. storelsehsp i• sp-1end;704 75,76,77,78,79, 768705 3 ("aro")1 begin store(qj I. store(sp); 769706 ep 1.- ap-1 770707 end; 771708 772709 4 ("1.da"); begin sp t. sp+1; 773710 store(spf.va 1- base(p) + q 714711 end; 775712 776711 5 (also"), begin sp :- sp+1; 777714 storeIspkva 1- q 778715 end; 779716 780717 80,81,82,83,84, 781718 6 ("sto")t begin 782719 storelstore(sp-1).vs) :. etore(sp); 783720 ap :. sp-2; 784721 end; 785722 786723 7 ("Ade"); begin sp ;- sp+1; 707724 if p-I then 708125 begin storelepj.vi :- q; 789726 end else 790727 if p - 6 then store(sp).ve 1. chr(q) 791728 else 1792729 if p - 3 then etorelspl.vb 1. q - 1 793710 else (" load nil *) store(spj.va ;- maxatr 794731 end; 795732 796733 8 ("lei"): begin ep 1. sp+1; 797734 store(epl I. store(q) 798715 end; 799716 000737 85,86,87,88,89, 801738 9 (*Ind"): begin ad :- etore(ep).va + q; 802739 ( 0 q i8 a number of storage unite *) 803740 store(sp) 1. storo(adj 804741 end; 005742 806743 90,91,92,93,94, 807744 10 ("inc$91 store(sp).vi 1. storelapl.vi+q; 808145 809746 11 ("mst")i begin ("p-level of calling procedure minus level of called 810747 procedure + 1; set dl and el, increment sp") 011748 (" then length of this element is 812149 mex(Intsize,realeite,boolsito,charsize,ptrsize *) 813150 storelep+21.vm 1. base(p); 814751 (" the length of this element is ptraiee *) 815752 storo(sp+3).vm 1. me; 816751 (" idem *) 817754 atore(sp+4).vm 1- ep; 818755 (" idem *) 819756 sp :. 01)+5 820757 end; 821758 822159 12 ("cup")1 begin ("p-no of locations for parameters, q-entry point") B23760 op 1. sp-(p+4); 824761762763764765766767atore(mpt41.vm 1. pc;pc I. qend;13 ("ent")i if p 1 thenbegin sp 1. mp + q; (*el length of dataseg")if ap > np then errort(' store overflowendelsebegin ep sp+q;if ep > np then (wort(' store overflowend;(*q . max space required on stack")14 ("ret")t begin case p of0: sp:- mp-1,1,2 ; 3,4,5: op'. alpend;pc 1. storeimp+4j.vm;op store(mp+3).vm;mpl ■ store(mp+2j.vm;end;15 ("cep"): callsp;16 ("ixa"); begint- store(spl.vi;ap t. ep-1;etorelapj.va q*i+etore(spl.v*1end;17 ("equ"); begin ap sp-1;case p of11 store(ep).vb t. s•ore(ap).vi storeOs stora(sp).vb 1- store(spl.va store6: store(sp).vb 1. atore(ep).vc • store2t store(sp).vb store(sp).vr . store3: store(ep).vb I. storelapj.vb store41 store(sp).vb 1. store(spl.vs storeSt begin compare;store(apj.vb t. b;end;end; ("case p")end;sp+1ep+1sp+1sp+1sp+1sp+1.vi;.va;.vc;•vr;.vb;•va;18 (*neq")t begin ep t. ep-1,case p ofOt store epl.vb i ■ storelsp).va store(sp+1).vs;11 store ep).vb t ■ store(sp).vi store(sp+1).vi;61 store epj.vb storo(sp).vc store(sp+1).vc;2: store epl.vb store(sp).vr store(sp+ ► ).vr;3t store sp).vb storelspl.vb storelsptlj.vb;41 store sp).vb l ■ stora(spj.vs •torelsp+1).vs;5: begin compare;store(sp).vb not b;endend; (*case p")end;19 ;ogees); begin sp sp-1;case p ofOt Wort(' - for address ');It storelaphvb 1. store(spl.vi >- storsIsp+1).v1;61 etorelepj.vb I. storo(opl.vc storolop+11.vc;' ) ;' ) ;

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

Saved successfully!

Ooh no, something went wrong!