Question

In: Computer Science

The following program is to have a time delay. Calculate and tell how much the time...

The following program is to have a time delay. Calculate and tell how much the time delay is. The CPU frequency is 24-MHZ.

     org $1000 ; starting address of the program

     ldx #80000     ; 2 E cycles

loop psha             ; 2 E cycles

     pula       ; 3 E cycles

     psha       ;

     pula       ;

     psha       ;

     pula       ;

     psha       ;

     pula       ;

     psha       ;

     pula       ;

     psha       ;

     pula       ;

     nop        ;     1 E cycle

     nop        ;

     dbne x,loop;     3 E cycles       

     swi

      end

Solutions

Expert Solution

 ldx #80000      
loop       psha              ; 2 E cycles
           pula              ; 3 E cycles
           psha              ; 2 E cycles
           pula              ; 3 E cycles
           psha              ; 2 E cycles
           pula              ; 3 E cycles
           psha              ; 2 E cycles
           pula              ; 3 E cycles
           psha              ; 2 E cycles
           pula              ; 3 E cycles
           psha              ; 2 E cycles
           pula              ; 3 E cycles
           psha              ; 2 E cycles
           pula              ; 3 E cycles
           nop               ; 1 E cycle
           nop               ; 1 E cycle
           dbne x,loop       ; 3 E cycles
           dbne x,loop

To delay by 100 millisec, that is 24,000,000 * 100 / 1,000 EClocks, namely 2,400,000 instruction cycles.

The maximum register size available is 16-bits, so a loop counter value is chosen that is <= 65535.

Conveniently 60,000 is a factor of 2,400,000 being 60,000 * 40. So the inner loop is contrived to take 40 cycles.

Giving the required 40 cycles execution time.if you have interrupts, other processes, this hard coded method is not very accurate, and a timer interrupt would be better.

Note: If you satisfy with answer then give a upvote to answer and for any query please mention in comment.


Related Solutions

Write a Python program that will calculate how much money you will have when you invest...
Write a Python program that will calculate how much money you will have when you invest a given amount of money over a set number of years with a given interest rate. The program takes as user input how much money to invest and the yearly interest rate and calls a calculateEarnings function using those two inputs as the parameters initialMoney and interestRate. Both of the user inputs should be able to be entered in decimal numbers. The calculateEarnings function...
1. Demonstrate how workers choose how much free time and how much consumption to have in...
1. Demonstrate how workers choose how much free time and how much consumption to have in a day using the example of an increase in the hourly wage rate.
Using Excel, calculate the median delay time per week and construct a run chart using the...
Using Excel, calculate the median delay time per week and construct a run chart using the data below. Compare the delay times per week to the median. Display your chart. Question: Does this process show common or special cause variation? Is this something that the medical director should be concerned with? Would it be productive to investigate and eliminate the cause (whether it is common or special)? Why or why not? Week Average Delay Time (in days) 1 34 2...
I need an equation to calculate how much time a coil has to and can remain...
I need an equation to calculate how much time a coil has to and can remain active in a coilgun to reach a specific velocity. In coilguns the coils must be disabled once the projectile is 1/2 inside the coil or the projectile will bounce. Fixed variables are as follow: -Mass of projectile -Initial velocity of projectile assuming vacuum -Final velocity of projectile assuming vacuum -Projectile and coil length (Projectile length is equal to coil length -Coil attraction distance in...
A statistical program is recommended. A study investigated the relationship between audit delay (Delay), the length...
A statistical program is recommended. A study investigated the relationship between audit delay (Delay), the length of time from a company's fiscal year-end to the date of the auditor's report, and variables that describe the client and the auditor. Some of the independent variables that were included in this study follow. Industry A dummy variable coded 1 if the firm was an industrial company or 0 if the firm was a bank, savings and loan, or insurance company. Public A...
A statistical program is recommended. A study investigated the relationship between audit delay (Delay), the length...
A statistical program is recommended. A study investigated the relationship between audit delay (Delay), the length of time from a company's fiscal year-end to the date of the auditor's report, and variables that describe the client and the auditor. Some of the independent variables that were included in this study follow. Industry A dummy variable coded 1 if the firm was an industrial company or 0 if the firm was a bank, savings and loan, or insurance company. Public A...
A statistical program is recommended. A study investigated the relationship between audit delay (Delay), the length...
A statistical program is recommended. A study investigated the relationship between audit delay (Delay), the length of time from a company's fiscal year-end to the date of the auditor's report, and variables that describe the client and the auditor. Some of the independent variables that were included in this study follow. Industry A dummy variable coded 1 if the firm was an industrial company or 0 if the firm was a bank, savings and loan, or insurance company. Public A...
A statistical program is recommended. A study investigated the relationship between audit delay (Delay), the length...
A statistical program is recommended. A study investigated the relationship between audit delay (Delay), the length of time from a company's fiscal year-end to the date of the auditor's report, and variables that describe the client and the auditor. Some of the independent variables that were included in this study follow. Industry A dummy variable coded 1 if the firm was an industrial company or 0 if the firm was a bank, savings and loan, or insurance company. Public A...
A study investigated the relationship between audit delay (Delay), the length of time from a company's...
A study investigated the relationship between audit delay (Delay), the length of time from a company's fiscal year-end to the date of the auditor's report, and variables that describe the client and the auditor. The independent variables are as follows. Industry A dummy variable coded 1 if the firm was an industrial company or 0 if the firm was a bank, savings and loan, or insurance company. Public A dummy variable coded 1 if the company was traded on an...
A study investigated the relationship between audit delay (Delay), the length of time from a company’s...
A study investigated the relationship between audit delay (Delay), the length of time from a company’s fiscal year‐end to the date of the auditor’s report, and variables that describe the client and the auditor. Some of the independent variables that were included in this study follow: (12 marks total) Industry A dummy variable coded 1 if the firm was an industrial company or if the firm was a bank, savings and loan, or insurance company Public A dummy variable coded...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT