You are on page 1of 2

Experiment No: 5

Aim: Understand the architecture of 8051 microcontroller and the Integrated

Development Environment (IDE) software called Keil μvision

1. Write Instructions to use the registers of bank 3, and load the same

value 05H in the registers R0 toR3.

Program:-

org 00h

mov psw, #18h ;selection of bank 3

mov r0, #05h ;mov value 5 into r0 register

mov r1, #05h ;move value 5 into r1 register

mov r2, #05h ;move value 5 into r2 register

mov r3, #05h ;move value 5 into r3 register

end

Result:

2. Exchange contents of memory location 21H and 22H using PUSH and POP.

Program:

org 0000h
PUSH 21h ;Push content stored in 21H in stack segment

PUSH 22h ;Push content stored in 22H in stack segment

POP 21h ;Retrieve value of 22H and copy in 21h

POP 22h ;Retrieve value of 21H and copy in 22H

end

Result:

You might also like