You are on page 1of 5

COURSE CODE IAS2123

COURSE NAME Computer Organization


SEMESTER November 2023
SESSION 22334
LECTURER Madam Roziyani Setik
ASSESSMENT TYPE Assignment -CLO3
DUE DATE FOR SUBMISSION Week 7
MODE OF ASSESSMENT Group of 2 persons
(GROUP OR INDIVIDUAL)
NAME OF CANDIDATES 1.Ahmad Haziq Fikri bin Mohd Yusof
(4223005161)

2.Muhammad Alif Iman bin Mokhdir


(4223004781)

COURSE LEARNING OUTCOME


CLO 3: At the end of the course the student will be able to verify the function of pipelining, memory
systems, I/O systems and interface them to the microprocessors. (C5, PLO2)

QUESTION 1

Create ONE project using an Assembly Language code for the following situation.

i) Welcoming wishes for users of your program. It should greet with any four (4) strings of BYTE
values in an array that expressing current situation in your workspace. All strings should be
present in different colors. Repeat the output 3 times.
ii) Create a multiplication program for 5 integers using style no 2. Print the output as a decimal.

END OF QUESTIONS
ANSWER
THE CODING :
TITLE MultiplyColorStyle2

INCLUDE Irvine32.inc
.data

welcomeStrings BYTE "Welcome to the Program!",0


str1 BYTE "This is the assembly language example.",0
str2 BYTE "Have a great time coding!",0
str3 BYTE "Repeat this message 3 times.",0
str4 BYTE "Press Enter to exit...", 0
Prompt1 BYTE "Enter integer number 1 ? ", 0
Prompt2 BYTE "Enter integer number 2 ? ", 0
Prompt3 BYTE "Enter integer number 3 ? ", 0
Prompt4 BYTE "Enter integer number 4 ? ", 0
Prompt5 BYTE "Enter integer number 5 ? ", 0
Message BYTE "The Product is: ", 0
x SDWORD ?
y SDWORD ?
z SDWORD ?
n SDWORD ?
t SDWORD ?
Product SDWORD ?

.code

main PROC

mov eax, white + (red * 16)


mov ecx, 3

L1:
call SetTextColor
mov edx, OFFSET welcomeStrings
call WriteString
call Crlf
mov edx,OFFSET str1
call WriteString
call Crlf
mov edx,OFFSET str2
call WriteString
call Crlf
mov edx,OFFSET str3
call WriteString
call Crlf

add eax, 4
loop L1

mov edx, OFFSET Prompt1


call WriteString
call ReadInt
mov x, eax

mov edx, OFFSET Prompt2


call WriteString
call ReadInt
mov y, eax
mov edx, OFFSET Prompt3
call WriteString
call ReadInt
mov z, eax

mov edx, OFFSET Prompt4


call WriteString
call ReadInt
mov n, eax

mov edx, OFFSET Prompt5


call WriteString
call ReadInt
mov t, eax

mov eax, x

cdq
imul y
imul z
imul n
imul t
mov Product, eax

mov edx, OFFSET Message


call WriteString
mov eax, Product
call WriteDec
call Crlf
exit

main ENDP
END main
THE OUTPUT :

You might also like