Course Code : MCLS-017
Assignment Number : MCA(1)/017/Assign/06
Maximum Marks: 100
Weightage : 25%
Last Date of Submission : 30th April, 2006
This assignment has two questions. Answer all questions. Each question is of 20 marks. Your Lab Records will carry 40 Marks. Rest 20 marks are for viva voce. You may use illustrations and diagrams to enhance the explanations. Please go through the guidelines regarding assignments given in the programme guide for the format of presentation.
Q1: This project requires you to develop a fairly-sophisticated program that simulates LED displays (e.g., a digital clock or microwave). Write a program that can print the digits 0 through 9 as block digits (like you would find on an LED display). Each digit should contain only the x and . characters (see example output below), and should be followed by a blank line so the digits are separated. The input to this program will be a number followed by a height and a width. For example, with the input 25, 7, 5, the program will write the digits 2 and 5 (separated by a blank line) where each digit has a height of 7 and a width of 5 characters. Your program requires that the height be an odd number >= 5 and that the width be >= 3. Your program should check that the input line contains three numbers (value, height, and width) and that the height and width adhere to the constraints (height is odd and >= 5, width >= 3). It should inform the user of any input problems. (20 Marks)
Input Line: 256 5 5
Number - 256, Height - 5, Width - 5xxxxx
Note: You must execute the program and submit the program logic, sample input and output along with the necessary documentation for this question. Assumptions can be made wherever necessary.
Q2: (a)Write a main program in C programming Language that calls an 8086 Assembly Subroutine that divides an unsigned 2 byte number by an unsigned single byte provided the single byte number is NOT zero. The C Program should pass the two numbers to the assembly subroutine. The original values and the result of division should be printed from the C program. Test your program using the following values:First Operand: 1000 Second Operand: 25
First Operand: 0 Second Operand: 25
First Operand:1000 Second Operand:0 (10 Marks)
(b)Write a Program in 8086 that has two subroutines: First for encrypting upper case alphabets in a string as follows:A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Q W E R T Y U I O P A S D F G H J K L Z X C V B N M
You must use XLAT instruction.
The second subroutine can decrypt the string so obtained. Write suitable Main program in C that calls these function. Test your program suitably. (10 Marks)