REPUBLIC OF YEMEN
SANA'A UNIVERSITY
FACULTY OF ENGINEERING
MECHATRONICS ENGINEERING
DEPARTMENT
Assembly project
Supervised by:
Prepared by: Eng: Mohammed Al-Ramadi
Ma'amoun Hamza Al-Bazeli
AC.NO: 202474018
2025
Mental
Purpose / Abbreviation /
Line Image /
Why? Explanation
Example
Start loading Like starting
the program ORG = origin, a drawing at
org 100h at the correct starting point of point
COM code (100h,0) on
address a paper
Specify
program Like a small
.model small
small = small
model: small room for
code + data
segment one person
(data + code)
Reserve 256 stack = Like a small
.stack 100h bytes for the temporary drawer to
stack storage area keep tools
DB = Define Store a
header DB "- Assembly Exam - Define Byte, 0Dh=CR, message as
",0Dh,0Ah,"*************************",'$' welcome text 0Ah=LF, $=end bytes in
of string memory
Like
NEWLINE DB 10,13,"$"
Define a new 10=LF, 13=CR, pressing
line $=end of string Enter on the
screen
Instruction
DB = define "Type y or
yes_or_no DB ...
message
byte, $ = end of n" appears
before each
string on screen
question
Store
q1, q2, q3 DB ...
Text of the DB = define question as
questions byte a string of
characters
Message
"Number of
correct DB ...
before DB = define
correct
displaying byte
answers:"
result
For easy
Messages
allright, noright DB ...
DB = define printing
based on test
byte based on
result
score
Load the Like taking
mov ax,@data
AX = general-
starting the key to a
purpose register
address of box
Mental
Purpose / Abbreviation /
Line Image /
Why? Explanation
Example
data segment
into AX
Set DS DS =
mov ds,ax
register to DS = Data location to
point to data Segment read data
segment from
Imagine a
Select DOS
MOV AH,09H
AH=09h = Print "display
function to
String message"
print string
button
Like
Load the
LEA = Load locating the
LEA DX,header
address of
Effective page
the text into
Address address on
DX
paper
DOS
Call DOS
INT 21H
executes a
routine (print INT = Interrupt
special
or read)
service
Initialize
Score
mov bl,0
correct BL = small
counter
answers register
starts from 0
counter
Select DOS
function to
Waiting for
mov ah,1
read a AH=01h = Read
user to press
character char
a key
from
keyboard
DOS
int 21h
Call DOS executes
INT = Interrupt
function reading a
character
Compare the
Asking: "Is
cmp al,'y'
entered CMP =
the answer
character Compare
'y'?"
with 'y'
If answer is
Jump to a
jne q1_worng
wrong, jump JNE = Jump if
location if
to label Not Equal
the
q1_wrong
Mental
Purpose / Abbreviation /
Line Image /
Why? Explanation
Example
condition is
false
Increment
Add 1 point
inc bl
correct INC =
to the
answers Increment
counter
count
Copy correct Prepare the
mov cl, bl
CL = small
answers number for
register
count to CL printing
Convert Number 3
add bl, 48 number to 48 = '0' → character
ASCII '3'
DOS Imagine
MOV ah,02H
function to printing one
AH=02h
print a single character on
character screen
Like
Put the
mov dl,bl
DL = character sending the
character to
to print character to
print into DL
the printer
DOS
INT 21H
Call DOS
INT = Interrupt executes
function
printing
Check if all
cmp cl,3
CMP = Are the
answers are
Compare points = 3?
correct
If yes, jump Jump to
je all_correct
JE = Jump if
to all_correct correct
Equal
message message
Imagine
mov ah,4Ch
Terminate AH=4Ch = Exit pressing
the program Program STOP for
the program
Call DOS
int 21h
DOS closes
function to INT = Interrupt
the program
exit