Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

Lab Evaluation -1

Adithi Narayan (CB.EN.U4CSE18205)


Roshni Rajesh (CB.EN.U4CSE18246)
1. Write an assembly language program to transfer N = --- bytes of data from
location A: ----h to location B: ---h. Let N = 05, A: 30, B: 40
Code:
ORG 0H
MOV R3, #5H
MOV R0, #30H
MOV R1, #40H
HERE:MOV A, @R0
MOV @R1, A
INC R0
INC R1
DJNZ R3, HERE
END
Input:
Output:
1. (OR PART)
Write an assembly language program to exchange N = ___h bytes of data at
location A: _____h and at location B: _____h. Let N = 05h A: 30h B: 40h
Code:
ORG 0H
MOV R3, #4H
MOV R0, #30H
MOV R1, #40H
HERE:
MOV A, @R0
XCH A, @R1
MOV @R0, A
INC R0
INC R1
DJNZ R3, HERE
END

Input:
Output:
2. Write an assembly language program to find the smallest element in a given
array of N =10h bytes at location 40h. Store the smallest element at location
50h.
Code:
ORG 0H
MOV R3, #9H
MOV R1, #40H
MOV R0, #50H
MOV A, #0FFH
MOV @R0, A
HERE:
MOV A,@R0
SUBB A, @R1
JC CHANGE
MOV A, @R1
MOV @R0, A
CHANGE:
INC R1
DJNZ R3, HERE
END
Input:
Output:

You might also like