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.

72 Pascal Implementation: Compiler and Assemble Iterpreter Assembler/Interpreter Listing 7331331431531631731831932U32132232332432532632132632933033133233)33433533633733833934034134234334434534634134834935035135235335435535635i358359360361362363364365366361360369370371372373314375376end;("uJP, ( 314 0( JP")23,24,25; labeleearch;13 ("ent"), begin read(prd,p), labeluearch end;15 ("cep"): begin for i:.1 to 9 do read(prd,ch); getname;while name0aptablefql do q t. q+1end;7 ("ldc"): begin case ch of ("get q")'1': begin p ;• 1; read(prd,1),if abe(i)>-largeint thenbegin op :- 8;atorelicpj.vi i; q maxstk,repeat q q+1 until stora(ql.vi-1;if q-icp thenbegin icp icp+1;if icp-overi thenandendend else q t ■end;errorl(' integer table overflow'r': begin op 8; p :- 2;read(prd,r);etore(rcp).vr r; q ;. overt;repeat q q+1 until store(q).vr.r;if q-rcp thanbegin rcp rcp+1;if rcp overr thenendend;'n': ; (Ap,q • 0")'b'i begin p I. 3;errorl(' real table overflowread(prd,q) and;'CI begin p 1• 6;repeat read(prd,ch); until ch ' ';if ch '"' thenerrorl(' illegal character')iread(prd,ch); q t. ord(ch);read(prd,ch),if ch '"' thenerrorl(' illegal character ,);end;'CI begin op 8, p 4;8 I" ( J; read(prd,ch),while chO')' dobegin read(prd,s1,ch)1 • 1. a + [•1)end;store(•cpkve 1• e; q t. overr;repeat q I. q+1 until •tore(q).ve.•;if q•scp thanbegin •cp 1. •cp+1;if acp.overs thenerrorl(' set table overflowandendend ("case")');'),377378 26 ("chk"): begin typcsymbol;379 read(prd,lb,ub);380 if op . 95 then q lb301 else362 begin383 etore(bcp-1).vi t• lb; etoro(bcpl.vi ub;304 q °yore;365 repeat q q+2366until (store(q-11.vi•lb)and (store(ql.vi.ub).367 it q•bcp then388 begin bcp bcp+2;369 if bcp.overb then390 crrorl(' boundary table overflow ');391 end392 end393 end;394395 56 ("lea"): begin396 if mcp + 16 >• overre then397 errorl(' multiple table overflow '),398 mcp mcp+16;399 q mcp;40U for 0 to 15 ("etringlgth") do401 begin read(prd,ch);402 etore(q+1).vc ;• ch403 end;404 end;405406 6 ("810): typesymbol;407.406 27,28,29,30,31,32,33,34,35,36,37,38,39, 40 , 41 , 42,43,44,45,46,47,409 48,49,50,51,52,53,54,561 ;410411 ("ord,chr")412 59,601 goto 1;413414 61 ("ujc")1 ; ("must have same length as uip")415416 end; (*case")417418 ( 8 store instruction h)419 with code(pc div 21 do42Uif odd(pc) then421 begin op2 ih op; p2 th p; q2 t• q422 end else423 t2gin opl :• op; pl th p; ql th q424 ends425 pc t. pc+1;426 1: readln(prd);427 ends ("assemble")428429 begin (*load")430 snits431 generate;432 pc :. 0;433 generate;434 end; (*loci") ,435' ) ; 436 ( 8437438 procedure pmd;439 var a !integer; it integer'4408)

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

Saved successfully!

Ooh no, something went wrong!