CS401 Assignment No 2 Spring 2017Here you can read and Download CS401- Computer Architecture and Assembly Language Programming Assignment No 2 Spring 2017 Solution and Discussion. Assignment Total marks = 20. CS401 Assignment No 2 Deadline Date 16 May, 2017. Previously we shared CS401 Assignment No 1 Solution Spring 2017.
|CS401 Assignment No 2 Spring 2017 Solution and Discussion|
You Can Also Download CS401 Mid Term Papers,CS401 Short Notes, CS401 Assignment Solutions, CS401 Lecture Wise Questions Answers Files, CS401 Solved MCQs, CS401 Solved Quiz , CS401 Solved Mid Term Subjective Papers , CS401 Mid Term Objective Papers from Virtual Study Solutions For Preparation of Mid Term Papers.
Topic Covered in CS401 Assignment:
- Unconditional Jumps & Relative Addressing
- Bit Manipulation
- Bitwise Operations & Masking Operations
CS401 Assignment Rules for Marking
- It should be clear that your assignment would not get any credit if:
- The assignment is submitted after the due date.
- The submitted assignment does not open or file is corrupt.
- Strict action will be taken if submitted solution is copied from any other student or from the internet.
- You should consult the recommended books to clarify your concepts as handouts are not sufficient.
- You are supposed to submit your assignment in .doc or docx format.
- Any other formats like scan images, PDF, zip, rar, ppt and bmp etc will not be accepted.
CS401 Assignment NOTENo assignment will be accepted after the due date via email in any case (whether it is the case of load shedding or internet malfunctioning etc.). Hence refrain from uploading assignment in the last hour of deadline. It is recommended to upload solution file at least two days before its closing date.
If you people find any mistake or confusion in assignment (Question statement), please consult with your instructor before the deadline. After the deadline no queries will be entertained in this regard.
For any query, feel free to email at: email@example.com
CS401 Assignment Question
Marks = 20An arithmetic progression (AP) or arithmetic sequence is a sequence of numbers such that the difference between the consecutive terms (An-1& An) is constant “d”.
You are required to write assembly language code that has two different subroutines:
You will have to write a subroutine named as “A_Sequence”, which will use some local variables “ASeq” & “Ddiff”.
- Where the “Ddiff” is a data word contains Dh (0xD).
- The Arithmetic Sequence “ASeq” will start from a decimal number 3.
This subroutine will generate first 10 terms of Arithmetic Sequence (ASeq). So, Arithmetic Sequence (ASeq) will be shown as:
2 - Subroutine to find the Arithmetic Sequence Term.
You will have to write a subroutine named as “N_Term”. In this subroutine, while using the Arithmetic Sequence (ASeq) and (Ddiff) from previous subroutine, you are required to find the value of 23rd term of arithmetic sequence.
CS401 Assignment No 2 Solution Spring 2017CS401 Assignment No 2 solution
square: mov[multiplicand], AX
carryCheck: shr BX, 1jncskip
skip: shl BX, 1
shrDX,1 ; divisionby2
movAX,0x4c00 ;ending programint0x21
Download Link for CS401 Assignment No 2
Please Subscribe below or Like us on Facebook. Thank You.
Question no. 1:
(a) Assemble the following instructions and show the changes in given Accumulator register and flags after each instruction execution. (Marks 5)
MOV AL, 8Bh ; CF = ?, SF = ?, PF = ?, ZF = ?
ADD AL, 22h ; CF = ?, SF = ?, PF = ?, ZF = ?
AND Al, 1000101b ; CF = ?, SF = ?, PF = ?, ZF = ?
OR Al, 9Ah ; CF = ?, SF = ?, PF = ?, ZF = ?
XOR AL, 10101011b ; CF = ?, SF = ?, PF = ?, ZF = ?
TEST AL, 2 ; CF = ?, SF = ?, PF = ?, ZF = ?
CMP AL, 58 ; CF = ?, SF = ?, PF = ?, ZF = ?
ADC AL, 11110000b ; CF = ?, SF = ?, PF = ?, ZF = ?
SHR AL,2 ; CF = ?, SF = ?, PF = ?, ZF = ?
Question no. 1 (b): (Marks 5)
Write a subroutine that can calculate the sum of an array and also save the result into DX.
( Array’s length is 20)
Question no. 2
Write an assembly language code to calculate the factorial of “7” using a subroutine and also attach the final snapshot of your AFD window.