We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

www.vustudents.ning.com

 www.bit.ly/vucodes + Link For Assignments, GDBs & Online Quizzes Solution www.bit.ly/papersvu + Link For Past Papers, Solved MCQs, Short Notes & More

Dear Students! Share your Assignments / GDBs / Quizzes files as you receive in your LMS, So it can be discussed/solved timely. Add Discussion

# CS401 Assignment No 03 Solution & Discussion Due Date:19-01-2017

CS401 Assignment No 03 Solution & Discussion Due Date:19-01-2017

Questions Statement                                                                            20 marks

You have to write an assembly language code that will:

• Read a character (ASCII code) from keyboard using a BIOS interrupt.
• You have to print that ASCII character in binary number system using DOS interrupt.
• Then you have to invert that ASCII code and have to transmit it to a parallel port using a DOS interrupt.

For example,

• If the you pressed ‘a’. Whose ASCII code is 61h (in hex).
• You have to print the equivalent of 61h which is (1100001)2 in binary.
• Then you have to invert the ASCII code so 11000012 will become 00111102.
• At the end you have to transmit 00111102 to a parallel port.

+ How to Join Subject Study Groups & Get Helping Material?

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?

+ VU Students Reserves The Right to Delete Your Profile, If?

Views: 8618

.

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

### Replies to This Discussion

brother iss ko edit kr k change kese krna hai yeh bhi bata do koi abb

change variable names and description given in her solution.i did write myself few lines,that is why i am saying after working on solution i realized her solution is correct at least you will get some marks if not 100%

all these files contain the same error at the starting point

SOLUTION:
[org 0x0100]
jmp start
number: db02
multiplicandb0
multiplier: db0
multiResult: dw0
squareResultd0

square: mov[multiplicand], AX
mov[multiplier], AXcallmulti
movAX,[multiResult]mov[squareResult], AX
ret
multi: movCL,8
movBX,[multiplicand]movDX,[multiplier]
carryCheck: shr BX, 1jncskip
skip: shl BX, 1
decCL
jnzcarryCheckret
start: movAX,[number]
call square
movDX,[squareResult]
subbyte[number],
2movAX,
[number]mov[multiplicand],
AXmovbyte[multiplier],
2call multi
shr DX,1 ; divisionby2
movAX,0x4c00 ;ending programint0x21

this solution is giving problems (errors in line 3) ...

Please suggest any solution error free or how to remove it

Cs401 Assignment Solution
SOLUTION:
[org 0x0100]
jmp start
number: db02

multiplicand:db0
multiplier: db0
multiResult: dw0
squareResult:dd0

square: mov[multiplicand], AX
mov[multiplier], AXcallmulti
movAX,[multiResult]mov[squareResult], AX
ret

multi: movCL,8
movBX,[multiplicand]movDX,[multiplier]

carryCheck: shr BX, 1jncskip

skip: shl BX, 1
decCL
jnzcarryCheckret

start: movAX,[number]
call square
movDX,[squareResult]
subbyte[number],
2movAX,
[number]mov[multiplicand],
AXmovbyte[multiplier],
2call multi

shr DX,1 ; divisionby2
movAX,0x4c00 ;ending programint0x21

## Latest Activity

♦_"Tooba"_♦ liked Alishba's discussion Nikkah Mubarak To <3 !! 'JS' !! <3
5 minutes ago
Alishba liked + ! Suspecious+'s discussion محبت یا خود غرضی؟؟؟؟؟
6 minutes ago
Alishba liked + ! Suspecious+'s discussion احساسات
6 minutes ago
Alishba liked + ! ! S░!░N҉░G҉░E҉░R​⭐️'s discussion BASS!!!!!!!!
6 minutes ago
6 minutes ago
Alishba liked + ! ! ! ! ! Love's discussion Happy Birthday pyary pyary chacha
7 minutes ago
7 minutes ago
Alishba liked Alishba's discussion Nikkah Mubarak To <3 !! 'JS' !! <3
11 minutes ago
12 minutes ago
Hareem Zahid posted a discussion

12 minutes ago
13 minutes ago

1

2