BCSL 022 Solved Assignments 2016
BCSL 022 Solved Assignments 2016
CLASSES
PIXELES CLASSESPage | 1
MCA (IGNOU)
BCA &
Course Code
: BCSL-022
Course Title
: Assembly Language Programming Lab
Assignment Number : BCA(II)/L-022/Assignment/2015
Last Dates for Submission: 15 October, 2015 (For July 2015 Session) April,
2016 (For January 2016 Session)
1. Design a two bit down counter circuit that count from 11 to 00. The
initial state of the counter may be assumed to be 11. The counter will
be in following successive states: 11, 10, 01, 00, 11, 10, 01, 00, 11 ...
Use any flip flop to design the circuit. You must design them using state
transition diagram and Karnaugh's map. (10 Marks)
Ans:
www.pixelesindia.com
PIXELES
CLASSES
PIXELES CLASSESPage | 2
MCA (IGNOU)
BCA &
www.pixelesindia.com
PIXELES
CLASSES
PIXELES CLASSESPage | 3
MCA (IGNOU)
BCA &
Ans.
DATA SEGMENT
.MODEL SMALL
.STACK 100H
STRING DB AXABAYAF , $
RESULT DB ?
DATA END
CODE SEGMENT
LENGTH DB $-STRING
MAIN PROC
MOV AX, @DATA
MOV DS, AX
MOV AL,00H
Regular Classes
BCA & MCA IGNOU Special Institute
Free Trial Classes
Subjective Knowledge
Free PIXELES Guide Books (Prepared by our
teachers)
Free Solved Assignments
Experienced Faculties
100% Results
Home Test Series
Class Test Series
We teach you until you pass
Final Year Synopsis & Project
Proper Guidance
(b) Write and run (using appropriate calling program) a near procedure
in assembly language that converts a packed 2 digit BCD number stored
in AL register to equivalent Binary number. For example, if AL contains
a packed BCD number 64 as 0110 0100, then the program will convert
this BCD to equivalent binary number 01000000. The binary number
should be returned back in the AL register itself.
Ans:
DATA_SEGSEGMENT
www.pixelesindia.com
PIXELES
CLASSES
PIXELES CLASSESPage | 4
MCA (IGNOU)
BCD DB 25h
BIN
DB ?
DATA_SEGENDS
STACK_SEGSEGMENT STACK
DW 100 DUP(0)
TOP_STACK LABEL WORD
STACK_SEGENDS
CODE_SEG SEGMENT
ASSUME CS:CODE_SEG, DS:DATA_SEG, SS:STACK_SEG
START: MOV AX, DATA_SEG
MOV DS, AX
MOV AX, STACK_SEG
MOV SS, AX
MOV SP, OFFSET TOP_STACK
MOV SI, OFFSET BCD
MOV DI, OFFSET BIN
CALL BCD_BINARY
BCD_BINARYPROC NEAR
PUSHF
PUSH AX
PUSH BX
PUSH CX
MOV AL, [SI]
MOV BL, AL
AND BL, 0Fh
AND AL, 0F0h
MOV CL, 04
ROR AL, CL
MOV BH, 0Ah
MUL BH
ADD AL, BL
MOV [DI], AL
POP CX
POP BX
POP AX
www.pixelesindia.com
BCA &
PIXELES
CLASSES
PIXELES CLASSESPage | 5
MCA (IGNOU)
BCA &
POPF
RET
BCD_BINARY ENDP
CODE_SEGENDS
END START
(c) Write and run an assembly language program that multiplies two
numbers (of size one byte only) stored in the memory. The result should
be output on the computer monitor.
Ans:
DATA SEGMENT
NUM1 DB 25h
NUM2 DB 80h
RESULT DB ?
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE, DS:DATA
START:
MOV DS, AX
MOV AL, NUM1
ADD AL, NUM2
MOV RESULT, AL
RCL AL, 01
MOV CARRY, AL
MOV AH, 4CH
INT 21H
CODE ENDS
END START
www.pixelesindia.com