COAL LAB Manual 2 FAST NUCES
COAL LAB Manual 2 FAST NUCES
COAL LAB Manual 2 FAST NUCES
Laboratory Manual
for
Computer Organization and Assembly Language Programming
Page 1 of 2
Objectives
After performing this lab, students shall be able to:
Data Types
Variables are declared in memory.
Example:
; a program to add three numbers using memory
variables [org 0x0100]
num1: dw 5 ;variables
num2: dw 10
result1: dw
Page 2 of 4
Exercise 1: Write a program that swaps the value of two registers using a data label i.e.
given these initial values: ax=100, bx=200. After rotation, ax=200, bx=100.
Exercise 2: Develop an assembly program that reads 1 number each from 5 different data
labels to a register and stores their sum in some other memory location labeled as result.
Exercise 3: Move a number (6 for this question) from a memory location in AX, move 4 into
BX then find num * 4 using ADD instruction and then divide that answer by 3 using SUB
instruction. Store the results of multiplication and division (quotient) at different memory
locations labeled as “mresult” and “dresult”.
Exercise 4: Write a program to generate first 10 terms of the Fibonacci Series. The
generated terms are to be placed at memory location named “Fib” using indirect addressing
Page 3 of 4