answersLogoWhite

0

What is subroutine instructions?

Updated: 12/19/2022
User Avatar

Wiki User

∙ 10y ago

Want this question answered?

Be notified when an answer is posted

Add your answer:

Earn +20 pts
Q: What is subroutine instructions?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Similarities between macro and subroutine?

Both Macro & Subroutine are set of instructions that are called several times to perform a specific task. They act like functions that have a sequence of instructions stored and is often called by the program.


What is subroutine?

Subroutine is an instruction sequence in a machine or assembly language program that can be prewritten and referred to as often as needed. Subroutine is used for controlling thing e.g. traffic lights burglar alarms they all use subroutine


What are subroutines?

In computer programming, a subroutine is an identified sequence of instructions with a start and an end point which may be invoked from another part of the program. When a subroutine is called, the processor executes the instructions until it reaches the end of the subroutine, at which point control is returned to the point in the program immediately following the call. In most programming languages, a set of conventions are followed which allow values to be passed into the subroutine and for a result to be returned, so that the subroutine can be used in many different contexts. This is the most basic form of reusable software. In higher-level languages, functions and methods are specialized forms of subroutines.


What is subroutine in java?

Subroutine mean what (in java)?


What are subroutine linkages?

The Mechanism that makes possible to transfer control between the calling program and Subroutine is reffered to as SUBROUTINE LINKAGE


What are stacks subroutines in 8085 microprocessor?

A subroutine is a group of instructions that will be used repeatedly in diff locations of the program..........rather than repeating the same instructions several times, they can be grouped into a subroutine that is called from diff locations. 8085 has 2 instruction set for dealing with subroutines: 1.CALL -direct the program execution to the subroutine. Generally it pushes address of next instruction of program counter onto the stack,then goes to the address of subroutine. 2.RET:- pops the address of next instruction from the stack and places it in the program counter and returns to that address to continue processing. For example, you have an often used value stored in HL. You have to call a subroutine that you know will destroy HL (with destroy I mean that HL will be changed to another value, which you perhaps don't know). Instead of first saving HL in a memory location and then loading it back after the subroutine, you can push HL before calling and directly after the calling pop it back. Of course, it's often better to use the pushes and pops inside the subroutine.


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 is main difference between macro and subroutins?

marco expand where it invoked ,subroutine will go where the subroutine is defined....


What is the difference between interrupt and system call?

A processor executes its instructions one after another. One of the instructions it can execute is a subroutine call, where it suspends executing the current set of instructions, goes off and executes another set and then returns. This is referred to as 'calling a subroutine.' A 'system call' is a call to a subroutine built into the system, rather than a call to one in your own program. Calls and interrupts work similarly, in that to process an interrupt, the processor goes off and executes a different set of instructions and returns. However, calls are synchronous, they occur in fixed order determined by the program, and the processor only has to remember where it was so it can return to the proper place. Interrupts are asynchronous, they can occur at any time, such as when you hit a key on the keyboard, thus the processor has to remember its place and its state, because the interrupt likely has nothing to do with what it was doing at the time of the interrupt.Disturbing other


What is a single computer function that initiates a string of commands?

A call to a subroutine. A subroutine is a named/labeled set of commands.


Difference between interrupt and subroutine in computer?

interrupt is a signal caused by I/O devices where as subroutine is a part of the program which is excuted rapidly


What is subroutine in 8085?

in 8085 microprocessor a subroutine is a separate program written aside from main program ,this program is basically the program which requires to be executed several times in the main program. the microprocessor can call subroutine any time using CALL instruction . after the subroutine is executed the subbroutine hands over the program to main program using RET instruction.