Wednesday 8 February 2017

X86 INSTRUCTIONS:::OTHER INSTRUCTION:::STACK INSTRUCTIONS

Push instruction decrements the stack pointer and stores the data specified as the argument into the location pointed to by the stack pointer. Syntax 1 : push arg Pop instruction loads the data stored in the location pointed to by the stack pointer into the argument specified and then increments the stack pointer. Syntax 2 : pop arg Example : mov eax, 5 mov ebx, 6 push eax #The stack is now: [5] push ebx #The stack is now: [6] [5] /*The topmost item (which is 6) is now stored in eax. The stack is now: [5]*/ pop eax #ebx is now equal to 5. The stack is now empty. pop ebx Pushf instruction decrements the stack pointer and then loads the location pointed to by the stack pointer with the contents of the flag register. Syntax 1 : pushf Popf instruction loads the flag register with the contents of the memory location pointed to by the stack pointer and then increments the contents of the stack pointer. Syntax 2 : popf Pusha instruction pushes all the general purpose registers onto the stack in the following order: AX, CX, DX, BX, SP, BP, SI, DI. The value of SP pushed is the value before the instruction is executed. It is useful for saving state before an operation that could potential change these registers. Syntax 1 : pusha Popa instruction pops all the general purpose registers off the stack in the reverse order of PUSHA. That is, DI, SI, BP, SP, BX, DX, CX, AX. Used to restore state after a call to PUSHA. Syntax 2 : popa Pushad instruction works similarly to pusha, but pushes the 32-bit general purpose registers onto the stack instead of their 16-bit counterparts. Syntax 1 : pushad Popad instruction works similarly to popa, but pops the 32-bit general purpose registers off of the stack instead of their 16-bit counterparts. Syntax 2 : popad

No comments:

Post a Comment

"Exploring the Intersections: Insights into Exam Prep, Science, Business,Tech,Web-dev,Admin&Health

काबिज नजूल : आबादी भूमि पर बने मकान को विक्रय करते समय बिक्रीनामा तैयार करने की प्रक्रिया-Occupied Nazul or populated land

काबिज नजूल अथवा आबादी भूमि पर बने मकान को विक्रय करते समय बिक्रीनामा तैयार करने की प्रक्रिया:   1. दस्तावेज इकट्ठा करना: विक्रेता और खरीदार ...