7. Memory: The Computer’s Notebook
Store and actually retrieve a byte after overwriting R0.
Open this lesson →
1. Predict and trace
Before running the Try program, predict its output and trace the first three executed instructions. Track the relevant registers, flags or memory as needed. Then step the program to compare.
LOAD 42
STORE 0
LOAD 99
STORE 1
LOAD 0
LOAD [0]
PRINT
LOAD [1]
PRINT
HALT
Queue input: None
Initialize memory: All bytes initially zero
2. Build and check
Read a byte-valued input (0–255), save it at memory address 10, clear R0, then retrieve it from memory and print it.
Required instruction types: INPUT, STORE, LOAD
Starter program
INPUT
STORE 10
LOAD 0
# Read address 10 back.
HALT
Your program and notes
3. Explain the machine
Which code reads memory 10, and which loads the number10?
8. Addresses in Registers
Use an address as data and read a lookup table.
Open this lesson →
1. Predict and trace
Before running the Try program, predict its output and trace the first three executed instructions. Track the relevant registers, flags or memory as needed. Then step the program to compare.
STORE 12 0
STORE 99 7
LOAD 7 R1
LOAD [R1]
PRINT
HALT
Queue input: None
Initialize memory: 0: 12
2. Build and check
Read an address from INPUT, copy it to R1, retrieve the seeded byte at that address, and print the byte. The checker changes both address and stored value.
Required instruction types: INPUT, COPY, LOAD
Starter program
INPUT
COPY R0 R1
# Read through R1.
HALT
Your program and notes
3. Explain the machine
How do LOAD R1 and LOAD [R1] differ when R1=7 and memory 7=99?
9. Bytes and Boundaries
See why memory wraps while registers do not.
Open this lesson →
1. Predict and trace
Before running the Try program, predict its output and trace the first three executed instructions. Track the relevant registers, flags or memory as needed. Then step the program to compare.
LOAD 256
PRINT
STORE 255
LOAD [255]
PRINT
LOAD -1
STORE 255
LOAD [255]
PRINT
HALT
Queue input: None
Initialize memory: All bytes initially zero
2. Build and check
Read an integer, store it at address 255, retrieve the resulting byte, and print it. Do not calculate a substitute fixed answer.
Required instruction types: INPUT, STORE, LOAD
Starter program
INPUT
# Store at the final valid address, then read back.
HALT
Your program and notes
3. Explain the machine
Why is value256 storable at address 255, while address 256 is invalid?