For the following assembly code how many times the loop


Question 1 :

You have two 32-bit numbers stored at memory locations 0x20000004 and 0x20000008, write an assembly program to compare these two numbers and calculate how many bit positions at which these two numbers have the same content.

Question 2 :

For the following assembly code, how many times the loop ‘calculate' is going to be executed? Why?

MOV r1, 10

calculate SUB r1, r1, 1

BNE calculate

Question 3 :

The following code is called ‘delay loop', It is used to create a certain delay during program execution. Calculate the amount of delay created by this code:

LDR r0,= #9800

repeat SUBS r0,r0,#1

BNE repeat

Given that the clock frequency of the processor is 48 MHz and the execution time of the LDR instruction is 2 clock cycles, SUBS instruction is 1 clock cycle, BNE instruction 2 clock cycle when branch taken and 1 clock cycle when branch is not taken.

Request for Solution File

Ask an Expert for Answer!!
Operation Management: For the following assembly code how many times the loop
Reference No:- TGS02909540

Expected delivery within 24 Hours