CSU11021 Exam ARM 代考

Faculty of Science, Technology, Engineering and Mathematics School of Computer Science & Statistics
Integrated Computer Science
Computer Science (Joint Honours) Computer Science, Linguistics and Langauge Junior Freshman
CSU11021 – Introduction to Computing I
Thursday, 15 December 2022 ONLINE
Dr Jonathan Dukes
Instructions to Candidates
Attempt ALL parts.
The total number of marks is 100.
Michaelmas Term
15:00 – 18:00
This is an individual assessment. Tools similar to TurnItIn will be used to measure the similarity of solutions. Provide references for any sources you use to develop your solution.
You must not communicate with anyone in relation to the examination either during the examination or for 1 hour after the scheduled end time of the examination.
Submit a completed declaration on Blackboard, using the template provided, confirming that the work submitted is your own.
Submit your ARM Assembly Language program at https://submit.scss.tcd.ie.
You may submit your program up to eight times without penalty. Each subsequent attempt will
attract a penalty of 2 marks, up to a maximum penalty of 12 marks.
Page 1 of 5
© UNIVERSITY OF DUBLIN 2022
CSU11021-1

Each part of this examination is cumulative, building on the functionality of preceding parts. Correctly implementing each successive part will cause your program to pass more Submitty tests. You do not need to submit separate solutions for each part. You only need to submit your solution for the final part that you attempt. You may, if you wish, submit attempts for intermediate parts to check your solution. Submissions for intermediate parts will count towards your total of eight penalty-free attempts.
You must provide pseudocode comments to explain your approach.
The mark you receive will be based on:
(i) automated testing of your program by Submitty and [60 marks]
(ii) an evaluation of the quality of your pseudo-code comments, your use of appropriate assembly language features, your overall approach and the presentation of your program. [40 marks]
First, some definitions
A “substring” of an ASCII NULL-terminated string is a sequence of one or more characters at any position in the string. The example below highlights a substring containing the characters “XYZ”.
“ABCDXYZEFG”
A “prefix” of an ASCII NULL-terminated string is a substring appearing at the start of the string.
The example below highlights a prefix containing the characters “XYZ” “XYZABCDEFG”
CSU11021-1
Page 2 of 5
© UNIVERSITY OF DUBLIN 2022
Github
Part 1 [9 Submitty autograding marks]
Two ASCII NULL-terminated strings, A and B, are stored in Random Access Memory (RAM). Write an ARM Assembly Language program that will calculate the length of the longest prefix of string A that exactly matches a prefix of string B.
For example, given the strings A and B below, your program should give a result of 3 in R0. The matching prefixes have been highlighted.
string A: “ABCWXYZ”
string B: “ABCPQRST”
The start addresses of strings A and B are in registers R1 and R2. Your program should store its
result in register R0.
Part 2 [18 Submitty autograding marks]
Extend the functionality of your program from Part 1 to calculate the length of the longest prefix of A that matches a substring anywhere in B. Your program should continue to store its result in register R0.
For example, given the strings A and B below, your program should give a result of 4 in R0. The matching prefix of A and substring of B have been highlighted.
string A: “ABCDWXYZ”
string B: “ABCPQABCDRST”
CSU11021-1
Page 3 of 5
© UNIVERSITY OF DUBLIN 2022
Code Help
Part 3 [15 Submitty autograding marks]
Extend your program again to find the length of the longest substring anywhere in A that matches a substring anywhere in B. Your program should store its result in register R0.
For example, given the strings A and B below, your program should give a result of 5 in R0. The matching substrings have been highlighted.
string A: “ABCDWXABCDEYZ” string B: “ABCPQABCDERST”
Part 4 [18 Submitty autograding marks]
Extend your program one more time to remove the longest matching substring from strings A and B. When removing the substrings from A and B, your program should overwrite the substrings with the characters that immediately follow the substrings to “fill the gap”. Your program should continue to store the length of the removed substring in register R0.
For example, given the same two strings, A and B, as the example in Part 3:
string A: “ABCDWXABCDEYZ”
string B: “ABCPQABCDERST”
your program should modify the original strings A and B in memory, replacing them with the
CSU11021-1
following strings:
string A: “ABCDWXYZ” string B: “ABCPQRST”
Page 4 of 5
© UNIVERSITY OF DUBLIN 2022

ARM Conditional Branch Instructions
CSU11021-1
Description
Instruction
Inequality (unsigned values)
less than or equal
greater than or equal
greater than
Inequality (signed values)
less than or equal
greater than or equal
greater than
Negative Set Negative Clear Carry Set Carry Clear Overflow Set Overflow Clear Zero Set
Zero Clear
ASCII Table
= == BEQ ≠ != BNE
< < BLO ≤ <= BLS ≥ >= BHS > > BHI
< < BLT ≤ <= BLE ≥ >= BGE > > BGT
EQual Not Equal
Lower or Same Higher or Same HIgher
Less than or Equal Greater than or Equal Greater Than
Carry Set Carry Clear oVerflow Set oVerflow Clear EQual
BCS (or BHS)
BCC (or BLO)
Page 5 of 5
© UNIVERSITY OF DUBLIN 2022
Computer Science Tutoring