Your Question: Write a program in MARIE assembler to print “Hello World!”  Define the message as a “C” style NULL terminated string. The program must implement a loop,  like the pseudocode below. str =“Hello World!”   index = 0 while str[index] != 0      output str[index]       index = index + 1   ORG 100 START,  LOAD STR         STORE INDEX LOOP,   LOAD INDEX         ADD ONE         STORE INDEX         LOAD INDEX         ADD STR         STORE X         LOAD X         OUTPUT         JUMP END           JUMP LOOP END,    HALT STR,    HEX 0048         HEX 0065         HEX 006C         HEX 006C         HEX 006F         HEX 0020         HEX 0057         HEX 006F         HEX 0072         HEX 006C         HEX 0064         HEX 0021         HEX 0000 INDEX,  DEC 0 ONE,    DEC 1 X,      DEC 0 END  START   // it does not print anything, help pls

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Your Question:
Write a program in MARIE assembler to print “Hello World!” 
Define the message as a “C” style NULL terminated string.
The program must implement a loop,  like the pseudocode below.
str =“Hello World!”  
index = 0
while str[index] != 0
     output str[index] 
     index = index + 1
 

ORG 100

START,  LOAD STR
        STORE INDEX
LOOP,   LOAD INDEX
        ADD ONE
        STORE INDEX
        LOAD INDEX
        ADD STR
        STORE X
        LOAD X
        OUTPUT
        JUMP END  
        JUMP LOOP

END,    HALT

STR,    HEX 0048
        HEX 0065
        HEX 006C
        HEX 006C
        HEX 006F
        HEX 0020
        HEX 0057
        HEX 006F
        HEX 0072
        HEX 006C
        HEX 0064
        HEX 0021
        HEX 0000

INDEX,  DEC 0
ONE,    DEC 1
X,      DEC 0

END  START

 
// it does not print anything, help pls 
Code Table &
Туре
Arithmetic
Data Transfer
1/0
Branch
Subroutine
Indirect
Addressing
Instruction
Add X
Subt X
Addl X
Clear
Load X
Store X
Input
Output
Jump X
Skipcond
(C)
JnS X
Jumpl X
Loadl
Storel
Halt
Hex
Opcode
3
4
B
A
1
2
5
6
9
8
0
C
D
E
7
Adds value in AC at address X into AC, AC ← AC + X
Subtracts value in AC at address X into AC, AC ← AC - X
Add Indirect: Use the value at X as the actual address of the
data operand to add to AC
AC ← 0
Summary
Loads Contents of Address X into AC
Stores Contents of AC into Address X
Request user to input a value
Prints value from AC
Jumps to Address X
Skips the next instruction based on C: if (C) =
000: Skips if AC < 0
- 400: Skips if AC = 0
- 800: Skips if AC > 0
Jumps and Store: Stores value of PC at address X then
increments PC to X+1
Uses the value at X as the address to jump to
Loads value from indirect address into AC
e.g. Loadl addresspointer
Gets address value from addresspointer, loads value at the
address into AC
Stores value in AC at the indirect address.
e.g. Storel addresspointer
Gets value from addresspointer, stores the AC value into the
address
End the program
Transcribed Image Text:Code Table & Туре Arithmetic Data Transfer 1/0 Branch Subroutine Indirect Addressing Instruction Add X Subt X Addl X Clear Load X Store X Input Output Jump X Skipcond (C) JnS X Jumpl X Loadl Storel Halt Hex Opcode 3 4 B A 1 2 5 6 9 8 0 C D E 7 Adds value in AC at address X into AC, AC ← AC + X Subtracts value in AC at address X into AC, AC ← AC - X Add Indirect: Use the value at X as the actual address of the data operand to add to AC AC ← 0 Summary Loads Contents of Address X into AC Stores Contents of AC into Address X Request user to input a value Prints value from AC Jumps to Address X Skips the next instruction based on C: if (C) = 000: Skips if AC < 0 - 400: Skips if AC = 0 - 800: Skips if AC > 0 Jumps and Store: Stores value of PC at address X then increments PC to X+1 Uses the value at X as the address to jump to Loads value from indirect address into AC e.g. Loadl addresspointer Gets address value from addresspointer, loads value at the address into AC Stores value in AC at the indirect address. e.g. Storel addresspointer Gets value from addresspointer, stores the AC value into the address End the program
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY