answersLogoWhite

0


Want this question answered?

Be notified when an answer is posted

Add your answer:

Earn +20 pts
Q: Which register stores intrrupt and subroutine return address register in 8086?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Which segment is used to store interrupt and subroutine return address registers?

stack segment


How can a stack be used for implementing a subroutine call?

A stack can be used to implement a subroutine call because the return address is pushed onto the stack, and control transfers to the subroutine. If the subroutine were to then call another subroutine, or even itself, a second return address would be pushed. When the subroutine returns control, the return address is popped off of the stack and control transfers to the return address.In addition, the stack can be used to pass arguments. The caller can push the arguments onto the stack before calling the subroutine. The subroutine can then access the arguments by making references relative to the stack pointer. When the subroutine returns control, the caller then pops the arguments off of the stack.Further, the subroutine can use the stack to store local variables. It adjusts the stack pointer in the direction of pushing things onto the stack, and then make references to that region of memory between the original value of the stack pointer and the new value of the stack pointer.This is exactly how most subroutines work on the 8086/8088 (and higher) processors...The caller pushes arguments on the stackThe caller calls the subroutine, pushing the return address on the stackThe subroutine pushes caller registers onto the stack, if that is the agreed convention for that callThe subroutine pushes the BP register on the stack and then copies the stack pointer (SP) to BPThe subroutine adjusts SP downward, allocating the required local memoryThe subroutine accesses arguments with [BP+offset] addressingThe subroutine accesses local variables with [BP-offset] addressingWhen the subroutine is done, it sets SP back to BP, pops caller's registers off of the stack, pops caller's return address off of the stack, and then returns to the callerThe caller then pops the arguments off of the stack.The structure in memory, representing arguments, return address, saved registers if needed, and local variables, with BP in the center, is called a stack frame.Done properly, a subroutine can be fully recursive, even able to call itself, or be called by other threads, because all local variables and the registers if saved are stored on the stack. The ability to be recursive is also called reentrancy.


What is the difference between branch instruction call sub routine program and interrupt?

Branch Instruction A branch (or jump on some computer architectures, such as the PDP-8 and Intel x86) is a point in a computer program where the flow of control is altered. The term branch is usually used when referring to a program written in machine code or assembly language; in a high-level programming language, branches usually take the form of conditional statements, subroutine calls or GOTO statements. An instruction that causes a branch, a branch instruction, can be taken or not taken: if a branch is not taken, the flow of control is unchanged and the next instruction to be executed is the instruction immediately following the current instruction in memory; if taken, the next instruction to be executed is an instruction at some other place in memory. There are two usual forms of branch instruction: a conditional branch that can be either taken or not taken, depending on a condition such as a CPU flag, and an unconditional branch which is always taken. Call Subroutine instructions Call Subroutine instructions and Return From Subroutine instructions within the instruction stream. The first stage stores a return address in a return register when a Call Subroutine instruction is predicted. The first stage predicts a return to the return address in the return register when a Return From Subroutine instruction is predicted. A second stage decodes each Call Subroutine and Return From Subroutine instruction in order to maintain a Return Stack Buffer that stores a stack of return addresses. Each time the second stage decodes a Call Subroutine instruction, a return address is pushed onto the Return Stack Buffer. Correspondingly, each time the second stage decodes a Return From Subroutine instruction, a return address is popped off of the Return Stack Buffer. The second stage verifies predictions made by the first stage and predicts return addresses for Return From Subroutine instructions that were not predicted by the first stage. A third stage executes Return From Subroutine instructions such that the predictions are verified. Finally, a fourth stage retires Return From Subroutine instructions and ensures that no instructions fetch after a mispredicted return address are committed into permanent state. Program interrupt an interrupt is an asynchronous signal from hardware indicating the need for attention or a synchronous event in software indicating the need for a change in execution. A hardware interrupt causes the processor to save its state of execution via a context switch, and begin execution of an interrupt handler. Software interrupts are usually implemented as instructions in the instruction set, which cause a context switch to an interrupt handler similar to a hardware interrupt. Interrupts are a commonly used technique for computer multitasking, especially in real-time computing. Such a system is said to be interrupt-driven. An act of interrupting is referred to as an interrupt request ("IRQ").


