0
Assignment # 2(Graded)
  Total marks = 20
                                                                                  Deadline Date = Jun 10, 2015

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.

1)      You should concern the recommended books to clarify your concepts as handouts are not sufficient.
2)      You are supposed to submit your assignment in .ppt or pptx format. Any other formats like scan images, PDF, zip, rar, doc and bmp etc will not be accepted.

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.

For any query, feel free to email at:
Question statement:
Write a subroutine (assembly code) that calculates the cube of AX register and store the result in DX register by using ADD instruction in a loop.
Note: MUL instruction should not be used.

Guidelines for Recording Audio Narration:


  • You are required to submit your solution as power point presentation (ppt or pptx).
  • Use the template for solution that is attached with assignment file.
  • The total time for audio recording should not exceed 4 minutes.
  • Make sure that your recorded voice is clear before submission on LMS.
  • If audio is unclear or corrupt, then zero marks will be awarded.
  • Record your presentation as given in demo video attached with assignment. For MS-Office 2003, watch “Audio Narration Recording Office 2003” while in case of Office 2007 follow “Audio Narration Recording Office 2007”.
  • If you are using Office 2013, then save your solution file with “Save as type”= “PowerPoint 97-2003 Presentation”.
  • On first slide write your name, VU-ID and version of MS-Office you are going to use.
  • In rest of the slides, show your solution with audio explanation in a step by step fashion.
  • Moreover, don’t forget to record your name and VU-ID on the very first slide.
 Solution

 jmp start
  data: dw 3
  cube: 
    push bp 
   mov bp, sp 
        push ax
    push dx 
   push cx                 
mov ax,0 
     mov cx,3 
 l1:
 add ax,[bp+4] 
     sub cx,1 
  jnz l1  
   mov dx,ax               
   pop cx  
pop dx 
       pop ax 
    pop bp 
    ret
  start:        
mov ax,[data] 
        push ax         
call cube   
          mov dx, 0x4c00 
 int 0x21

Post a Comment

Dear readers, after reading the Content please ask for advice and to provide constructive feedback Please Write Relevant Comment with Polite Language.Your comments inspired me to continue blogging. Your opinion much more valuable to me. Thank you.

Monday, June 8, 2015

cs401 assignment 2 solution

Assignment # 2(Graded)
  Total marks = 20
                                                                                  Deadline Date = Jun 10, 2015

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.

1)      You should concern the recommended books to clarify your concepts as handouts are not sufficient.
2)      You are supposed to submit your assignment in .ppt or pptx format. Any other formats like scan images, PDF, zip, rar, doc and bmp etc will not be accepted.

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.

For any query, feel free to email at:
Question statement:
Write a subroutine (assembly code) that calculates the cube of AX register and store the result in DX register by using ADD instruction in a loop.
Note: MUL instruction should not be used.

Guidelines for Recording Audio Narration:


  • You are required to submit your solution as power point presentation (ppt or pptx).
  • Use the template for solution that is attached with assignment file.
  • The total time for audio recording should not exceed 4 minutes.
  • Make sure that your recorded voice is clear before submission on LMS.
  • If audio is unclear or corrupt, then zero marks will be awarded.
  • Record your presentation as given in demo video attached with assignment. For MS-Office 2003, watch “Audio Narration Recording Office 2003” while in case of Office 2007 follow “Audio Narration Recording Office 2007”.
  • If you are using Office 2013, then save your solution file with “Save as type”= “PowerPoint 97-2003 Presentation”.
  • On first slide write your name, VU-ID and version of MS-Office you are going to use.
  • In rest of the slides, show your solution with audio explanation in a step by step fashion.
  • Moreover, don’t forget to record your name and VU-ID on the very first slide.
 Solution

 jmp start
  data: dw 3
  cube: 
    push bp 
   mov bp, sp 
        push ax
    push dx 
   push cx                 
mov ax,0 
     mov cx,3 
 l1:
 add ax,[bp+4] 
     sub cx,1 
  jnz l1  
   mov dx,ax               
   pop cx  
pop dx 
       pop ax 
    pop bp 
    ret
  start:        
mov ax,[data] 
        push ax         
call cube   
          mov dx, 0x4c00 
 int 0x21

No comments:

Post a Comment