Вы находитесь на странице: 1из 7

BACHELOR OF COMPUTER APPLICATION (BCA)

BCSL-022 Solved Assignment


2019-20 Session
Assembly Language Programming Lab
Solved by :- ignounews.com
The completed assignment should be sent to the Coordinator at the Study Centre
allotted to you.
Last date for submission of assignment: - 15th October, 2019 (For July 2019 Session)
15th April, 2020 (For January 2020 Session)
Note: - These answers should just be treated as reference, not the final answer to
be written in assignments. Just do not directly copy it in your assignments
Visit https://ignounews.com for more assignments and alerts. Click on the bell icon
on your right side to subscribe and get latest assignments update in notifications.

Bcsl-22 Solved assignment


2019-2020
Assembly Language Programming Lab
Course Code : BCSL-022
Assignment Code : BCA(2)/BCSL022/Assignment/2019-20
Maximum Marks : 50
Weightage : 25%

This assignment has two questions of total of 40 marks. Rest 10 marks are for viva voce. Please
go through the guidelines regarding assignments given in the programme guide for the format
of presentation

Q1. Design a two-bit counter circuit that counts from 0 to 2. It should have states 00, 01 and
10. The initial state of the counter may be assumed to be 00. The counter will be in following
successive states: 00, 01, 10, 00, 01, 10, 00, 01, 10, 00 ... Use J-K flip flop to design the circuit.
You must design the circuit using state transition diagram and Karnaugh's maps. (10)

For More Assignments Visit https://ignounews.com


Visit- https://ignounews.com for more assignments

For More Assignments Visit https://ignounews.com


Q2. Write and run following programs using 8086 assembly language:
(a) Write and run an Assembly language program that converts a packed 4-digit BCD
number that has been stored in two consecutive byte locations in the memory, into an

For More Assignments Visit https://ignounews.com


equivalent binary number. The output should be stored in DX register. For example, if
two consecutive byte locations have BCD values (12)h and (34)h then output will be
binary equivalent of (1234)10 which is (0000 0100 1101 0010)2. This binary value will
be stored in DX register
Ans:-
BCD TO Binary code conversion

• Model samall
• Data
BCD DW 1234H
COUNT DW,DUP(0)

• CODE
START: MOV AX,@DATA
MOV DS ,AX
MOV COUNT,AX,BCD
MOV COUNT,O
MOV BX,10H
MOV BX,O
DIV BX
PUSH DX
INC COUNT
CMP AX O
JNZ BACK
MOV DI,O
MOV BX,OAH
REPECK: MOV CX,COUNT
DEC CX
POP AX
JCXZ SKIP

For More Assignments Visit https://ignounews.com


Repmul: MUL BX
LOOP Remul
Skip: ADDDI,AX
DEC COUNT
JNZ REPECK
MOV DX,DI
MOV AH ,HCH
INI 21H
END START
(b) Write and run (using appropriate calling program) a near procedure in 8086 assembly
language that checks if the input parameter has a value less than 5. If the value is less than 5
then subroutines displays the line "Parameter value is less than 5" else it displays "Parameter
value is >= 5".
Ans:- a model small .stack 100h
.data
msg1 db 'Parameter msg2 db 'parameter >=5$'
.code
main proc
movax,@datamovds,ax
mov dl,5
mov ah,1
int 21h
movbl,al
cmpal,dl
jng l2
call greaterthanjmp
l2:call lessthanmov ah,4ch
int 21h

For More Assignments Visit https://ignounews.com


main endp
lessthanproc
movdx,offset msg1 mov ah,9
int 21h
mov ah,4ch
int 21h
less than endp
greater than procmovdx,offset msg1 mov ah,9 mov ah,4ch int 21h int 21h greaterthanendp
end main
(c) Write and run an 8086 assembly language program that finds the factorial of the value
stored in BH register. You may assume that BH register will store a maximum value 8. Thus,
you need not handle the overflow
Ans: - DATA SEGMENT
N DB 06H
FACT DW ?
DATA ENDS CODE SEGMENT ASSUME CS:CODE, DS:DATA START:
MOV AX, DATA
MOV DS, AX
MOV AX, 1
MOV BL, N
MOV BH, 0
CALL FACTORIAL
MOV FACT, AX
MOV AH, 4CH
INT 21H
FACTORIAL PROC
CMP BX, 1
JE L1

For More Assignments Visit https://ignounews.com


PUSH BX
DEC BX
CALL FACTORIAL
POP BX
MUL BX L1: RET
FACTORIAL ENDP CODE ENDS END START

Note: - These answers should just be treated as reference, not the final answer to
be written in assignments. Just do not directly copy it in your assignments
Visit https://ignounews.com for more assignments and alerts. Click on the bell icon
on your right side to subscribe and get latest assignments update in notifications.

Visit- https://ignounews.com for more assignments

For More Assignments Visit https://ignounews.com

Вам также может понравиться