3. This program is for extra credit. Write a MARIE program that takes you name as input and outputs the string "Hello, yourname". Modify the pointer example from the .pdf Powerpoint slides so that string output is performed in a subroutine. The input to the subroutine will be the starting location of the string in memory. This function assumes that the string is null terminated (i.e., the last character in the string is Dec 000). The function should use a loop to access the characters which ends when the null terminator is accessed. Write another subroutine that will input a string by getting the individual characters of the string and storing them sequentially in memory. The input to the function will be the pointer to the first location for the string. The function should use a loop to input the characters and will end when the user enters the null terminator. When you input the characters, you can set the input mode to Unicode if you want to enter the actual letters, however, for non-printable characters like [space] and [null], you will need to switch the input mode to decimal or hex. You can always choose to enter the characters using their hex or decimal ASCII codes. There are numerous ASCII tables on the internet where you can look up the appropriate ASCII encodings for your characters. Lay out your memory so that the constant string comes last and is followed by a named location for your name variable (initialized to Dec 000). Your name will be stored at the very end of the program starting at this identifier. (Hint, switch the output mode to Unicode for display).

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
3. This program is for extra credit. Write a MARIE program that takes you name as input and outputs
the string "Hello, yourname".
Modify the pointer example from the .pdf Powerpoint slides so that string output is performed in a
subroutine. The input to the subroutine will be the starting location of the string in memory. This
function assumes that the string is null terminated (i.e., the last character in the string is Dec 000).
The function should use a loop to access the characters which ends when the null terminator is
accessed.
Write another subroutine that will input a string by getting the individual characters of the string
and storing them sequentially in memory. The input to the function will be the pointer to the first
location for the string. The function should use a loop to input the characters and will end when the
user enters the null terminator. When you input the characters, you can set the input mode to
Unicode if you want to enter the actual letters, however, for non-printable characters like [space]
and [null], you will need to switch the input mode to decimal or hex. You can always choose to enter
the characters using their hex or decimal ASCII codes. There are numerous ASCII tables on the
internet where you can look up the appropriate ASCII encodings for your characters.
Lay out your memory so that the constant string comes last and is followed by a named location for
your name variable (initialized to Dec 000). Your name will be stored at the very end of the program
starting at this identifier.
(Hint, switch the output mode to Unicode for display).
Transcribed Image Text:3. This program is for extra credit. Write a MARIE program that takes you name as input and outputs the string "Hello, yourname". Modify the pointer example from the .pdf Powerpoint slides so that string output is performed in a subroutine. The input to the subroutine will be the starting location of the string in memory. This function assumes that the string is null terminated (i.e., the last character in the string is Dec 000). The function should use a loop to access the characters which ends when the null terminator is accessed. Write another subroutine that will input a string by getting the individual characters of the string and storing them sequentially in memory. The input to the function will be the pointer to the first location for the string. The function should use a loop to input the characters and will end when the user enters the null terminator. When you input the characters, you can set the input mode to Unicode if you want to enter the actual letters, however, for non-printable characters like [space] and [null], you will need to switch the input mode to decimal or hex. You can always choose to enter the characters using their hex or decimal ASCII codes. There are numerous ASCII tables on the internet where you can look up the appropriate ASCII encodings for your characters. Lay out your memory so that the constant string comes last and is followed by a named location for your name variable (initialized to Dec 000). Your name will be stored at the very end of the program starting at this identifier. (Hint, switch the output mode to Unicode for display).
<
5:37:
Assembly Language Pro...
Pointer Example
●
• This is Example 4.4 from the
textbook which
demonstrates the use of the
Loadl and Storel instructions
to print a string
• It is important to remember
that at the assembly level, all
I/O is character-based and
only one character at a time
can be sent to an output
device
Getch,
Outp,
One,
Chptr,
String,
LoadI Chptr
Skipcond 400
Jump Outp
Halt
Output
Load Chptr
Add One
Store Chptr
Jump Getch
Hex 0001
Hex 00B
Dec 072
Dec 101
Dec 108
Dec 108
Dec 111
Dec 032
Dec 119.
Dec 111
Dec 114
Dec 108
Dec 100
Dec 033
Dec 000
/H
/e
/1
/1
/ [space]
/W
/0
/r
/1
/d
/[null]
LTE 100
D
/Load the character found at
/address Chptr
/If AC = 0, skip next instruction
/Otherwise, proceed with operation
/Output the character
/Move pointer to next character
/Jump to "current" character
/Pointer to "current" character
/String definition starts here
Transcribed Image Text:< 5:37: Assembly Language Pro... Pointer Example ● • This is Example 4.4 from the textbook which demonstrates the use of the Loadl and Storel instructions to print a string • It is important to remember that at the assembly level, all I/O is character-based and only one character at a time can be sent to an output device Getch, Outp, One, Chptr, String, LoadI Chptr Skipcond 400 Jump Outp Halt Output Load Chptr Add One Store Chptr Jump Getch Hex 0001 Hex 00B Dec 072 Dec 101 Dec 108 Dec 108 Dec 111 Dec 032 Dec 119. Dec 111 Dec 114 Dec 108 Dec 100 Dec 033 Dec 000 /H /e /1 /1 / [space] /W /0 /r /1 /d /[null] LTE 100 D /Load the character found at /address Chptr /If AC = 0, skip next instruction /Otherwise, proceed with operation /Output the character /Move pointer to next character /Jump to "current" character /Pointer to "current" character /String definition starts here
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education