Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Build Our Estimator You are going to write a small parser in C that counts the number of instructions and estimates how many cycles are

Build Our Estimator

You are going to write a small parser in C that counts the number of instructions and estimates how many cycles are needed to run that program from top to bottom.

As an example, if an assembly program had the following code:

# assembly.s program MOVQ a, %rax MOVQ b, %rbx ADDQ %rbx, %rax IMULQ %rbx MOVQ %rax, c 

Your tool will report a summary of the total Instructions (i.e. ADD, MOV, IMU, etc.) found and an estimate of the total cycles needed for hardware to execute this code:

ADD 1 MOV 3 IMUL 1 Total Instructions = 5 Total Cycles = 7

image text in transcribed

You are going to write a small parser in C that counts the number of instructions and estimates how many cycles are needed to run that program from top to bottom. As an example, if an assembly program had the following code: \# assembly.s program MOVQ a,% \%ax MOVQ b,%rbx ADDQ \%rbx, \%rax IMULQ \%rbx MOVQ \%rax, c Your tool will report a summary of the total Instructions (i.e. ADD, MOV, IMU, etc.) found and an estimate of the total cycles needed for hardware to execute this code: ADD 1 MOV 3 IMUL 1 Total Instructions =5 Total Cycles =7

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

Students also viewed these Databases questions