Microcontroller Assign PDF
Microcontroller Assign PDF
NAME: RUHULLAH
SERIAL NUMBER: 55
MAIN:
DELAY:
DELAY_LOOP1:
DELAY_LOOP2:
END
2. Program to Sort an Array in Ascending Order o Store a set of
numbers in an array and sort them in ascending order using the Bubble
Sort algorithm.
MAIN:
OUTER_LOOP:
INNER_LOOP:
COMPARE:
DEC R0
MOV @R0, B
INC R0
NO_SWAP:
CJNE R3, #00H, OUTER_LOOP ; If swap flag is set, repeat outer loop
END
3. Program to Sort an Array in Descending Order o Modify the previous
program to sort the array in descending order.
MAIN:
OUTER_LOOP:
INNER_LOOP:
COMPARE:
DEC R0
MOV @R0, B
INC R0
NO_SWAP:
CJNE R3, #00H, OUTER_LOOP ; If swap flag is set, repeat outer loop
END
4. Program to Find the Largest Number in an Array o Store 10 numbers
in an array and find the maximum value among them.
MAIN:
DEC R1 ; Decrement R1
FIND_MAX:
COMPARE:
NO_UPDATE:
END
5. Program to Find the Smallest Number in an Array o Store 10
numbers in an array and find the minimum value among them.
MAIN:
DEC R1 ; Decrement R1
FIND_MIN:
COMPARE:
NO_UPDATE:
END
6. Program to Reverse a String o Store a string in memory and write a
program to reverse it.
MAIN:
FIND_LENGTH:
REVERSE:
END