You are on page 1of 5

Department of Compute Science & Information Technology

University of Engineering & Technology, Peshawar

Mid Term: Computer Architecture and Assembly Language Lab

Submitted By:
Muhammad Maaz Khan
19pwbcs0687
Section B

Submitted to: Ms. Aisha Javed

Q1. Multiple Choice Questions:

1. Assembler converts the programs written in assembly language into


machine instructions.
Answer: Assembler

2. The instructions like MOV and ADD is called as Op-code.


Answer: Op-code

3. Instructions which won’t appear in the object program are called as


Assembler Directives
Answer: Assembler directives

4. The directive used to perform initialization before the execution of the


code is Dataword.
Answer: Dataword

5. Reserve directive is used to specify and assign the memory required for
the block of code.
Answer: Reserve

6. The last statement of the source program should be End.


Answer: End

7. Assembly language programs are written using


Answer: Mnemonics

8. The utility program used to bring the object code into memory for
execution is Loader.
Page 1 of 5
Answer: Loader

9. In 8085 which are the 16 bit registers


Answer: Both a & b

10.How many memory locations are required to store the instruction LXIH,
0800H in an 8085 assembly language program?
Answer: 2

11.The instruction DEC N inform the assembler to


Answer: Decrement the content of N

12.Instructions performing actions in assembly language are called


Answer: Imperative statements

Q2. Write an assembly language program to print all letters as follows:


AB.........YZ

Note: To print a character on the screen you have to use the int 21h with the
service 2, the character to be printed have to be in dl. For Example, the
following code print A on the screen.

Answer:
dosseg
.model small
.stack 100h
.data
.code
main proc

mov ah,2 ; Writting it only once because it will be stored (2 in ah) for whole program unless changed

mov dl,'A'
int 21h

mov dl,'B'
int 21h

mov dl,'C'
int 21h

mov dl,'D'
Page 2 of 5
int 21h

mov dl,'E'
int 21h

mov dl,'F'
int 21h

mov dl,'G'
int 21h

mov dl,'H'
int 21h

mov dl,'I'
int 21h

mov dl,'J'
int 21h

mov dl,'K'
int 21h

mov dl,'L'
int 21h

mov dl,'M'
int 21h

mov dl,'N'
int 21h

mov dl,'O'
int 21h

mov dl,'P'
int 21h

mov dl,'Q'
int 21h

mov dl,'R'
int 21h

mov dl,'S'
int 21h

Page 3 of 5
mov dl,'T'
int 21h

mov dl,'U'
int 21h

mov dl,'V'
int 21h

mov dl,'W'
int 21h

mov dl,'X'
int 21h

mov dl,'Y'
int 21h

mov dl,'Z'
int 21h

mov ah, 4ch


int 21h
main endp
end main

Q3. Write an assembly code that writes the String “This String won't be
displayed” on the console, then clear the Console and Write instead the
following String “Hello displayed”.
Answer:
dosseg
.model small
.stack 100h
.data
string1 db "This string won't be displayed$"
string2 db "Press any key to clear screen and display string 3$"
string3 db "Hello displayed$"
.code

main proc
mov ax, @data
mov ds, ax
Page 4 of 5
mov dx, offset string1
mov ah, 09
int 21h

mov dl,10
mov ah,2
int 21h

mov dx, offset string2


mov ah,09
int 21h

mov ah,01
int 21h

mov ah,00
mov al,2
int 10h

mov dx, offset string3


mov ah,09
int 21h

mov ah,4ch
int 21h
main endp
end main

Page 5 of 5

You might also like