-6
\$\begingroup\$

enter image description here

Bcz of CALL, SP will be decremented by 2. Then bcz of POP, SP will get incremented by 2. So, SP will be 27FFH. But, I am confused with HL register part. Please help me with the above problem.

\$\endgroup\$
  • 1
    \$\begingroup\$ What is your confusion? Look up what 'pop h' (actually 'pop hl') does. \$\endgroup\$ – Wouter van Ooijen Dec 15 '17 at 18:15
  • 3
    \$\begingroup\$ PS Why are we regularly getting questions about 8085 assembly and not about other stone-age micro-processors? Has someone in some Indian university found a truckload of 8085 development boards? IMO nowaydays Intel (for PC) and Cortex-M (for embedded) would be more relevant. \$\endgroup\$ – Wouter van Ooijen Dec 15 '17 at 18:44
  • 1
    \$\begingroup\$ I am EEE graduate. Mostly engineers prepare for GATE (Graduate Aptitude Test in Engg) which offers high paying govt jobs and Mtech opportunities. Its syllabus has not been revised for last 20 yrs. \$\endgroup\$ – user170930 Dec 15 '17 at 19:03
  • 1
    \$\begingroup\$ @WoutervanOoijen, the oldies are simpler to see the principles in for your first steps in microprocessors. It's good to see what life's like without the modern CPU features so you can understand why they're put in. There's a similar argument for teaching the 741 op-amp and so on - the pros and cons and shortfalls are very apparent. Only for a month or so though and then on to modern CPUs, hopefully to God :-) \$\endgroup\$ – TonyM Dec 15 '17 at 20:35
  • 1
    \$\begingroup\$ @WoutervanOoijen I recently graduated college as well. They had us take a microprocessors class and we learned about the old 8-bit Motorola 68HC11. I don't know why they still teach us this stuff. However, I took a class in computer architecture that utilized MIPS Assembly. I think what they want to do with old technology is talk about very basic addressing in a chip. \$\endgroup\$ – KingDuken Dec 15 '17 at 22:27
1
\$\begingroup\$
  • SP Points to address 27FF
  • CALL occurs at 1003, So PC's current value is stored on to stack. CALL is a 3 byte instruction, means PC points to -> 1003+3 = 1006. It is stored on to Stack (decrement and store).

    27FE <- 06, 27FD <- 10 and SP now points to the top, 27FD.

  • Program control is taken to 1006 by CALL.

  • POP H will Pop values from the Stack to HL reg pair(pop and increment).

    H <- 10 , L <- 06. SP will point to 27FF.

|improve this answer|||||
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy