



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Main points of this exam paper are: Code Executes, Language Program, Status Register, Function, Flags, Register, Factorial, Calculates, Number Stored, Sequence
Typology: Exams
1 / 5
This page cannot be seen from the preview
Don't miss anything!




Semester 2 Examinations 2012
Module Code: COMH
School: Science & Informatics
Programme Title: BSc (Hons) in Software Development – Year 1
Programme Code: KSDEV_8_Y
External Examiner(s): Ms Erica Gill Internal Examiner(s): Mr Séamus Lankford
Instructions: Answer Question 1 and TWO other questions.
Duration: 2 hours
Sitting: Summer 2012
Requirements for this examination:
Note to Candidates: Please check the Programme Title and the Module Title to ensure that you have received the correct examination paper. If in doubt please contact an Invigilator.
a) Determine the value in D0 when the following code runs:
MOVE #2,D MOVE #6,D Loop: ADD D1,D DBRA D1,Loop [8 marks]
b) What value is stored in $7000 after this code executes?
MOVE #$AC1E,D NOT D LSR #4,D MOVE D0,$7000 [8 marks]
c) Write a 68000 assembly language program that implements the following algorithm:
D0= D1= IF (D0≠0) THEN D0=D0+ ELSE D0=D0+ D1=D1+D [8 marks]
d) What is the Status register used for in a 68000 processor? Briefly describe its function and the flags used in this register. [8 marks]
e) Write a 68000 assembly program that calculates the factorial of a number stored in D0. [8 marks]
[40 marks]
(a) With appropriate diagrams, illustrate and explain the operation of the stack in the 68000 processor.
In your explanation, use sample 68000 code, to illustrate the push and pull stack operations. [10 marks]
(b) Illustrate and briefly explain what effect the following code samples have on the stack:
i) MOVEM.L D3-D7/A1-A3,-(A7) ii) MOVE.W D2,-(A7) iii) BSR MAX iv) LEA $4000,A7 [10 marks]
(c) Write a 68000 subroutine (called PRIME), which determines if the number stored in D0 is a prime number. A value of 1 in D7 indicates that the number is prime and a value of 0 indicates that the number is not prime.
Call the PRIME subroutine within a main program and load a sample value into D0 prior to calling the subroutine. [10 marks]
[30 marks]
(a) Describe what is meant by the system bus. What are its components? [6 marks]
(b) Describe, briefly, the function of the following in the 68000 microprocessor:
i) A ii) Control Unit iii) ALU [6 marks]
(c) Briefly describe the following indirect addressing modes used in the 68000 microprocessor, giving a code example of each mode.
i) Indirect address register addressing ii) Indirect address register addressing with post-incrementing iii) Indirect address register addressing with pre-decrementing iv) Absolute addressing [8 marks]
(d) Using a bucket sort algorithm, write a 68000 program to arrange the numbers in the array, NUMS, into ascending order.
NUMS DC.B 8,3,5,9,2,7,
The bucket sort algorithm should be implemented in a subroutine , which is invoked by the main program. [10 marks]
[30 marks]