Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

What Is The Initial Value of Stack Pointer of 8086 (x86-16) CPU?

  1. What is the initial value of SS, SP, BP? Are they null (0x0) or for example does SP immediately set to 0xFFFE?

  2. When we write an assembly code without using pop and push statements does stack pointer set to a value?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

For the original 8086, see The 8086 Family Users Manual. Table 2-4 defines "CPU State Following RESET"; it shows that SS is set to 0000H. The state of general-purpose registers including SP and BP is not documented, so presumably the programmer is supposed to consider them undefined and initialize them manually.

For recent CPUs, see Intel’s Software Developer’s Manual, Volume 3A. Table 9-1 defines Processor State After Reset. SS is set to 0000H, with a base address of 00000000H, limit of FFFFH, access rights of Present, R/W, Accessed. EBP and ESP are set to 00000000H.

If you do not write any instructions that modify the stack pointer, it does not change.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading