Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.

Q. Write an assembly language program to compare the first and last two digits of your VUID. For example, if the VUID is BC123456789, then the first and last two digits are 12 and 89 respectively.
While comparing, if the first two digits are less than the last two digits, then subtract the first value from the second otherwise perform their addition. At the end, store the result (subtraction or addition) in memory.
Note:
Make it sure to use your own VUID otherwise zero marks will be awarded. Moreover, you must store the first and last two digits in memory separately.

Views: 2185

Replies to This Discussion

Share the Assignment Questions & Discuss Here.... 

CS 401 Assignment No 2 Solution file plus necessary links. for all windows 10/8/7

CS 401 Assignment No 2 Solution file plus necessary links.

full procedure lazmi dakh lain full marks k lia.

Dosbox Download link.

https://www.dosbox.com/download.php?main=1

AsmSoft Download.(NASM included ha)

https://vulms.vu.edu.pk/CourseResources/OpenFile.aspx?File=AssmSoft...

DosBox Code type:

mount n: your drive name:\Folder name
n:
nasm saved filename.asm -o filename.com -L filename.Lst
afd filename.com

CS 401 Assignment No 1 Complete code

CS401 Assembly language.

1. Assembly language program code.

[org 0x0100]

 

                        mov ax,[VerbX]

                        mov bx,[VerbY]

cmp ax,bx

jl dg

add ax,bx

mov cx,ax

dg:

sub bx,ax

mov cx,bx

 

mov ax,0x4c00

int 0x21

VerbX: dw aap ki ID k first two digits h                        ;           Aap ki apni Vu ID

VerbY: dw aap ki ID k two last digits h

Cs-401 Assignment No.2 solution with links

This is the solution of Cs-401 Assignment no. 2 With download links.

;Assignment 2 solution Fall 2020

;Program to compare first two digit number with the last two digit number

;VU-ID=**************

 

[org 0x0100]                   ; offset

jmp start                      ; jump to start label

 

first2digit: dw  **               ;declare and initialize variable with first two digit                   

last2digit: dw  **              ;declare and initialize variable with last two digit

result: dw 0                   ;variable to store the result and initialize with 0

 

start:

       mov ax, 0                ; initialize ax register to zero       

       mov bx, 0                ; initialize bx register to zero

       mov ax, [first2digit]    ; load the first two digit in ax register

       mov bx, [last2digit]     ; load the last two digit in ax register

 

cmp ax, bx                    ;comparing the first two with last two

jnge subt                     ; jump subt label if destination is not equal and greater

                              ; than source otherwise

 

add ax, bx                      ;add both first and last two digit numbers  

mov [result], ax                ;store the addition into the variable result

jmp exit                        ;uncondition jum to label exit

 

subt: sub bx, ax                ; subtract the first two digit from the last two digit

                                ; number

      mov [result], bx          ; store the subtraction into the variable result    

      jmp exit                  ; uncondition jump to label exit

 

exit:

    mov ax, 0x4c00          ;terminate the progrma

     int 0x21

CS401 Assignment No.2 fall 2020
;Program to compare first two digit number with the last two digit number
;VU-ID=**************

[org 0x0100] ; offset
jmp start ; jump to start label

first2digit: dw ** ;declare and initialize variable with first two digit
last2digit: dw ** ;declare and initialize variable with last two digit
result: dw 0 ;variable to store the result and initialize with 0

start:
mov ax, 0 ; initialize ax register to zero
mov bx, 0 ; initialize bx register to zero
mov ax, [first2digit] ; load the first two digit in ax register
mov bx, [last2digit] ; load the last two digit in ax register

cmp ax, bx ;comparing the first two with last two
jnge subt ; jump subt label if destination is not equal and greater
; than source otherwise

add ax, bx ;add both first and last two digit numbers
mov [result], ax ;store the addition into the variable result
jmp exit ;uncondition jum to label exit

subt: sub bx, ax ; subtract the first two digit from the last two digit
; number
mov [result], bx ; store the subtraction into the variable result
jmp exit ; uncondition jump to label exit

exit:
mov ax, 0x4c00 ;terminate the progrma
int 0x21

CS401 assignment no 02 solution fall 2020

Image may contain: text that says 'Edit 85 MPS compare first ;Program VU-ID=Bc190205668 digit number two digitnumber [o0x0100] start offset label first2digit: last2digit: ;declare w0 nitialize variable with first and initialize variable digit store last wo digit start: result and with mov mov mov registe [first2digit] load mov zero irst wo digit cmp register bx jnge subt first NO two destination not equal source otherwise greater [result], ax first and last jmp exit digit numbers subt: result jum ax label exit digit rom bx digit jmp exit mov result uncondition jump to label exit 0x4c00 terminate the progrma'

#cs401assignment2solutionfall2020 #cs401assignment2solution2020
CS401 Assignment 2 Solution Fall 2020 | CS401 Assignment Solution 2020

RSS

Looking For Something? Search Below

VIP Member Badge & Others

How to Get This Badge at Your Profile DP

------------------------------------

Management: Admins ::: Moderators

Other Awards Badges List Moderators Group

© 2021   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service