Tags:
Share the Assignment Questions & Discuss Here....
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
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
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
#cs401assignment2solutionfall2020 #cs401assignment2solution2020
CS401 Assignment 2 Solution Fall 2020 | CS401 Assignment Solution 2020
© 2022 Created by + M.Tariq Malik. Powered by
Promote Us | Report an Issue | Privacy Policy | Terms of Service
We are user-generated contents & non-commercial site since 2009. All product, videos, pictures & others contents on site don't seem to be beneath our Copyrights & belong to their respected owners & freely available on public domains. All Contents on site are for personal & non-commercial use.We believe in Our Policy & do according to them. If Any content is offensive in your Copyrights then please email at m.tariqmalik@gmail.com with copyright detail & We will happy to remove it immediately.
Management: Admins ::: Moderators
Awards Badges List | Moderators Group
All Members | Featured Members | Top Reputation Members | Angels Members | Intellectual Members | Criteria for Selection
Become a Team Member | Safety Guidelines for New | Site FAQ & Rules | Safety Matters | Online Safety | Rules For Blog Post