The 8051 Microcontroller and Embedded

(lily) #1
Department of Computer Scien

ce and Information Engineering

National Cheng Kung University, TAIWAN

8051 HANEL
REGISTER BANKS AND STACKStack And Bank 1 Conflict(cont’)

Example 2-10Examining the stack, show the contents of the register and SP after execution of the following instructions. All value are in hex.


MOV SP, #5FH ;m

ake RAM location 60H ;first stack location

MOV R2, #25HMOV R1, #12HMOV R4, #0F3HPUSH 2PUSH 1PUSH 4
Solution:

F3 12 25
After PUSH 4 63 62 61 60 SP = 62

SP = 61

SP = 60

Start SP = 5F

25
60
25
60

60

12
61

61

61

62

62

62

63

63

63

After PUSH 1

After PUSH 2
Free download pdf