COA Lab Session 5
COA Lab Session 5
Objective
Pre-lab Exercise
1. Which of the following program or code category developed to reflect the procedures
used in the solution of a problem rather than be concerned with the computer
hardware behavior?
A. Binary code B. Octal code
B. Symbolic code C. High level code
2. Determine the require part of the assembly language program?
A. Label B. Operand C. Operational code D. Comment
3. What is operation code?
A. Provide a space for documentation to explain what has been done for
the purpose of debugging and maintenance
B. Symbolic names for memory address.
C. Consists of additional information or data that the OPCODE requires.
D. The name of the instruction which is to be executed.
4. From the below given assembly language program, determine the operand?
Loop: MOV CX, 4 ; Load CX with the value 4
A. MOV B. Load CX with the value 4
B. CX and 4 D. Loop
5. What is the extension of the source code of assembly program file?
A. .asm B. .exe C. .obj D. .cpp
1|Page
6. Select the true statements about assembly language and program?
A. Assembly language programs are generally the fastest programs around
B. Assembly language programs are often the smallest
C. You can do things in assembly which are difficult or impossible in HLLs
D. Your knowledge of assembly language will help you write better
programs, even when using HLLs
E. Assembly language program is not portable, machine dependent
7. A set of programs that translate the source code of assembly languages into
machine language is
A. Compiler C. Editor
B. Assembler D. IDE
8. Match the following assembly language program structure with their description
A. .MODEL (Memory Model)
B. .STACK (Stack Segment)
C. .DATA (Data Segments)
D. .CODE (Code Segment)
2|Page
In-lab Exercise
9. Write the below program using your favorite text editor and do the exercises
accordingly?
1 .model small
2 .stack 100h
3 .data
4 helloMessage db 'Hello Ethiopia!',13,10,'$'
5 .code
6 mov ax,@data
7 mov ds, ax ; set DS to point to the data segment
8
9 mov ah, 9 ; DOS print string function
10 mov dx,offset helloMessage ; point to “Hello Ethiopia!”
11 int 21h ; Display “Hello Ethiopia!”
12
13 mov ah, 4ch ; DOS terminate program function
14 int 21h ; Terminate the program
15 end
Write the program using your favorite text-editor and save the file „myfirst.asm‟ (Inside
c:/TASM/ or any path…/TASM/)
Assemble the program
o Tasm myfirst.asm
Link the program
o Tlink myfirst.obj
Run the program
o myfirst
10. Re-writing or Modifying the above source code and record the result for each exercises
A. Remove the string “ 13, 10 “ from line 4, assemble, link and run the program
B. Remove line 13 and 14, assemble, link and run the program (after recording the
result return to the original source code)
C. Declare a new variable called “helloAddis” containing “Hello Addis Ababa”
string, and assemble, link and run the program
D. Display the content of the variable “helloAddis”, and assemble, link and run the
program
E. Display the content of helloEthiopia and helloAddis variable in the same line
3|Page
Post-lab Exercise
11. Why all programs written in any other language must be translated to the binary
representation of instructions before they can be executed by the computer?
12. Assembly language provides you directly what the processor provides you, but the
processor does not provide a function like cin and cout. So how do you communicate
with the user?
4|Page