0% found this document useful (0 votes)
25 views3 pages

Assignment No. 1 Graded: Semester Spring 2016 Computer Architecture and Assembly Language Programming - CS401 Objective

This assignment asks students to write assembly language programs to find the smallest and largest numbers in two arrays. It is worth 20 total marks, with the first question worth 10 marks and the second worth 10 marks. Students are instructed to write the program, explain each instruction, and provide a screenshot of the program running in a debugger showing the result. The document provides the arrays of numbers and notes that copied answers will not be awarded marks.

Uploaded by

Capri Corn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views3 pages

Assignment No. 1 Graded: Semester Spring 2016 Computer Architecture and Assembly Language Programming - CS401 Objective

This assignment asks students to write assembly language programs to find the smallest and largest numbers in two arrays. It is worth 20 total marks, with the first question worth 10 marks and the second worth 10 marks. Students are instructed to write the program, explain each instruction, and provide a screenshot of the program running in a debugger showing the result. The document provides the arrays of numbers and notes that copied answers will not be awarded marks.

Uploaded by

Capri Corn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 3

Assignment No.

1
Graded

Total Marks: 20

Semester Spring 2016


Computer Architecture and Assembly Language
Programming CS401

Due Date: 16 May,2016

Objective:
The assignment has been designed to enhance your knowledge about how to write assembly program using
branching.
Student id= 150400903

Question: 1

[20 Marks]

Write an assembly language program to find the smallest number from an array of following ten numbers.
Explain each instruction of program and also provide/paste snapshot of your assemble and debug program
result which will be run in AFD (A Full Screen Debugger) window showing the executed code final results in
AX register.
Numbers :
20, 50, 30, 14, 19, 3, 5, 6, 40, 8
Answer
[ORG 100h]
JMP START
Num: DW 20, 50, 30, 14, 19, 3, 5, 6, 40, 8
L2: MOV AX, SI ; Save Small number in AX
ADD BX, 2 ; bx +=2; Point to next character
RET
START:
MOV BX, 0
MOV AX, 0
MOV AX, [Num + BX]
MOV CX, 10
L1: CMP AX , [Num + BX]
JLE L2
MOV AX, [Num +BX] ;
L3: ADD BX, 2
Loop L1 ; Poinyt next Numbetr
MOV AX, 0x4*00
INT 0*21

[Program:5, Explantion:3,Snashot:2]

Question: 2
Write an assembly language program to find the largest number from an array of following ten numbers.
Explain each instruction of program and also provide/paste snapshot of your assemble and debug program
result which will be run in AFD (A Full Screen Debugger) window showing the executed code final results in
AX register.
Numbers :

10, 40, 20, 14, 19, 13, 50, 6, 60, 14

[Program:5, Explantion:3,Snashot:2]

Note: Provide snapshot of your program which will be run in AFD window. You will not get any marks for
copied assignment.
Answer
[org 0x0100]
jmp start;
array1: dw 10, 40, 20, 14, 19, 13, 50, 6, 60, 14
max:
dw 0
start:
mov bx, 0;
mov ax, 0;
mov ax, [array1+bx];
mov cx, 10
top2: cmp ax, [array1+bx];
jge end2;
mov ax, [array1+bx];
end2:
add bx, 2;
loop top2
mov [max],
ax;
mov ax, 0x4c00;
int 0x21

You might also like