What will happen when pop instruction is executed?

The top of stack to copied to the specified register and the stack pointer is incremented by 2. A special form of POP, RET, has the program continuing with the popped address in the program counter, i.e. a return from subroutine or function call.


Mention the importance of subroutines in programming?

A subroutine is typically defined as being a function or procedure that can be invoked at any point in a program, causing the procedural execution to branch to the subroutine. This is not unlike a goto or jump statement, however subroutines also make use of the program's call stack to allow values (arguments or parameters) to be passed to the subroutine, including the address of the caller so that execution can return to the point of the call when the subroutine falls from scope. A subroutine can also (optionally) return a single value to the caller, known as the return value. Return values are temporary and will fall from scope when the expression that invoked the subroutine falls from scope. However, by assigning a subroutine to a variable, the return value can be stored in that variable and can then used in subsequent expressions. Subroutines pop their arguments from the stack and construct local variables or references from the argument values. Arguments passed by reference can therefore be used to return values through the referenced values. Values returned in this manner are known as output arguments. Subroutines that use output arguments often use the subroutine's temporary return value to indicate any errors that occurred within the subroutine, with zero indicating success (no error).


What is a programming return address?

In structured programming (a method of orderly setting up programs to increase readability of source code, and easier maintenance), segments of code to do specific things are often written...and then have a "return address" at the end of the code segment or subroutine to say where in the main coding the program should continue. In some languages, like BASIC, this may be a "line number" in the program. In other languages, such a C programming, it may be a label that has been inserted in the coding to be used as an 'address'. For example, a program like a sales program may have a subroutine asking the user's gender. Then the gender-asking subroutine may take the user to a listing of men's clothing if he answered male, or a different return address to take her to a list of female clothing if she answered female...and even an error routine's address if the user left the question blank or gave a non-gender answer.


Why call instruction in 8085 microprocessor have 18 state and how its operate?

The CALL InstructionOpcode OperandCALL 16-bit memory addressof a subroutineIt is a 3-byte instruction that transfers the program sequence to a subroutineSaves the content of the PC (Program Counter-16-bit register) , the address of the next instruction , on the stackDecrements the stack pointer register by 2Jumps unconditionally to the memory location specified by the 2nd and 3rd bytes.This instruction is accompanied by a RETURN instruction in the subroutine


3 What is the difference between a function procedure and a subroutine procedure?

Both a function and a subroutine are examples of out-of-line execution calls to code. The main difference is that a function call can be part of an expression and returns a value, whereas the subroutine can be called standalone and does not return a value.


Which program segment at run time is used to store interrupt and subroutine return addresses?

If this is a homework assignment, you really should try to answer it on your own first, otherwise the value of the reinforcement of the lesson due to actually doing the assignment will be lost on you.Interrupt and subroutine return addresses are stored on the stack, so the stack segment is used for interupt and subroutine addresses.


What is different between a subroutine and function in vb.net?

Function returns a value but sub procedure do not return a value.


What is stack space?

A type of RAM that is organized as a stack. or part of RAM that has software to make it operate like a stack. A stack memory operates like one of those chip dispensers they use in Los Vegas. You push the chips onto the stack. When you remove one (called a pop), it was the one on the top, the last one you put in. The first one you put in is the last one you take out. They are used by certain types of computer hardware and software that needs data accessed in that way, FILO (first in last out) and LIFO (last in first out). For example subroutine return addresses. When the CPU executes a subroutine call, the return address is pushed on the stack. The subroutine may call another subroutine, with another return address pushed on the stack. And more. then when the subroutines are exited, the addresses are POPed off the stack and executed. The use of a stack ensures the returns are all executed in the correct order.


When a function does not return a value what kind of function is it called?

In most computer languages, a procedure that returns a value is called a function and a procedure that does not return a value is called a subroutine or subprogram. Usually the languages treat the passing of arguments/parameters differently between functions and subroutines. The C language does not distinguish between them. A subroutine that does not return a value is define as a "void" function indicating that no return value is used or available.