You are on page 1of 3

Lab No 4

USMAN INSTITUTE OF TECHNOLOGY


Department of Computer Science
Computer Organization & Assembly Language – CS223

4
Instructor: Dr. Muhammad Wasim
Semester: BS – IV

Objective:

1. By initializing data segment register add two numbers and display the
result
2. Understanding of Labels in a program
3. Using labels set a loop and print all alphabets, set cx as 26

Name of Student: _____________________________________________

Roll No: ______________________________Sec. __________

Date of Experiment: ___________________________________________

Marks Obtained/Remarks: _____________________________

Signature: _____________________________

Program 1 Out put

1
Lab No 4

; This program add two numbers and display the answer


;****************************************************

DATA_SEG SEGMENT ;INITIALIZING THE DATA SEGMENT.


ONE DW 2
TWO DW 5
SUM DW ?
DATA_SEG ENDS

CODE_SEG SEGMENT

ASSUME CS:CODE_SEG, DS:DATA_SEG

;************************************************
MAIN PROC FAR ;MAIN PROGRAM STARTS HERE.

MOV AX,DATA_SEG
MOV DS,AX ;INITIALIZING THE DS REGISTER.

MOV AX,ONE
ADD AX,TWO
MOV SUM,AX

MOV DX,SUM
ADD DX,30H
MOV AH,2
INT 21H

MOV AH,04CH
INT 21H

CODE_SEG ENDS
END MAIN

Program 2 Out put


*********** Printing of Alphabets ***********
codes segment
assume cs:codes

main proc far


;Insert your program here..
mov cx,26
mov dx,'A'

printing: mov ah,2


int 21h
inc dx
loop printing
mov ah,4ch
int 21h
main endp
codes ends
end main

Student’s Tasks

2
Lab No 4

1. Print all alphabets in reverse order


2. Write a program that perform the following operations for three numbers:
- Subtraction
- Multiplication
- Division

You might also like