Lab Report
Lab Report
Computer Organization & Assembly Language Lab Student Name: Bilawal Hassan
Lab Report # 04
Objectives:
The objectives of this lab report are to understand the basic assembly instructions such as MOV, XCHG,
ADD, SUB, INC, DEC, and NEG and to learn how to use them in assembly language programming.
Understanding:
Assembly language is a low-level programming language that is used to write programs for microprocessors
and microcontrollers. It is a symbolic representation of machine language, which makes it easier for
programmers to write and understand programs that run on the hardware. In assembly language programming,
instructions are written in mnemonic form, which is then translated into machine code by an assembler.
MOV (Move) instruction is used to move data from one location to another. It copies the value of the source
operand to the destination operand. For example, MOV AX, BX copies the value of BX into AX register.
XCHG (Exchange) instruction is used to exchange the values of two operands. For example, XCHG AX, BX
exchanges the values of AX and BX registers.
ADD (Addition) instruction is used to add two operands and store the result in the destination operand. For
example, ADD AX, BX adds the values of AX and BX registers and stores the result in AX register.
SUB (Subtraction) instruction is used to subtract the second operand from the first operand and store the result
in the destination operand. For example, SUB AX, BX subtracts the value of BX from AX and stores the result
in AX register.
INC (Increment) instruction is used to increment the value of the operand by 1. For example, INC AX
increments the value of AX register by 1.
DEC (Decrement) instruction is used to decrement the value of the operand by 1. For example, DEC AX
decrements the value of AX register by 1.
NEG (Negation) instruction is used to negate the value of the operand. For example, NEG AX negates the
value of AX register.
Learning/Conclusions:
In this lab report, we learned about some of the basic assembly instructions such as MOV, XCHG, ADD, SUB,
INC, DEC, and NEG. These instructions are fundamental to assembly language programming and are used
extensively in writing programs for microprocessors and microcontrollers. By understanding these instructions,
we can write efficient and effective programs that run on the hardware.