PART A Choose the correct answer. (Each question carries 2 marks) 1. Binary number 101012 is equivalent to A. 15H B.

21H C. A1H D. A8H 2. What is the result when A5H subtracted from 72H A. CDH B. -51 C. -33 D. 205 3. Which of the following register is 8-bits register? A. Index Register B. Program Counter C. Flag Register D. Temporary Register 4. Which sentence is NOT TRUE about fetch-decode-execute cycle? A. Instructions are placed in instruction register to be decoded. B. Processor knows what type instruction it is and the number of accumulators needed to complete the instruction. C. Fetch-decode-execute operates under control of Ø1 and Ø2 D. The shortest instruction is 2 cycles and the longest is 12 cycles. 5. DECB What type of addressing mode is used is used to address the instruction above? A. Direct B. Inherent C. Immediate D. Relative

1

6.

Provide programmer with the flexible and easy method to translate the programmer’s source code into object code. Table 1 Table 1 above states the information about the main function of an assembler. What is the other function of an assembler? A. B. C. D. states condition code register content error information number of cycle needed to complete the instructions types of addressing modes that can be used by programmer

7.

What is the content of Condition Code Register after the execution of the program shown in table 2 below using MC 6809 instruction set? CLRA LDAA #$49 ADDA #$6A SWI Table 2 A. B. C. D. H 1 0 1 1 N 1 1 0 1 Z 0 0 1 0 V 1 1 1 0 C 0 1 0 0

8.

What is the name given to the program which stored in ROMs or other devices such as diskettes and tapes which are non-volatile? A. B. C. D. Software Firmware Hardware Machine Code

2

9. i. ii. iii. iv. A. B. C. D. 10. i. ii. iii. iv. A. B. C. D.

Which of the following addressing mode affect 3 bytes of location? Immediate Extended Direct Relative i and ii only i and iv only ii and iv only ii and iii only Which of the following are major components of Arithmetic Unit? Arithmetic Logic Unit Program Counter Accumulator Flag Register i and iii only i, ii and iii only i, iii and iv only All the above

3

PART B Answer Any Three Questions Only Instruction: Prepare a complete flow chart to show your program. Write program in assembly language base on flow chart.

1.

Write a program to add two numbers stored in location $01FA and $01FB. If the result is less than FFH, load 12H and 13H in accumulator A and accumulator B respectively. (10M)

2.

Test the two numbers stored in locations $ 0067 and $0068. If the numbers are the same, add the two numbers. Then, perform AND operation between the sum and data $A7 and store the result in location $01FE. (10M)

3.

Write a program to subtract the data in location $0081 from the data in location $0091. If the result is more than 50 H, subtract 50 H from the result and store the answer in location $01B2.Otherwise, subtract the result from 50 H and store the answer into $01B3. (10M)

4.

Add two numbers in location $0076 and $0077. If the sum is greater than FF H, subtract smaller number from bigger number and store the difference in location $01FB. Else, store the sum to $01FC. (10M)

5.

Refer to memory location and the content given below. If m is greater than n, add them. If the result is greater than FFH, clear A and clear accumulator B. Else, load accumulator A and B with data C0 H and 1D H respectively. (10M) Address $01FA $01FC Data mH nH

4

6.

Three numbers stored in memory locations $01FA, $01FB and $01FC as shown below. Add the numbers in first two locations and then subtract the data in third location. If the result is less than 40 H, add the result with 40 H and store the new result in location $0076. (10M) Address $01FA $01FB $01FC Data uH vH wH

PART C Answer any 2 of the 3 question. Instruction: Prepare a complete flow chart to show your program. Write program in assembly language base on flow chart. Convert the assembly language into machine coding. 1. The two numbers, x and y are stored in memory locations $0079 and $0179 respectively. If the numbers are the same, add them. Clear the accumulators, if the result of addition is greater that FFH. Else, load accumulator A and accumulator B with 10H and 20H respectively. If the numbers are different, subtract the smaller number from the bigger number and store the result in location $01FC. (25M) 2. Refer to memory locations shown below. Subtract s from r if r greater than s. Compare the result of subtraction with 60 H. If the result is greater than 60, store the result in location $012E. Else, add 20 H to the result and store the new result in $012F. Add r and s if s greater than r. If the sum is greater than FF, load accumulator A with 60 and accumulator B with 1D H. Otherwise, add 20 H to the sum and store the new result in $0130. (25M) Address Data $0090 rH $0091 sH Perform the operation below using the suitable addressing mode. If the result of operation is greater than FFH, clear accumulator A and accumulator B. Otherwise, perform OR operation with data 42 H.Store the result in location $01FB. 5

3.

[ (p + q) - 20 H ] + [ (34 H OR 72 H) + 10 H ] The data p and q are stored in memory locations as shown below. (25M) Address $0078 . . $0087 qH Data pH

6