100% found this document useful (1 vote)
400 views

Project in Assembly Language: Borrero, Franklin U. Agustin, Robin James C. Del Rosario, Dave Errer M. Bsit Irr1

This document contains the source code for an assembly language quiz program. It defines macros for clearing the screen, positioning the cursor, printing strings and getting user input. It contains the code for 5 multiple choice quiz questions across different procedures with logic to track the score and allow the user to continue or restart the quiz.

Uploaded by

Gally Remolacio
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
400 views

Project in Assembly Language: Borrero, Franklin U. Agustin, Robin James C. Del Rosario, Dave Errer M. Bsit Irr1

This document contains the source code for an assembly language quiz program. It defines macros for clearing the screen, positioning the cursor, printing strings and getting user input. It contains the code for 5 multiple choice quiz questions across different procedures with logic to track the score and allow the user to continue or restart the quiz.

Uploaded by

Gally Remolacio
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Project in Assembly

Language
Borrero,Franklin U.
Agustin,Robin James C.
Del Rosario, Dave Errer M.
BSIT IRR1

ASSEMBLY LANGUAGE: Cross


@gotoxy macro row,col
mov ah,02
mov dh,row
mov dl,col
int 10h
endm
@prtchar macro char,attrib,times
mov ah,09
mov al,char
mov bl,attrib
mov cx,times
int 10h
endm
.model small
.stack
.data
.code
mov ax,@data
mov ds,ax

@prtchar '+',82h,11

@prtchar '+',81h,3

@gotoxy 12,35
@prtchar '+',82h,11

@gotoxy 14,39
@prtchar '+',81h,3

@gotoxy 13,39
@prtchar '+',81h,3

@gotoxy 15,39
@prtchar '+',81h,3

@gotoxy 14,39
@prtchar '+',81h,3

@gotoxy 16,39
@prtchar '+',81h,3

@gotoxy 8,39
@prtchar '+',84h,3

@gotoxy 15,39
@prtchar '+',82h,3

mov ah,4ch
int 21h
end

@gotoxy 9,39
@prtchar '+',84h,3

@gotoxy 11,35
@prtchar '+',82h,11

@gotoxy 10,39
@prtchar '+',84h,3

@gotoxy 12,35
@prtchar '+',82h,11

@gotoxy 11,35

@gotoxy 13,39

mov ax,0003
int 10h
@gotoxy 02,37
mov ah,09
lea dx,str1
int 21h

ASSEMBLY LANGUAGE: Flags with function looping


@string macro row,col,str
mov ah,02
mov dh,row
mov dl,col
int 10h
mov ah,09
lea dx,str
int 21h
endm
@inputchar macro
mov ah,01
int 21h
endm
@color macro
row,col,char,color,times
mov ah,02
mov dh,row
mov dl,col
int 10h
mov ah,09
mov al,char
mov bl,color
mov cx,times
int 10h
endm
@clrscr macro
mov ax,0003
int 10h
endm
.model small

.stack
.data
str1 db 'FLAGS$'
str2 db 'a. GREECE$'
str3 db 'b. DENMARK$'
str4 db 'c. FRANCE$'
str5 db 'Enter your Choice: $'
str6 db 'GREECE$'
str7 db 'DENMARK$'
str8 db 'FRANCE$'
str9 db 'BACK TO MAIN? [y/n]: $'
.code
main proc
main_p proc
mov ax,@data
mov ds,ax
@clrscr
@string 02,05,str1
@string 04,10,str2
@string 05,10,str3
@string 06,10,str4
@string 07,10,str5
@inputchar
cmp al,'a'
je greece
cmp al,'b'
je denmark
cmp al,'c'
je france
jmp exit
greece:
call greece_p

jmp exit
denmark:
call den_p
jmp exit
france:
call france_p
exit:
mov ah,4ch
int 21h
ret
main_p endp
endp
greece_p proc
@clrscr
@color 02,05,'',18h,4
@color 02,09,'',7Eh,2
@color 02,11,'',18h,24
@color 03,05,'',18h,4
@color 03,09,'',7Eh,2
@color 03,11,'',18h,4
@color 03,15,'',7Eh,20
@color 04,05,'',7Eh,10
@color 04,15,'',18h,20
@color 05,05,'',18h,4
@color 05,09,'',7Eh,2
@color 05,11,'',18h,4
@color 05,15,'',7Eh,20
@color 06,05,'',18h,4
@color 06,09,'',7Eh,2

@color 06,11,'',18h,24
@color 07,05,'',7Eh,30
@color 08,05,'',18h,30
@color 09,05,'',7Eh,30
@color 10,05,'',18h,30
@string 12,15,str6
@string 15,05,str9
@inputchar
cmp al,'y'
je back
jmp exit
back:
call main_p
ret
greece_p endp
den_p proc
@clrscr
@color 02,05,'',41h,6
@color 02,11,'',7Eh,3
@color 02,14,'',41h,22
@color 03,05,'',41h,6
@color 03,11,'',7Eh,3
@color 03,14,'',41h,22
@color 04,05,'',41h,6
@color 04,11,'',7Eh,3
@color 04,14,'',41h,22
@color 05,05,'',41h,6
@color 05,11,'',7Eh,3
@color 05,14,'',41h,22
@color 06,05,'',7Eh,31
@color 07,05,'',7Eh,31
@color 08,05,'',41h,6
@color 08,11,'',7Eh,3

@color 08,14,'',41h,22
@color 09,05,'',41h,6
@color 09,11,'',7Eh,3
@color 09,14,'',41h,22
@color 10,05,'',41h,6
@color 10,11,'',7Eh,3
@color 10,14,'',41h,22
@color 11,05,'',41h,6
@color 11,11,'',7Eh,3
@color 11,14,'',41h,22
@string 13,15,str7
@string 15,05,str9
@inputchar
cmp al,'y'
je back1
jmp exit
back1:
call main_p
ret
den_p endp
france_p proc
@clrscr
@color 02,05,'',18h,10
@color 02,15,'',7Eh,10
@color 02,25,'',41h,10
@color 03,05,'',18h,10
@color 03,15,'',7Eh,10
@color 03,25,'',41h,10
@color 04,05,'',18h,10
@color 04,15,'',7Eh,10
@color 04,25,'',41h,10
@color 05,05,'',18h,10
@color 05,15,'',7Eh,10

@color 05,25,'',41h,10
@color 06,05,'',18h,10
@color 06,15,'',7Eh,10
@color 06,25,'',41h,10
@color 07,05,'',18h,10
@color 07,15,'',7Eh,10
@color 07,25,'',41h,10
@color 08,05,'',18h,10
@color 08,15,'',7Eh,10
@color 08,25,'',41h,10
@color 09,05,'',18h,10
@color 09,15,'',7Eh,10
@color 09,25,'',41h,10
@color 10,05,'',18h,10
@color 10,15,'',7Eh,10
@color 10,25,'',41h,10
@color 11,05,'',18h,10
@color 11,15,'',7Eh,10
@color 11,25,'',41h,10

@string 13,15,str8
@string 15,05,str9
@inputchar
cmp al,'y'
je back2
jmp exit
back2:
call main_p
ret
france_p endp
end main

ASSEMBLY LANGUAGE: QUIZ PROGRAM


@gotostring macro row,col,str
mov ah,02
mov dh,row
mov dl,col
int 10h
mov ah,09
lea dx,str
int 21h
endm
@inputchar macro
mov ah,01
int 21h
endm
@clrscr macro
mov ax,0003
int 10h
endm
.model small
.stack
.data
str1 db '---- QUIZ PROGRAM ----$'
str2 db 'Q1$'

str3 db 'INT 10H is the constant


value of cursor?$'
str4 db 'Q2$'
str5 db 'INT 21H Function 0CH is for
clear keyboard buffer?$'
str6 db 'Q3$'
str7 db 'MOV BL,REPEAT DELAY is
delay before start?$'
str8 db 'a. TRUE
b. FALSE$'
str9 db 'ANSWER: $'
str10 db 'REMARKS: CORRECT!$'
str11 db 'REMARKS: WRONG!$'
str12 db 'SCORE: $'
str13 db 'NEXT QUESTION[y/n]: $'
str14 db 'BACK FROM THE
START?[y/n]: $'
str15 db 'System Unit is the main
part of computer?$'
str16 db 'Software is the physical
part of a computer?$'
str17 db 'Q4$'
str18 db 'Q5$'

main_p proc
mov ax,@data
mov ds,ax
@clrscr
@gotostring 4,25,str1
@gotostring 6,18,str2
@gotostring 7,20,str3
@gotostring 9,20,str8
@gotostring 11,20,str9
@inputchar
cmp al,'a'
je tama
cmp al,'b'
je mali
jmp exit

score db 0

exit:
@gotostring 20,20,str12
mov al,score
add al,30h

.code
main proc

tama:
call tama_p
call next_p
jmp exit
mali:
call mali_p
call next_p

mov ah,02
mov dl,al
int 21h
mov ah,4ch
int 21h
endp
tama_p proc
@gotostring 15,20,str10
call score_p
ret
tama_p endp
mali_p proc
@gotostring 15,20,str11
ret
mali_p endp
next_p proc
@gotostring 17,20,str13
@inputchar
cmp al,'y'
je next
jmp exit
next:
call quest1_p
ret
next_p endp
quest1_p proc
@clrscr
@gotostring 4,25,str1
@gotostring 6,18,str4
@gotostring 7,20,str5
@gotostring 9,20,str8
@gotostring 11,20,str9
@inputchar
cmp al,'a'
je tama1
cmp al,'b'
je mali1
jmp exit
tama1:
call tama_p
call next1_p
jmp exit
mali1:
call mali_p
call next1_p
ret
quest1_p endp
next1_p proc
@gotostring 17,20,str13

@inputchar
cmp al,'y'
je next1
jmp exit
next1:
call quest2_p
ret
next1_p endp
quest2_p proc
@clrscr
@gotostring 4,25,str1
@gotostring 6,18,str6
@gotostring 7,20,str7
@gotostring 9,20,str8
@gotostring 11,20,str9
@inputchar
cmp al,'b'
je tama2
cmp al,'a'
je mali2
jmp exit
tama2:
call tama_p
call next2_p
jmp exit
mali2:
call mali_p
call next2_p
ret
quest2_p endp
next2_p proc
@gotostring 17,20,str13
@inputchar
cmp al,'y'
je next2
jmp exit
next2:
call quest3_p
ret
next2_p endp

quest3_p proc
@clrscr
@gotostring 4,25,str1
@gotostring 6,18,str17
@gotostring 7,20,str15
@gotostring 9,20,str8
@gotostring 11,20,str9
@inputchar
cmp al,'a'
je tama3
cmp al,'b'
je mali3
jmp exit

tama3:
call tama_p
call next3_p
jmp exit
mali3:
call mali_p
call next3_p
ret
quest3_p endp
next3_p proc
@gotostring 17,20,str13
@inputchar
cmp al,'y'
je next3
jmp exit
next3:
call quest4_p
ret
next3_p endp

quest4_p proc
@clrscr
@gotostring 4,25,str1
@gotostring 6,18,str18
@gotostring 7,20,str16
@gotostring 9,20,str8
@gotostring 11,20,str9
@inputchar
cmp al,'b'
je tama4
cmp al,'a'
je mali4
jmp exit
tama4:
call tama_p
call next3_p
jmp exit
mali4:
call mali_p
call next3_p
ret
quest4_p endp
next4_p proc
@gotostring 17,20,str14
@inputchar
cmp al,'y'
je next4
jmp exit
next4:
call main_p
ret
next4_p endp

score_p proc
mov al,1
add score,al
ret
score_p endp

endp
end main

You might also like