Professional Documents
Culture Documents
TRANSPOSE OF A MATRIX
AIM:
To find the transpose of a matrix using 8051 microcontroller.
TOOLS REQUIRED:
Vision from Keil for an 8051 microcontroller family.
PROCEDURE:
1.Create a project in Vision. 2.Set the device to AT89C51. 3.The source code is written in the text window and is saved as .asm file. 4.Add the source file into the Source Group. 5.Build target. 6.Start the debug session. 7.Enter the data values in the source address through memory window 8.Run the program. 9.Observe the result in the memory window.
ALGORITHM:
Start
Load: Source Location Destination Location Number of rows (R) Number of columns (C)
NO
Store Next Element at destination Element Address = Row Start Address + Total Columns
Row Count = 0?
NO
PROGRAM:
ORG 0000H MOV R0,#50H MOV R1, #70H MOV R3, #3H MOV R4, #04H LOOP: MOV R6,#4H MOV A,@R0 MOV @R1, A LOOP1: INC R0 DJNZ R6, LOOP1 INC R1 DJNZ R3, LOOP MOV R3, #3H MOV A, R0 CLR C SUBB A, #4H CLR C SUBB A, #07H MOV R0, A DJNZ R4, LOOP HERE: SJMP HERE END Department Of ECE SNGCE 3
RESULT WINDOW:
Input Window:
Output Window:
RESULT:
An assembly program for finding the transpose of a matrix has been written, executed and the output has been verified.