CH - En.u4ece21016 - Lab Report 1
CH - En.u4ece21016 - Lab Report 1
Lab Report – 1
Introduction to Assembly Language
Aim
Software Used
General Instruction
1. Addition (ADD)
2. Addition with carry (ADC)
3. Subtraction (SUB)
4. Subtraction with carry (SBC)
5. Reverse subtract (RSB)
6. Reverse subtract with carry (RSC)
7. Logical shift left (LSL)
8. Logical shift right (LSR)
9. Arithmetic shift right (ASR)
10. Rotate right (ROR)
11. Multiplication (MUL)
Addition (ADD)
Source Code
Output
Inference
Overall, the code initializes two registers, R1 and R2, with the values 8 and 4, respectively. Then
it adds the values in R1 and R2 together and stores the result in R3. After execution, the code
stops.
We can identify that R1 and R2 have the value that we designed them, and R3 contains the result
of addition,
Addition with carry (ADC)
Source Code
Output
Inference
Overall, the code initializes two registers, R1 and R2, with the values 8 and 4, respectively. Then
it performs an addition with carry operation, adding the values in R1 and R2 along with the carry
flag (if set) and stores the result in R3. Finally, the program ends.
Subtraction (SUB)
Source Code
Output
Inference
Overall, the code initializes two registers, R1 and R2, with the values 8 and 4, respectively. Then
it performs subtraction with the carry operation, subtracting the values in R1 and R2 along with
the carry flag (if set) and stores the result in R3. After execution, the code stops
Source Code
Output
Inference
Overall, the code initializes two registers, R1 and R2, with the values 8 and 4, respectively. Then
it performs a subtraction with borrow operation, subtracting the value in R2 from the value in R1
along with the borrow flag (if set), and stores the result in R3. After execution, the code stops
Source Code
Output
Inference
Overall, the code initializes two registers, R1 and R2, with the values 10 and 6, respectively.
Then it performs a reverse subtraction operation, subtracting the value in R2 from the value in
R1, and stores the result in R3. It performs R3 = R2 - R1.After execution, the code stops
Source Code
Output
Inference
Overall, the code initializes two registers, R1 and R2, with the values 8 and 4, respectively. Then
it performs a reverse subtraction with the carry operation, subtracting the value in R2 from the
value in R1 along with the carry flag (if set), and stores the result in R3. After execution, the
code stops.
Source Code
Output
Inference
Overall, the code initializes two registers, R1 and R2, with the values 8 and 4, respectively. Then
it adds the values in R1 and R2 together and performs a left shift by 3 bits on the result. Finally,
the shifted result is stored in R3, after execution the code stops.
Source Code
Output
Inference
Overall, the code initializes two registers, R1 and R2, with the values 8 and 4, respectively. Then
it adds the values in R1 and R2 together and performs a logical right shift by 2 bits on the result.
Finally, the shifted result is stored in R3, after execution, the code stops.
Source Code
Output
Inference
Overall, the code initializes two registers, R1 and R2, with the values 8 and 4, respectively. Then
it adds the values in R1 and R2 together and performs an arithmetic right shift by 2 bits on the
result. Finally, the shifted result is stored in R3, after execution the code stops.
Source Code
Output
Inference
Overall, the code initializes two registers, R1 and R2, with the values 8 and 4, respectively. Then
it adds the values in R1 and R2 together and performs a rotate right operation by 2 bits on the
result. Finally, the rotated result is stored in R3 after execution, and the code stops.
Multiplication (MUL)
Source Code
Output
Inference
Overall, the code initializes two registers, R1 and R2, with the values 8 and 4, respectively. Then
it multiplies the values in R1 and R2 together and stores the result in R3. After execution, the
code stops.
We can identify that R1 and R2 have the value that we designed them, and R3 contains the result
of addition,