Subroutine
Stack
In 8085 microprocessor stack is a set of memory location in the read/write memory which specified by the programmer in the main program. Those memory locations are used to store binary information temporarily during execution of the program
a stack is an abstract data type that serves as a collection of elements, with two principal operations: push, which adds an element to the collection, and pop, which removes the most recently added element that was not yet removed. The order in which elements come off a stack gives rise to its alternative name, LIFO (for last in, first out). Additionally, a peek operation may give access to the top without modifying the stack.
http://gradestack.com/Microprocessors-and/Assembly-Language/STACK/19312-3912-38120-study-wtw
Subroutine
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.
In 8085 microprocessor stack is a set of memory location in the read/write memory which specified by the programmer in the main program. Those memory locations are used to store binary information temporarily during execution of the program
a stack is an abstract data type that serves as a collection of elements, with two principal operations: push, which adds an element to the collection, and pop, which removes the most recently added element that was not yet removed. The order in which elements come off a stack gives rise to its alternative name, LIFO (for last in, first out). Additionally, a peek operation may give access to the top without modifying the stack.
http://gradestack.com/Microprocessors-and/Assembly-Language/STACK/19312-3912-38120-study-wtw
Subroutine
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.
Subroutines
Opcode | Operand | Description |
CALL | 16-bit | Call subroutine in conditionally located at the memory address specified by 16-bit operand. |
RET | Return unconditionally from the subroutine. |
The following types of subroutines generally are used in microprocessors:
- Multiple call subroutines
- Nested subroutines
- Multiple Ending subroutines
No comments: