Computer Networking: A Top-Down Approach (7th Edition)
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
Bartleby Related Questions 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**

| Type               | Instruction | Hex Opcode | Summary                                                                                          |
|--------------------|-------------|------------|--------------------------------------------------------------------------------------------------|
| **Arithmetic**     | Add X       | 3          | Adds value in AC at address X into AC, AC ← AC + X                                               |
|                    | Subt X      | 4          | Subtracts value in AC at address X into AC, AC ← AC - X                                          |
|                    | AddI X      | B          | Add Indirect: Use the value at X as the actual address of the data operand to add to AC          |
|                    | Clear       | A          | AC ← 0                                                                                           |
| **Data Transfer**  | Load X      | 1          | Loads Contents of Address X into AC                                                              |
|                    | Store X     | 2          | Stores Contents of AC into Address X                                                             |
| **I/O**            | Input       | 5          | Request user to input a value                                                                    |
|                    | Output      | 6          | Prints value from AC                                                                             |
| **Branch**         | Jump X      | 9          | Jumps to Address X                                                                               |
|                    | Skipcond (C)| 8          | Skips the next instruction based on C: if (C) = <br>- 000: Skips if AC < 0<br>- 400: Skips if AC = 0<br>- 800: Skips if AC > 0 |
| **Subroutine**     | JnS X       | 0          | Jumps and Store: Stores value of PC at address X then increments PC to X+1                       |
|                    | JumpI X     | C          | Uses the value at X as the address to jump to                                                    |
| **Indirect Addressing** | LoadI     | D          | Loads value from indirect address into AC <br>e.g. LoadI addresspointer <br>Gets address value from addresspointer, loads value at the address into AC|
|                    | StoreI      | E          | Stores value in AC at the indirect address <br>e.g. StoreI addresspointer <br>Gets value from addresspointer, stores the AC value into the address |
| **Halt**           | Halt        | 7          | End the program                                                                                  |
expand button
Transcribed Image Text:**Code Table** | Type | Instruction | Hex Opcode | Summary | |--------------------|-------------|------------|--------------------------------------------------------------------------------------------------| | **Arithmetic** | Add X | 3 | Adds value in AC at address X into AC, AC ← AC + X | | | Subt X | 4 | Subtracts value in AC at address X into AC, AC ← AC - X | | | AddI X | B | Add Indirect: Use the value at X as the actual address of the data operand to add to AC | | | Clear | A | AC ← 0 | | **Data Transfer** | Load X | 1 | Loads Contents of Address X into AC | | | Store X | 2 | Stores Contents of AC into Address X | | **I/O** | Input | 5 | Request user to input a value | | | Output | 6 | Prints value from AC | | **Branch** | Jump X | 9 | Jumps to Address X | | | Skipcond (C)| 8 | Skips the next instruction based on C: if (C) = <br>- 000: Skips if AC < 0<br>- 400: Skips if AC = 0<br>- 800: Skips if AC > 0 | | **Subroutine** | JnS X | 0 | Jumps and Store: Stores value of PC at address X then increments PC to X+1 | | | JumpI X | C | Uses the value at X as the address to jump to | | **Indirect Addressing** | LoadI | D | Loads value from indirect address into AC <br>e.g. LoadI addresspointer <br>Gets address value from addresspointer, loads value at the address into AC| | | StoreI | E | Stores value in AC at the indirect address <br>e.g. StoreI addresspointer <br>Gets value from addresspointer, stores the AC value into the address | | **Halt** | Halt | 7 | End the program |
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Similar questions
Recommended textbooks for you
Text book image
Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON
Text book image
Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science
Text book image
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning
Text book image
Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning
Text book image
Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education
Text book image
Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY