Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Pro Blog
  • Users
  • Groups
  • Unsolved
  • Solved
Collapse
Secnto AI
  1. Secnto AI
  2. Categories
  3. Virtual University
  4. CS401 - Computer Architecture and Assembly Language Programming
  5. CS401 Assignment 3 Solution and Discussion
CS401 GDB 1 Solution and Discussion
zareenZ zareen

Q. In the last 60 years, computer processors have been evolving and processing speed has increased multiple times. Increasing processor speed along with increasing the number of processing cores has been the major trend. As a computer architect, we have an option of either increasing the number of cores to achieve better performance or increasing the processing speed of a single processor.

What would be your choice to go with in the prevailing scenario keeping in view the pros and cons of each approach? Provide logical reasoning in either case.

CS401 - Computer Architecture and Assembly Language Programming
2 Posts
0 Votes
CS401 Assignment 2 Solution and Discussion Spring 2020
Wajahat AliW Wajahat Ali

Re: CS401 Assignment 2 Solution and Discussion

CS401 Computer Architecture and Assembly Language Programming Assignment 2 Solution & Discussion Spring 2020

Computer Architecture and Assembly Language Programming (CS401)

Assignment # 02

Total marks = 20 Deadline Date June 12th, 2020

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 should concern 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.

Topic Covered:

Addressing Modes

Branching

Subroutines

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 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 protected]

Q1. Write a subroutine that will take two arrays Array1 & Array2. Array1 will contain uppercase alphabets from A-M and the Array2 will contain lower case alphabets from n-z. Your subroutine should work in such a way that it will convert array1 elements to lower case and array2 elements to uppercase and populate them in a 3rd array. (Marks 20)

For example:

Array1 = A,B,C,D,E,F,G,H,I,J,K,L,M

Array2= n,o,p,q,r,s,t,u,v,w,x,y,z

Output should be:

Array3= a,b,c,d,e,f,g,h,I,j,k,l,m,N,O,P,Q,R,S,T,U,V,W,X,Y,Z

Note: You can consult to alphabet’s ASCII values through this link:

CS401 - Computer Architecture and Assembly Language Programming
2 Posts
0 Votes
CS401 Assignment 1 Solution and Discussion Spring 2020
zaasmiZ zaasmi

Re: CS401 Assignment 1 Solution and Discussion

Computer Architecture and Assembly Language Programming (CS401)
Assignment # 01
Total marks = 20

Deadline Date
June 1, 2020

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 should concern 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.
Topic Covered:
• Segmented Memory Model
• Addressing Modes
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 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 protected]

Q 1. Calculate the effective address for the following set of values. (5)
Code Segment = 6032h
BX = 3060h
DI = 4001h
Offset = 0470h

Q 2. Find the physical Address, if segment address is FF01H and offset is FF02H.(7)

Q 3. Calculate the offset when the physical address is 003Ch and the contents of segment register are 003Ah. (8)

“The End”

CS401 - Computer Architecture and Assembly Language Programming
4 Posts
0 Votes
CS401 Assignment 2 Solution and Discussion
zareenZ zareen

Computer Architecture and Assembly Language Programming (CS401)
Assignment # 02
Total marks = 20

Deadline Date
Nov 26, 2019

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 should concern 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.
Topic Covered:
• Addressing Modes
• Branching
• Subroutines•
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 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 protected]

Q1. Write a subroutine that will find the first even number from an array of your VU ID and calculate its factorial. (10 Marks)

Note: Skip 0’s in your VU ID as shown below,
VU ID: BC190206435
After skipping 0’s, array would be:
Array: 1, 9, 2, 6, 4, 3, 5
The first even number is 2 in the array so its factorial will be calculated and saved in AX register.

Q2. Write a code in assembly language (using appropriate jumps) equivalent to this given code in C. (10 Marks)

#include <stdio.h>
int main()
{
    int n1=1, n2=2;
    int largest;
    if( n1>n2)
        largest=n1;
else
        largest = n2;
    return 0;
}

“The End”

CS401 - Computer Architecture and Assembly Language Programming
3 Posts
0 Votes
CS401 Assignment 3 Solution and Discussion
zareenZ zareen

Computer Architecture and Assembly Language Programming (CS401)
Assignment # 03
Total marks = 20

Due Date:
January 20, 2020
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 should concern 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.
Topic Covered:
• BIOS VIDEO SERVICES AND GRAPHICS MODE SERVICES
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 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 protected]

Question Statement
Suppose we want to draw a square on our computer screen as shown below.
9dfcc405-cdf8-404b-a47f-e45d9e9976c0-image.png
You are required to write an assembly language program to draw a square as given above using video interrupts.
Note:
a. Upper horizontal line must be Green
b. Lower horizontal line must be blue
c. Left vertical line must be PINK
d. Right vertical line must be Gray.

“The End”

CS401 - Computer Architecture and Assembly Language Programming
3 Posts
0 Votes
CS401 Assignment 1 Solution and Discussion
zareenZ zareen
Computer Architecture and Assembly Language Programming (CS401)

Total marks = 20
Due Date:
November 14, 2019
Assignment # 01
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 should concern 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. Topic Covered:
 Basic DOSBox and NASM understanding to run assembly code
 Various Addressing modes to access memory
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 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

Problem Statement:
Save your complete VUID in memory using Base Register Indirect + Offset addressing mode (if last digit of your VUID is Odd) or Indexed Register Indirect + Offset addressing mode (if last digit of your VUID is even).
Detailed Instructions:
This assignment will give hands on experience of how to run assembly language code using DOSBox and NASM. First, you have to define labels for storing your VUID and then store each alphabet/digit of VUID, step by step, in to any general purpose registers. Finally, store the alphabet/digit from general purpose register to respective memory location (which you have defined by label in above step).
Addressing Modes to use:
In order to access VUID and storing it in memory, you have to use ONE of the following addressing modes:
 Base Register Indirect + Offset (only if last digit of your VUID is Odd)
 Indexed Register Indirect + Offset (only if last digit of your VUID is Even)
NOTE: Zero marks will be awarded, if you do not follow proper addressing mode.
What to Submit:
After writing your code, open DOSBox and run NASM (as described in video tutorial shared in Announcement page of this course). Assemble the code using nasm command and take screenshot. After that, open the COM file in debugger (AFD).
Run your code by pressing F1 key until last statement of code is reached. At this stage, Data Window # 2 of AFD should display your complete VUID (at consecutive locations; see below example). Also take screenshot of AFD.
Your assignment must be submitted as a SINGLE WORD document (DOC or DOCX) with:

  1. Code written in Word
  2. Screenshot of compilation step (DOSBox)
  3. Screenshot of AFD
    NOTE: When you take screenshot of compilation step and AFD, take screenshot of whole screen, not of DOSBox and AFD. Cropping or any tempering with screenshot will result in ZERO marks.

Example:
Suppose a student VUID is BC123456789. The last digit of this VUID is 9 which is an Odd number. So, this student will use Base Register Indirect + Offset addressing mode to solve this assignment.
Sample screenshot of final output:
Note that Data Window # 2 is showing student VUID:

463f2031-23ba-4a9a-9aa8-96ca3153d5ee-image.png
Helping Material:
 Detailed video tutorial of how to use DOSBox and NASM is already shared with you in Announcement page of this course
 Command to manipulate Data Windows of AFD is mentioned in AFD tutorial (link is given in the same Announcement)
 Use ASCII table for first two alphabets of your VUID

CS401 - Computer Architecture and Assembly Language Programming
4 Posts
0 Votes

CS401 Assignment 3 Solution and Discussion

Scheduled Pinned Locked Moved Solved CS401 - Computer Architecture and Assembly Language Programming
cs401assignment 3solutiondiscussionfall 2019
3 Posts 1 Posters 1.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • zareenZ Offline
    zareenZ Offline
    zareen
    Cyberian's Gold
    wrote on last edited by
    #1

    Computer Architecture and Assembly Language Programming (CS401)
    Assignment # 03
    Total marks = 20

    Due Date:
    January 20, 2020
    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 should concern 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.
    Topic Covered:
    • BIOS VIDEO SERVICES AND GRAPHICS MODE SERVICES
    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 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 protected]

    Question Statement
    Suppose we want to draw a square on our computer screen as shown below.
    9dfcc405-cdf8-404b-a47f-e45d9e9976c0-image.png
    You are required to write an assembly language program to draw a square as given above using video interrupts.
    Note:
    a. Upper horizontal line must be Green
    b. Lower horizontal line must be blue
    c. Left vertical line must be PINK
    d. Right vertical line must be Gray.

    “The End”

    Discussion is right way to get Solution of the every assignment, Quiz and GDB.
    We are always here to discuss and Guideline, Please Don't visit Cyberian only for Solution.
    Cyberian Team always happy to facilitate to provide the idea solution. Please don't hesitate to contact us!
    %(red)[NOTE: Don't copy or replicating idea solutions.]
    Quiz Copy Solution
    Mid and Final Past Papers
    Live Chat

    1 Reply Last reply
    0
    • zareenZ Offline
      zareenZ Offline
      zareen
      Cyberian's Gold
      wrote on last edited by zareen
      #3
      [ORG 0X0100]
      start: mov ax, 0x000D     					
      	int 0x10
      	mov ax, 0x0C02					
      	xor bx, bx
      	mov cx, 100
      	mov dx, 60
      l1: int 0x10							
      	inc cx
              cmp cx, 200
              jne l1
      	mov cx, 100
      	mov dx, 60
      l2: int 0x10							
      	mov ax, 0x0C05
              inc dx
              cmp dx, 120
              jne l2
      	mov cx, 200
      	mov dx, 60
      l3: int 0x10 							
      	mov ax, 0x0C08
              inc dx
              cmp dx, 120
              jne l3
      	mov cx, 100
      	mov dx, 120
      l4: int 10h							
      	mov ax, 0x0C09
              inc cx
              cmp cx, 200
              jne l4
      	mov ah, 0 
      	int 0x16
      	mov ax, 0x0003 
      	int 0x10
              mov ax, 0x4C00
      int 0x21
      
      

      Discussion is right way to get Solution of the every assignment, Quiz and GDB.
      We are always here to discuss and Guideline, Please Don't visit Cyberian only for Solution.
      Cyberian Team always happy to facilitate to provide the idea solution. Please don't hesitate to contact us!
      %(red)[NOTE: Don't copy or replicating idea solutions.]
      Quiz Copy Solution
      Mid and Final Past Papers
      Live Chat

      1 Reply Last reply
      0
      • zareenZ Offline
        zareenZ Offline
        zareen
        Cyberian's Gold
        wrote on last edited by zareen
        #2

        https://www.youtube.com/watch?v=CptbsQlNA98

        Idea Solution code:

                                                                   name "vga"
        
        ; this program draws a square in vga mode.
        
        org  100h
        
        jmp code
        
        ; dimensions of the square:
        ; width:  50 pixels
        ; height: 50 pixels
        
        w equ 50
        h equ 50
        
        
        ; set video mode 13h - 320x200
        
        code:   mov ah, 0
                mov al, 13h
                int 10h
        
        
        ; draw upper line:
        
            mov cx, 100+w  ; column
            mov dx, 20     ; row
            mov al, 0010     ; green
        u1: mov ah, 0ch    ; put pixel
            int 10h
           
            dec cx
            cmp cx, 100
            jae u1
        
        ; draw bottom line:
        
            mov cx, 100+w  ; column
            mov dx, 20+h   ; row
            mov al, 0001     ; blue
        u2: mov ah, 0ch    ; put pixel
            int 10h
           
            dec cx
            cmp cx, 100
            ja u2
        
        ; draw left line:
        
            mov cx, 100    ; column
            mov dx, 20+h   ; row
            mov al, 35      ; pink
        u3: mov ah, 0ch    ; put pixel
            int 10h
           
            dec dx
            cmp dx, 20
            ja u3
           
           
        ; draw right line:
        
            mov cx, 100+w  ; column
            mov dx, 20+h   ; row
            mov al, 20    ; gray
        u4: mov ah, 0ch    ; put pixel
            int 10h
           
            dec dx
            cmp dx, 20
            ja u4    
        
        
        ; pause the screen for dos compatibility:
        
        ;wait for keypress
          mov ah,00
          int 16h   
        
        ; return to text mode:
          mov ah,00
          mov al,03 ;text mode 3
          int 10h
        
        
        
        ret
        
        

        Discussion is right way to get Solution of the every assignment, Quiz and GDB.
        We are always here to discuss and Guideline, Please Don't visit Cyberian only for Solution.
        Cyberian Team always happy to facilitate to provide the idea solution. Please don't hesitate to contact us!
        %(red)[NOTE: Don't copy or replicating idea solutions.]
        Quiz Copy Solution
        Mid and Final Past Papers
        Live Chat

        1 Reply Last reply
        0
        • zareenZ Offline
          zareenZ Offline
          zareen
          Cyberian's Gold
          wrote on last edited by zareen
          #3
          [ORG 0X0100]
          start: mov ax, 0x000D     					
          	int 0x10
          	mov ax, 0x0C02					
          	xor bx, bx
          	mov cx, 100
          	mov dx, 60
          l1: int 0x10							
          	inc cx
                  cmp cx, 200
                  jne l1
          	mov cx, 100
          	mov dx, 60
          l2: int 0x10							
          	mov ax, 0x0C05
                  inc dx
                  cmp dx, 120
                  jne l2
          	mov cx, 200
          	mov dx, 60
          l3: int 0x10 							
          	mov ax, 0x0C08
                  inc dx
                  cmp dx, 120
                  jne l3
          	mov cx, 100
          	mov dx, 120
          l4: int 10h							
          	mov ax, 0x0C09
                  inc cx
                  cmp cx, 200
                  jne l4
          	mov ah, 0 
          	int 0x16
          	mov ax, 0x0003 
          	int 0x10
                  mov ax, 0x4C00
          int 0x21
          
          

          Discussion is right way to get Solution of the every assignment, Quiz and GDB.
          We are always here to discuss and Guideline, Please Don't visit Cyberian only for Solution.
          Cyberian Team always happy to facilitate to provide the idea solution. Please don't hesitate to contact us!
          %(red)[NOTE: Don't copy or replicating idea solutions.]
          Quiz Copy Solution
          Mid and Final Past Papers
          Live Chat

          1 Reply Last reply
          0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          Reputation Earning
          How to Build a $1,000/Month World CUP LIVE Matches Live Cricket Streaming
          Sponsored
          File Sharing
          Earn with File Sharing
          Stats

          1

          Online

          3.1k

          Users

          2.8k

          Topics

          8.6k

          Posts
          Popular Tags
          solution
          1235
          discussion
          1195
          fall 2019
          813
          assignment 1
          428
          assignment 2
          294
          spring 2020
          265
          gdb 1
          238
          assignment 3
          79
          Trending
          • PM. IMRAN KHAN
            Zaeem ChZ
            Zaeem Ch
            4
            3
            5.0k

          • Are the vaccines halal or not?
            4
            1
            4.3k

          • All Subjects MidTerm and Final Term Solved Paper Links Attached Please check moaaz past papers
            zaasmiZ
            zaasmi
            3
            26
            80.9k

          • CS614 GDB Solution and Discussion
            M
            moaaz
            3
            3
            8.8k

          • How can I receive Reputation earning from Cyberian? 100% Discount on Fee
            Y
            ygytyh
            3
            28
            27.6k

          Online User
          zaasmiZ
          zaasmi
          | |
          Copyright © 2010-26 RUP Technologies LLC. USA | Contributors | Privacy | Terms
          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Pro Blog
          • Users
          • Groups
          • Unsolved
          • Solved