Ret-unconditional branch instruction-microprocessor, Assembly Language

RET : Return from the Procedure:-

At each CALL instruction, the register IP and register CS of the next instruction is pushed to stack, before the control is transferred to the process. In the ending of the procedure, the RET instruction ought to be executed. When it is executed, previously stored content of register IP and CS along with the flags is retrieved into the CS register, IP register and flag registers from the stack and the execution of the main program continues further. The procedure can be a far or a near procedure. In the case of a FAR procedure, the existing contents of SP points to IP and CS register at the time of return. While in the case of a NEAR procedure, it points to only IP. Depending on the type of procedure and the SP contents, the RET instruction has four types.

1. Return within the segment.

2. Return within the segment adding 16-bit immediate displacement to the SP contents.

3. Return the intersegment.

4. Return the intersegment adding 16-bit immediate displacement to the SP contents.

 

Posted Date: 10/12/2012 3:58:04 AM | Location : United States







Related Discussions:- Ret-unconditional branch instruction-microprocessor, Assignment Help, Ask Question on Ret-unconditional branch instruction-microprocessor, Get Answer, Expert's Help, Ret-unconditional branch instruction-microprocessor Discussions

Write discussion on Ret-unconditional branch instruction-microprocessor
Your posts are moderated
Related Questions
i have trying to do the homework but there is a mistake. (Counting positive and negative numbers and computing the average of numbers) write a program that reads an unspecified nu

Why is the capability to relocate processes desirable?

what will be the value of EAX after following instructions execute? mov bx, 0FFFFh and bx, 6Bh

Program : Write an assembly program to find out the number of positive numbers and negative numbers from a given series of signed numbers. Solution : Take the i th num

END : END of Program:- The END directive marks the ending of the assembly language program. When the assembler comes across this END directive, it avoided the source lines avai

How to define procedures?

Computes the integral square root: Problem: Square Root:   For this problem you will write a short assembly program that computes the integral square root of an input numb

8254 Programmable Timer A diagram of Intel's 8254 interval event/timer counter is given in Figure. The 8254 consists of 3 identical counting circuits, per of which has GATE and

how to add 111 and 333 in assembly language

PTR : Pointer:- The pointer operator which is used to declare the type of a variable, label or memory operand. The operator PTR is prefixed by either WORD or BYTE. If the prefi