This project implements a 3x3 matrix calculator for the LPC2148 microcontroller using ARM assembly language. It performs matrix addition, subtraction, and multiplication through a UART-based user interface.
- Full 3x3 matrix operations (addition, subtraction, multiplication)
- Interactive UART interface (9600 baud, 8N1)
- Integer arithmetic with negative number support
- Clean, optimized ARM assembly implementation
- Support for LPC2148 microcontroller
The calculator runs on an LPC2148 microcontroller with:
- ARM7TDMI-S 32-bit RISC core
- 32KB on-chip static RAM
- 512KB on-chip flash memory
- UART interface for user interaction
R8
: Base address of Matrix AR9
: Base address of Matrix BR10
: Base address of Result Matrix- Other registers (
R0-R7
) handle temporary calculations and UART operations
The program stores matrices in the Data RAM area:
- Each matrix occupies 36 bytes (9 elements × 4 bytes per integer)
- Elements are stored in row-major order
For each element (i,j) in matrices A and B:
C[i,j] = A[i,j] ± B[i,j]
For each element (i,j) in result matrix C:
C[i,j] = 0
For k from 0 to 2:
C[i,j] += A[i,k] * B[k,j]
The program configures UART0 at 9600 baud to:
- Display prompts and results
- Accept matrix input values
- Accept operation selection (+, -, *)
- matrix.asm: Main assembly source code
To install the development environment and tools, refer to INSTALLATION.md.
For detailed usage instructions, see GUIDE.md.
- Connect to the LPC2148 via serial terminal (9600 baud, 8N1)
- Input the first 3x3 matrix when prompted
- Input the second 3x3 matrix
- Choose an operation (+, -, *)
- View the result matrix
- http://scinews.kpi.ua/article/view/205115
- https://www.gadgetronicx.com/programming-uart-tutorial-arm7/
- https://ijiet.org/papers/142-T039.pdf
- https://developer.arm.com/documentation/102159/0400/Matrix-multiplication
- https://stackoverflow.com/questions/61213188/rewritting-c-matrix-multiplication-to-arm64-assembly