Professional Documents
Culture Documents
15cse385 - E1 - 205 - 246
15cse385 - E1 - 205 - 246
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: