CS401 Assignment 2 Paid Solution 2024 with VU SAWAIRA SHINE

CS401 Assignment 2 Paid Solution 2024 with VU SAWAIRA SHINE

 

Download Latest All Books Midterm Past Papers virtual university of Pakistan



  CS401 Assignment 2 Paid Solution 2024 Download, We are providing the latest virtual university Midterm Past Papers short notes in PDF to facilitate students in their studies. Short Notes covered most of the main topics from handouts and lectures.
“As you know, most students prepare these
Midterm Past Papers to clear concepts and study smart in an easy way.
 
This note explains very importantly long and short questions, MCQS with their answers, lecture concept, and details covered in provided short notes.
Short notes are arranged according to VU subjects. Easy to download yours subjects most important short notes that help you in virtual university exams.

 

Dear Students Here we Provided Virtual University  All Books Short Notes Assignment Solutions  PDF Updated & Highlighted at one place according to subjects. Download the latest VU Handouts in your required subject. Download virtual university all subjects Handouts, handouts mean a document given to students that contains information about a particular subject, so here I will provide you with Virtual University All Subjects Handouts in PDF Format. But at this page you will get all subjects or courses handouts. After a huge research, these handouts are designed to help you people in such way that will help you to get more than 75% marks Insha’Allah. DOWNLOAD THE Latest Vu Assignment Solutions in your required subjects.

 


Computer Architecture and Assembly Language Programming (CS401)

Assignment No.2

Total marks = 20

Deadline Date:

June26, 2024

 

Please carefully read the following instructions before attempting 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 are supposed to submit your assignment in .doc or docxformat.

Any other formats like scan images, PDF, zip, rar, ppt and bmp etc. will not be accepted.

Lectures covered: 11-21

Topicscovered:Subroutines, Stack and its Operations, Parameter Passing Through Stack and Local Variables, Display Memory, Screen Location Calculation, Clearing the Screen and String Printing

 

NOTE

No assignment will be accepted after the due date via email in any case (whether it is the case of load shedding or internet malfunctioning). Hence refrain from uploading assignment in the last hour of the deadline. It is recommended to upload your solution file at least two days before its closing date.

If you find any mistake or confusion in the assignment (Question statement), please contact your instructor before the deadline. After the deadline, no queries will be entertained in this regard.

For any query, feel free to email atcs401@vu.edu.pk

 


 

Problem statement:

You are required to complete/modify the given assembly language codeby:

a)      Modifying the clrscr subroutine to clear the screen with Green background.

b)      Writing the missing code for printstr subroutine which takes as parameters screen location (Top-right), attribute byte (last non-zero digit of your VUID), your VUID and its length.

Note: You must use your own VUID and modify the provided code. Writing the completely different code or using any other VUID will result in Zero marks.

Code:

; Modifying clrscr subroutine to clear the screen with Green background and

; Printing VUID at top right corner with attribute byte value as last non-zero digit of VUID

[org 0x0100]

 jmp start

message: db 'BC250212345' ; YOUR VUID TO BE PRINTED

length: dw 11 ; length of the message

 

; Modify clrscr subroutine to clear the screen with Green background

clrscr: push es

 push ax

 push di

mov ax, 0xb800

 mov es, ax ; point es to video base

 mov di, 0 ; point di to top left column

nextloc: mov word [es:di], 0x0720 ; clear next char on screen

 add di, 2 ; move to next screen location

 cmp di, 4000 ; has the whole screen cleared

 jne nextloc ; if no clear next position

 pop di

 pop ax

 pop es

 ret

 

; subroutine to print a string

; takes x position, y position, string attribute, address of string

; and its length as parameters

printstr: push bp

 mov bp, sp

 push es

 push ax

 push cx

 push si

 push di

;;; WRITE YOUR CODE HERE ;;;

 

pop di

 pop si

 pop cx

 pop ax

 pop es

 pop bp

 ret 10

;;; END of printstr CODE ;;;

 

start: call clrscr ; call the modified clrscr subroutine

 

 mov ax, 30 ; PUT X POSITION VALUE TO PRINT VUID ON TOP RIGHT CORNER

 push ax ; push x position

 mov ax, 20 ; PUT Y POSITION VALUE TO PRINT VUID ON TOP RIGHT CORNER

 push ax ; push y position

 mov ax, 5 ; LAST NON-ZERO DIGIT OF YOUR VUID AS THE ATTRIBUTE

 push ax ; push attribute

 mov ax, message

 push ax ; push address of message

 push word [length] ; push message length

 

 call printstr ; call the printstr subroutine

 

 mov ax, 0x4c00 ; terminate program

 int 0x21

 

Submission details:

Following are required in a single MS-Word document.

a)      Complete/ModifiedAssembly language program.

b)      Screenshot showing the results.

Sample screenshot:



Step 1

You can see  file PDF Given below

Step 2

Select Your File and Click to Download

 

 

 

 

CS401 Assignment solution 2024

350 Paid File

 

Post a Comment

0 Comments