Chapter 13 Flashcards
What is bubble sort
It can sort almost anything in computer.
What is execution thread
Step by step instructions connected to each other
What is rbt command
come back where we start diversion
What is int and iret
int = instruction iret = return from instruction
What is temporary division
There are roundabouts on roads as well that take us back from where we started after having traveled on the boundary of the round. This is the concept of a temporary diversion.
What are 2 types of instructions diversion
temporary
permanently
What instructions are for permanent diversion
jump
What instructions are for temporary diversion
call
What is RET
It is return. It takes no arguments and transfers control back to the instruction following the CALL that took us in this subroutine
What register is used for the top of stack
Stack pointer (SP)
How we can get the physical address of stack
SS:SP combination
What is the behavior of SP when stack is pushed
decremented by two
Can we push or pop single byte in stack
No
What is the difference between push and call in stack
Regarding the stack, the operation of PUSH is similar to CALL however with a register other than the instruction pointer.
What is the behavior of SP when stack is pop
incremented by two
What register is not modified during sub routine
BX
Does operand of PUSH is called a source and operand of POP called destination
Yes
What is role of SP in direct call
SP decremented by two
What is the role of SP in RET
incremented by two
What is the maximum number of parameters a sub-routine can receive
seven
Can we use stack pointer in effective address
No
Stack should be clear by caller or callee
callee
What is stack overflow
If the stack is not cleared or is partially cleared the stack will eventually become full, SP will reach 0, and thereafter wraparound producing unexpected results. This is called stack overflow.
What is unit of stack operation
word
What is local variable
Another important role of the stack is in the creation of local variables that are only needed while the subroutine is in execution and not afterwards. They should not take permanent space like global variables. Local variables should be created when the subroutine is called and discarded afterwards. So that the spaced used by them can be reused for the local variables of another subroutine. They only have meaning inside the subroutine and no meaning outside it.
The most convenient place to store these variables is the stack. The swapflag we have declared as a word occupying space permanently is only needed by the bubble sort subroutine and should be a local variable. The stack pointer will be decremented by an extra two bytes thereby producing a gap in which a word can reside. This gap will be used for our temporary, local, or automatic variable. mov and push command can start the process of such sub routine.