$20 Bonus + 25% OFF
Securing Higher Grades Costing Your Pocket?
Book Your Assignment at The Lowest Price
Now!
Students Who Viewed This Also Studied
FIT1047 Introduction to Computer Systems, Networks and Security
Question:
Marie Task
In this task, you will develop a MARIE application that performs some manipulation of strings. We will break it down into small steps for you.
Most of the tasks require you to write the code, test your code with sample inputs and write the analysis of the outcome explaining the expected outcome. Your MARIE program must contain brief comments explaining the purpose of your subroutines and main programs (to be written in the .mas file). You must submit your code as .mas files together with the rest of your assignment.
The description of your experiences while testing your code with test inputs and the subsequent analysis needs to be submitted as part of the main PDF file you submit for this assignment. In some cases wherever it is appropriate, you may add test data to your program to prepare test cases. These test cases, which are mostly appropriate for programs processing numeric data, should be working without requiring much input from the user, i.e. a self-contained MARIE assembly program.
The following section introduces some concepts that you need for the rest of the assignment.
Name as Strings
A string is a sequence of characters. It is the basic data structure for storing text in a computer. There are several different ways of representing a string in memory and how to deal with strings of arbitrary length. For this assignment, we will use the following string representation:
- A string is represented in a contiguous memory location, with each address containing a single character.
- The characters are encoded using the ASCII encoding. End of a string is marked by the ASCII character comma
- A name will be composed of two strings, namely, FirstName and Last
- End of a name will be marked by another ASCII character dot
Representation of Strings in Memory using ASCII code
An illustrated example below showing how a name “John Noah” would be represented in memory (written as hexadecimal numbers):
Note that for a string with n characters, we need n + 2 words of memory in order to store all the characters belonging to a first name, a last name, the additional ‘,’ and ‘.’.
Strings in MARIE
In MARIE assembly language programming, we can make use of the ADR command, the HEX
keyword and a label “myName” to put a string into memory location:
myNameAdd, ADR |
myName |
|
myName, |
HEX 04A |
//J |
HEX 06F |
//o |
|
HEX 068 |
//h |
|
HEX 06E |
//n |
|
HEX 02C |
//, |
|
HEX 04E |
//N |
|
HEX 06F |
//o |
|
HEX 061 |
//a |
|
HEX 068 |
//h |
|
HEX 02E |
//. |
After assembling the above MARIE code, we will find that the variable (or label) myNameAdd contains the address of the string i.e. the address of the first character ‘J’ of the string “John Noah”. An example below shows how to access the first character of the above string and display:
start, LoadI Output ……… myNameAdd
Halt
2.1 Write a MARIE Program to Store Multiple User Entered Names in Consecutive Memory Rows and Print Them at the End of Data Entry. (15 marks)
Prepare a MARIE program to enter full names using Unicode / ASCII characters. Limit each part of a name (First Name or Last Name) to at most 5 characters – if a name is longer, you can shorten it (limit the maximum number of characters per full name to 12). After assembling and running your MARIE program, it should prompt for entering names using a keyboard. For the MARIE simulator, Unicode input from the keyboard can only be entered character by character. Your program should store the names in MARIE memory and print them at the end.
(i). Subroutine subInputNames: The first part of your program should focus on getting the full names as input from the keyboard and storing them in a particular location in MARIE memory. For this task, prepare a MARIE subroutine called subInputNames. Your subroutine should input (Unicode /ASCII) ‘,’ terminated First name and (Unicode /ASCII) ‘.’ terminated Last name as described in the previous section. The names have to be stored starting from the memory address 300H. A single name (First Name and Last Name) is to be stored in one row of MARIE memory. After entering a full name, a Unicode/ASCII ‘.’ will be stored to mark the end of the name in the memory, and the program should proceed to take the next name, which is to be stored at memory location 310H. This location is one row (16 words) ahead from the memory location of the previous name entry. You can use memory locations 320H, 330H, … to store more names respectively. After entering a full name, a ‘$’ from input will terminate the entire name entry process and will return control to the calling program. You have to store the ‘$’ in the memory to mark the end of the name database. Your program must be capable of accepting names one after the other, until a user enters a ‘$’ to stop taking inputs. You can verify the correct working of your program by viewing the memory content starting from #300H.
(ii). Subroutine subPrintString: In the second part of your program, prepare a MARIE subroutine called subPrintString that can print all the full names stored. This subPrintString subroutine should access all the full names in the memory (that are entered and saved by the subInputNames earlier) and printout using the “Output” instruction.
Start by using a label “PrintNameAdd” that holds the start address of a name string (like, myNameAdd in the example above). The code should then load a character from that address, output it if it is not ‘,’, then increment the address by one, and keep doing that until the character loaded from the address is a ‘,’ (which signals the end of the first name). Then, instead of printing (or output) the ASCII “,” character, print an ASCII “Space” character, and proceed to print the second part of the name string, i.e. Last Name until the character loaded from the address is a ‘.’ (which signals the end of the Last Name). Then, when you load the ASCII ‘.’ which marks the “end of a name”, instead of printing (or output) the ASCII “.” character, print an ASCII “New Line” character. Then your program should proceed to print the next name. If the loaded character is ‘$’, the subroutine needs to stop printing and gives control to the main program. While testing your code and writing the test cases for this task, you have to use at least three names (your First Name and Last Name, your friend’s name and your tutor’s name). Please note that these names should not be hard coded and assigned labels to identify each of these three names.
To receive full marks, your code needs to be in the form of a main program and use of subroutine that can be called using the JnS instruction. Save your code as “2_1_Enter_and_PrintingNames.mas”.
2.2 A MARIE Subroutine to Change Cases of Characters of User Entered Names (Upper to Lower or Lower to Upper Cases) and Print (15 marks)
Write a subroutine to change cases of all the characters of a user entered name string: Upper to Lower case or Lower to Upper case. Name the subroutine as subChangeCase. This subroutine modifies all the characters of a string in memory (from lower to upper or upper to lower cases). The program should then print the original and the modified string. Submit your MARIE code and documentation of test cases converting at least three names. To receive full marks, the main program from section 2.1 must be extended to print the original name string and the modified changed-case name string by calling the respective subroutines. Name your MARIE code file as “2_2_ChangeCase.mas”.
Hint: you can easily identify the uppercase or lowercase ASCII value ranges through the ASCII table and notice the numeric difference between the uppercase and lowercase characters.
2.3 A MARIE Subroutine to Substitute Characters of User Entered Names and Print (20 marks)
In this section, we are going to implement substitution of characters of a user-entered name. It replaces each character in a string by a different character of the alphabet defined by a reverse character shift. A shift of all alphabets in reverse order as. shown in the table below.
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 |
z |
y |
x |
w |
v |
u |
t |
s |
r |
q |
p |
o |
n |
m |
l |
k |
j |
i |
h |
g |
f |
e |
d |
c |
b |
a |
Please note the use of lower case alphabets only, and we will substitute only “alphabets”.
To substitute, the corresponding letter in the bottom row replaces each letter in the top row. You will implement mapping in MARIE by a lookup table, storing the result of substitution for each letter. The lookup table below maps the shifted keys.
mySubstKey1Addr, ADR |
mySubstKey1 |
||||
mySubstKey1, |
HEX |
064 |
/ a |
-> |
z |
HEX |
065 |
/ b |
-> |
y |
|
HEX |
066 |
/ c |
-> |
x |
|
HEX |
067 |
/ d |
-> |
w |
|
HEX |
068 |
/ e |
-> |
v |
|
HEX |
069 |
/ f |
-> |
u |
|
HEX |
06A |
/ g |
-> |
t |
|
HEX |
06B |
/ h |
-> |
s |
|
HEX |
06C |
/ i |
-> |
r |
|
HEX |
06D |
/ j |
-> |
q |
|
HEX |
06E |
/ k |
-> |
p |
|
HEX |
06F |
/ l |
-> |
o |
|
HEX |
070 |
/ m |
-> |
n |
|
HEX |
071 |
/ n |
-> |
m |
|
HEX |
072 |
/ o |
-> |
l |
|
HEX |
073 |
/ p |
-> |
j |
|
HEX |
074 |
/ q |
-> |
j |
|
HEX |
075 |
/ r |
-> |
i |
|
HEX |
076 |
/ s |
-> |
h |
|
HEX |
077 |
/ t |
-> |
g |
|
HEX |
078 |
/ u |
-> |
f |
|
HEX |
079 |
/ v |
-> |
e |
|
HEX |
07A |
/ w |
-> |
d |
|
HEX |
061 |
/ x |
-> |
c |
|
HEX |
062 |
/ y |
-> |
b |
|
HEX |
063 |
/ z |
-> |
a |
A subroutine to perform substitution on a string
In this task, you will implement a MARIE subroutine called subSubstitution that can perform substitution on a string. You need to display the string before and after the substitution process. You can assume that the string only contains lower case characters. For each letter in the string, you will need to load the correct value for its substitution from the table “mySubstKey1”, and then store that value in another memory location for printing the substituted output.
070 |
061 |
074 |
072 |
069 |
063 |
06B |
020 |
06C |
065 |
065 |
02E |
p |
a |
t |
r |
i |
c |
k |
, |
l |
e |
e |
. |
During the substitution process, the following transformation (in the memory) will occur based on the lookup table given above as the key for substitution.
p |
a |
t |
r |
i |
c |
k |
l |
e |
e |
k |
z |
g |
i |
r |
x |
p |
o |
v |
v |
Moreover, the new substituted string can be stored in the new memory location. Please note that, during the substitution process, ASCII value for “,” and ‘.’ remains unchanged. To receive full marks, your code needs to be in the form of a subroutine that can be called using the JnS instruction. You need to write a MARIE main program to call this subroutine.
FIT1047 Introduction to Computer Systems, Networks and Security
Answer in Detail
Solved by qualified expert
Get Access to This Answer
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Hac habitasse platea dictumst vestibulum rhoncus est pellentesque. Amet dictum sit amet justo donec enim diam vulputate ut. Neque convallis a cras semper auctor neque vitae. Elit at imperdiet dui accumsan. Nisl condimentum id venenatis a condimentum vitae sapien pellentesque. Imperdiet massa tincidunt nunc pulvinar sapien et ligula. Malesuada fames ac turpis egestas maecenas pharetra convallis posuere. Et ultrices neque ornare aenean euismod. Suscipit tellus mauris a diam maecenas sed enim. Potenti nullam ac tortor vitae purus faucibus ornare. Morbi tristique senectus et netus et malesuada. Morbi tristique senectus et netus et malesuada. Tellus pellentesque eu tincidunt tortor aliquam. Sit amet purus gravida quis blandit. Nec feugiat in fermentum posuere urna. Vel orci porta non pulvinar neque laoreet suspendisse interdum. Ultricies tristique nulla aliquet enim tortor at auctor urna. Orci sagittis eu volutpat odio facilisis mauris sit amet.
Tellus molestie nunc non blandit massa enim nec dui. Tellus molestie nunc non blandit massa enim nec dui. Ac tortor vitae purus faucibus ornare suspendisse sed nisi. Pharetra et ultrices neque ornare aenean euismod. Pretium viverra suspendisse potenti nullam ac tortor vitae. Morbi quis commodo odio aenean sed. At consectetur lorem donec massa sapien faucibus et. Nisi quis eleifend quam adipiscing vitae proin sagittis nisl rhoncus. Duis at tellus at urna condimentum mattis pellentesque. Vivamus at augue eget arcu dictum varius duis at. Justo donec enim diam vulputate ut. Blandit libero volutpat sed cras ornare arcu. Ac felis donec et odio pellentesque diam volutpat commodo. Convallis a cras semper auctor neque. Tempus iaculis urna id volutpat lacus. Tortor consequat id porta nibh.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Hac habitasse platea dictumst vestibulum rhoncus est pellentesque. Amet dictum sit amet justo donec enim diam vulputate ut. Neque convallis a cras semper auctor neque vitae. Elit at imperdiet dui accumsan. Nisl condimentum id venenatis a condimentum vitae sapien pellentesque. Imperdiet massa tincidunt nunc pulvinar sapien et ligula. Malesuada fames ac turpis egestas maecenas pharetra convallis posuere. Et ultrices neque ornare aenean euismod. Suscipit tellus mauris a diam maecenas sed enim. Potenti nullam ac tortor vitae purus faucibus ornare. Morbi tristique senectus et netus et malesuada. Morbi tristique senectus et netus et malesuada. Tellus pellentesque eu tincidunt tortor aliquam. Sit amet purus gravida quis blandit. Nec feugiat in fermentum posuere urna. Vel orci porta non pulvinar neque laoreet suspendisse interdum. Ultricies tristique nulla aliquet enim tortor at auctor urna. Orci sagittis eu volutpat odio facilisis mauris sit amet.
Tellus molestie nunc non blandit massa enim nec dui. Tellus molestie nunc non blandit massa enim nec dui. Ac tortor vitae purus faucibus ornare suspendisse sed nisi. Pharetra et ultrices neque ornare aenean euismod. Pretium viverra suspendisse potenti nullam ac tortor vitae. Morbi quis commodo odio aenean sed. At consectetur lorem donec massa sapien faucibus et. Nisi quis eleifend quam adipiscing vitae proin sagittis nisl rhoncus. Duis at tellus at urna condimentum mattis pellentesque. Vivamus at augue eget arcu dictum varius duis at. Justo donec enim diam vulputate ut. Blandit libero volutpat sed cras ornare arcu. Ac felis donec et odio pellentesque diam volutpat commodo. Convallis a cras semper auctor neque. Tempus iaculis urna id volutpat lacus. Tortor consequat id porta nibh.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Hac habitasse platea dictumst vestibulum rhoncus est pellentesque. Amet dictum sit amet justo donec enim diam vulputate ut. Neque convallis a cras semper auctor neque vitae. Elit at imperdiet dui accumsan. Nisl condimentum id venenatis a condimentum vitae sapien pellentesque. Imperdiet massa tincidunt nunc pulvinar sapien et ligula. Malesuada fames ac turpis egestas maecenas pharetra convallis posuere. Et ultrices neque ornare aenean euismod. Suscipit tellus mauris a diam maecenas sed enim. Potenti nullam ac tortor vitae purus faucibus ornare. Morbi tristique senectus et netus et malesuada. Morbi tristique senectus et netus et malesuada. Tellus pellentesque eu tincidunt tortor aliquam. Sit amet purus gravida quis blandit. Nec feugiat in fermentum posuere urna. Vel orci porta non pulvinar neque laoreet suspendisse interdum. Ultricies tristique nulla aliquet enim tortor at auctor urna. Orci sagittis eu volutpat odio facilisis mauris sit amet.
Tellus molestie nunc non blandit massa enim nec dui. Tellus molestie nunc non blandit massa enim nec dui. Ac tortor vitae purus faucibus ornare suspendisse sed nisi. Pharetra et ultrices neque ornare aenean euismod. Pretium viverra suspendisse potenti nullam ac tortor vitae. Morbi quis commodo odio aenean sed. At consectetur lorem donec massa sapien faucibus et. Nisi quis eleifend quam adipiscing vitae proin sagittis nisl rhoncus. Duis at tellus at urna condimentum mattis pellentesque. Vivamus at augue eget arcu dictum varius duis at. Justo donec enim diam vulputate ut. Blandit libero volutpat sed cras ornare arcu. Ac felis donec et odio pellentesque diam volutpat commodo. Convallis a cras semper auctor neque. Tempus iaculis urna id volutpat lacus. Tortor consequat id porta nibh.
92 More Pages to Come in This Document. Get access to the complete answer.
MyAssignmenthelp.com makes sure that each writer is screened through rigorous tests to evaluate their academic credentials. If you are stuck in middle of the assignment, or not even started your dissertation, get your work done from MyAssignmenthelp.com. custom essays, online assignment help, dissertation writing services are the regular offering at MyAssignmenthelp.com. Our responsibility does not finish with writing, rather advance with complete proofread and editing. Don’t hesitate to reach us if the delivered content is not satisfying, MyAssignmenthelp.com provides unlimited revisions and amendments. homework help from UK, USA, Australia and from rest of the countries are greeted with warmth. Get your first free quote from MyAssignmenthelp.com via telephone, mail us directly or have a chat with us live. Get our 100 percent worthy services to reach a step nearer to success.
More FIT1047 FIT1047 Introduction to Computer Systems, Networks and Security: Questions & Answers
CSIS 1175 Introduction to programming
1.Develop a program that will comply to the specifications below:General Description: The program will simulate an address bookthat asks the user to enter a contact name and a telephone number. It has create, display, read, update and delete capabilities.Specifications:1.The program should be able t …
View Answer
Management
There we have the project it must be done in Sparta time you will see in the file some projects my Project is 5: Alteration Management System (Project Description ,Project report requirements ) I’m wondering if you can do the first Iteration on Monday 26 because I need my prof to look at it , …
View Answer
Management
Task
All of the work we have done so far in this module has been using the console in text mode. We
will continue using text mode as we move into writing the kernel. However, it would be nice to
have some graphics displayed while the kernel is being loaded and starting up. This assessment
gives …
View Answer
COMP.5204 Information Technology
The Rotorua Thermal Holiday park is wanting to upgrade itsbusiness systems. The current system still relies on some manual paper based work flows and records. This Holiday park is owned and run by ToiOhomai. During your holiday break youwill be contracted to provide a new integrate …
View Answer
Content Removal Request
If you are the original writer of this content and no longer wish to have your work published on Myassignmenthelp.com then please raise the
content removal request.
Choose Our Best Expert to Help You
Goodwin Kemp
Ph.D. in Chemistry from Washington State University.
450 – Completed Orders
Hire Me
Leonie Walsh
Masters of Accounting with Specialization in Environmental Economics and Policy
1912 – Completed Orders
Hire Me
Still in Two Minds? The Proof is in Numbers!
33845 Genuine Reviews With a Rating of 4.9/5.
English
Essay: 1.6 Pages, Deadline:
11 hours
I like how they help me. They are easy honest and always on time. I recommend them.
User ID: 8***35 United States
Civil Law
Home Work: 12 Pages, Deadline:
15 days
Thank you so much! It was a well-written and organized paper. Great job Thank you so much! Great job,Well written, but hoped for better grade, but i w …
User ID: 3***07 Cork, Ireland
Accounting
Assignment: 1400 Pages, Deadline:
8 days
It was very accurate. The research was done very well and I got nice marks . They really helped me with my work as I was struggling
User ID: 5***57 Sydney, Australia
Business Law
Assignment: 8 Pages, Deadline:
9 days
it was great assignment according to what was important, without mistakes, great
User ID: 8***11 Lincoln, Great Britain
Business Law
Assignment: 6.4 Pages, Deadline:
10 days
The assignment done by professional way and I got more than 85 marks for this subject. Thanks for the whole Nerddz team.
User ID: 2***65 Deepdene, Australia
Psychology
Assignment: 6.8 Pages, Deadline:
10 days
Great work done by the Team Nerddz. I got marks more than 85 for the subject. Thank you…
User ID: 2***65 Deepdene, Australia
Management
Assignment: 6 Pages, Deadline:
4 days
It was nice work and written in a good way. It helped me to increase my final grades for the same course and instructor praised me. Got good grades ov …
User ID: 5***29 Calgary, Canada
Economics
Assignment: 3.5 Pages, Deadline:
2 days
It was nice work and written in a good way. It helped me to increase my final grades for the same course and instructor praised me. 1 star less for im …
User ID: 5***29 Calgary, Canada
Management
Home Work: 3 Pages, Deadline:
1 day
This instructor was really very strict but still gave good marks. Abcdefghijklmno
User ID: 5***29 Calgary, Canada
Management
Thesis: 3 Pages, Deadline:
1 day
Amazing work on this! Got good marks excellent work by the writer. I did not expect so much marks
User ID: 5***29 Calgary, Canada
English
Essay: 1.6 Pages, Deadline:
11 hours
I like how they help me. They are easy honest and always on time. I recommend them.
User ID: 8***35 United States
Civil Law
Home Work: 12 Pages, Deadline:
15 days
Thank you so much! It was a well-written and organized paper. Great job Thank you so much! Great job,Well written, but hoped for better grade, but i w …
User ID: 3***07 Cork, Ireland
Accounting
Assignment: 1400 Pages, Deadline:
8 days
It was very accurate. The research was done very well and I got nice marks . They really helped me with my work as I was struggling
User ID: 5***57 Sydney, Australia
Business Law
Assignment: 8 Pages, Deadline:
9 days
it was great assignment according to what was important, without mistakes, great
User ID: 8***11 Lincoln, Great Britain
Business Law
Assignment: 6.4 Pages, Deadline:
10 days
The assignment done by professional way and I got more than 85 marks for this subject. Thanks for the whole Nerddz team.
User ID: 2***65 Deepdene, Australia
Psychology
Assignment: 6.8 Pages, Deadline:
10 days
Great work done by the Team Nerddz. I got marks more than 85 for the subject. Thank you…
User ID: 2***65 Deepdene, Australia
Management
Assignment: 6 Pages, Deadline:
4 days
It was nice work and written in a good way. It helped me to increase my final grades for the same course and instructor praised me. Got good grades ov …
User ID: 5***29 Calgary, Canada
Economics
Assignment: 3.5 Pages, Deadline:
2 days
It was nice work and written in a good way. It helped me to increase my final grades for the same course and instructor praised me. 1 star less for im …
User ID: 5***29 Calgary, Canada
Management
Home Work: 3 Pages, Deadline:
1 day
This instructor was really very strict but still gave good marks. Abcdefghijklmno
User ID: 5***29 Calgary, Canada
Management
Thesis: 3 Pages, Deadline:
1 day
Amazing work on this! Got good marks excellent work by the writer. I did not expect so much marks
User ID: 5***29 Calgary, Canada