Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In our first project, we use the following RISC instructions as the target language of our compiler. The compiler uses the convention (code shape) that

image text in transcribed

image text in transcribed

In our first project, we use the following RISC instructions as the target language of our compiler. The compiler uses the convention (code shape) that every computed or loaded value is copied into a "fresh", virtual register. In the backend of a compiler, these virtual registers have to be mapped" to physical registers, since an executable machine code can only contain the limited set of physical register names of the target machine architecture. instr. format description semantics memory instructions load constant value cinto register r load I c rar C loadAI rar, c load value of MEM( T+ c) into r Tu MEM(rar+ c) storeAI rar ru, c store value in rinto MEM(rut c) arithmetic instructions add contents of registers raand ru, and add rare ru store result into register rz subtract contents of register rafrom register sub ry, and store result into register rz mult ran, ru multiply contents of registers Frand r and rz ry store result into register rz divide contents of registers raand ru, and div r Store result into register rz I/O instruction write value of MEM(rr+ c to standard output print( MEM(ra+ c) output AI r c In our first project, we use the following RISC instructions as the target language of our compiler. The compiler uses the convention (code shape) that every computed or loaded value is copied into a "fresh", virtual register. In the backend of a compiler, these virtual registers have to be mapped" to physical registers, since an executable machine code can only contain the limited set of physical register names of the target machine architecture. instr. format description semantics memory instructions load constant value cinto register r load I c rar C loadAI rar, c load value of MEM( T+ c) into r Tu MEM(rar+ c) storeAI rar ru, c store value in rinto MEM(rut c) arithmetic instructions add contents of registers raand ru, and add rare ru store result into register rz subtract contents of register rafrom register sub ry, and store result into register rz mult ran, ru multiply contents of registers Frand r and rz ry store result into register rz divide contents of registers raand ru, and div r Store result into register rz I/O instruction write value of MEM(rr+ c to standard output print( MEM(ra+ c) output AI r c

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

101 Database Exercises Text Workbook

Authors: McGraw-Hill

2nd Edition

0028007484, 978-0028007489

More Books

Students also viewed these Databases questions

Question

a valuing of personal and psychological privacy;

Answered: 1 week ago