Question

In: Computer Science

The following program segment was being run on the Basic Computer. 319 ION (Interrupt enable ON)...

The following program segment was being run on the Basic Computer.
319 ION (Interrupt enable ON)
320 LDA ADS
321 STA PTR
322 LDA CTR
323 ADD PTR I
324 ISZ PTR
While the computer was in T2 cycle of LDA CTR, an interrupt hits it. The ISR is located from
624 to 711. Write down the sequence of steps that the computer will go through before it
resumes this program. Put serial number on each of your steps.

Solutions

Expert Solution

1) Processor finishes the execution of current instruction LDA CTR

2) Processor Identify the source of Interrupt by Checking which flag is set. An acknowledgment signal to the device that issued the interrupt.( The acknowledgment allows the device to remove its interrupt signal.)

3) Save the Status of CPU and the location of the next instruction to be executed, which is contained in
the program counter(PC contains address of next instruction ,ADD PRTI ,which is 323). into the system stack.

4) Also saves Contents of processor registers and Flags into system sack.

5) The processor now loads the program counter(PC) with the entry location of the ISR. i.e PC is loaded with address 624.

6) Now the processor executes instruction in memory locaion from 624 to 711.(process the interrupt)

7) Once the ISR is finished, Restore contents of processor registers and flags from system stack.

8) Turn the interrupt facility on

9) It also loads the address of interrupted program i.e. 323 from stack into PC. Also retrieves status of CPU from stack.

10) Now the processor resumes the program execution from where it is interruptd.

Micro operation – Interrupt cycle

i. The contents of the PC are transferred to the MBR , so that they can be saved for return from the interrupt

            t1: MBR ←(PC)        i.e   MBR ← (323)   

ii. • MAR is loaded with the address at which the contents of the PC are to be saved (stack address)

            • PC is loaded with the address of the start of the interrupt-service routine

          t2: MAR ← stack_top_address.   

                PC ← ISR-address    i.e. PC ← (624)

iii. Store the MBR, which contains the old value of the PC into stack-memory.

          t3: M[stack_top_address]←(MBR)


Related Solutions

Basic JAVA Question When we try to run this program, a problem occurs. What is this...
Basic JAVA Question When we try to run this program, a problem occurs. What is this problem called? And why does this problem occur here? public class Main {    public static void main(String[] args) {    PhoneNumber pn = new PhoneNumber();        System.out.println(pn.isTollFree());    } } class PhoneNumber { String number;    public boolean isTollFree() { return number.charAt(1) == '8'; } }
Determine whether the following hydroxide ion concentrations ([OH−]) correspond to acidic, basic, or neutral solutions by...
Determine whether the following hydroxide ion concentrations ([OH−]) correspond to acidic, basic, or neutral solutions by estimating their corresponding hydronium ion concentrations ([H3O+] using the ion product constant of water (Kw). It may help to keep the following equation in mind as you work Kw = [H3O+][OH−] = [1×10−7 M][1×10−7 M] = 1×10−14 M. 1. [OH-] = 4 x 10^-12 M 2. [OH-] = 7 x 10^-9 M 3. [OH-] = 7 x 10^-4 M 4. [OH-] = 2 x...
in basic c++ program please!! Write a word search and word count program. Assign the following...
in basic c++ program please!! Write a word search and word count program. Assign the following text to a string constant. For God so loved the world that he gave his one and only Son, that whoever believes in him shall not perish but have eternal life. For God did not send his Son into the world to condemn the world, but to save the world through him.Whoever believes in him is not condemned, but whoever does not believe stands...
Write a program in Java and run it in BlueJ according to the following specifications: The...
Write a program in Java and run it in BlueJ according to the following specifications: The program reads a text file with student records (first name, last name and grade on each line) and determines their type (excellent or ok). Then it prompts the user to enter a command, executes the command and loops. The commands are the following: "all" - prints all student records (first name, last name, grade, type). "excellent" - prints students with grade > 89. "ok"...
Question 2: consider the following library relational database schema Write a program segment to retrieves the...
Question 2: consider the following library relational database schema Write a program segment to retrieves the list of books that became overdue yesterday and that prints the book title and borrower name for each. 1- Use JDBC with Java as the host language
Given the following pre-condition and program segment, what is the post-condition for y? // Pre-condition: -2...
Given the following pre-condition and program segment, what is the post-condition for y? // Pre-condition: -2 <= x < 4 y = 2*x*x - x +3
Because the oxide ion is basic, metal oxides react readily with acids. (a) Write the net ionic equation for the following reaction:
Because the oxide ion is basic, metal oxides react readily with acids.(a) Write the net ionic equation for the following reaction: (b) Based on the equation in part (a), write the net ionic equation for the reaction that occurs between NiO(s) and an aqueous solution of nitric acid.
in C++ Compile and run the program for the following values: r = 2 Cm, h...
in C++ Compile and run the program for the following values: r = 2 Cm, h = 10 Cm. The answer should be: The cross section area of the cylinder is 3.8955634 c The side area of the cylinder is 19.474819 inch-sqr Did you get the same answer? Explain the reason for such an error and fix the problem. Modify the previous program to include a new function called total_area, that computes the total suface area of a cylinder. The...
C program simple version of blackjack following this design. 1. The basic rules of game A...
C program simple version of blackjack following this design. 1. The basic rules of game A deck of poker cards are used. For simplicity, we have unlimited number of cards, so we can generate a random card without considering which cards have already dealt. The game here is to play as a player against the computer (the dealer). The aim of the game is to accumulate a higher total of points than the dealer’s, but without going over 21. The...
Create a basic program (C programming language) that accomplishes the following requirements: Allows the user to...
Create a basic program (C programming language) that accomplishes the following requirements: Allows the user to input 2 numbers, a starting number x and ending number y Implements a while loop that counts from x (start) to y(end). Inside the loop, print to the screen the current number Print rather the current number is even or odd If the number is even , multiply by the number by 3 and print the results to the screen. If the number is...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT