An Example Super Simple Machine Program
Problem
Write a machine code program to write zeros into memory. The start address is
given at address 0x80 and the number of words to write is given at address
0x84. We assume the start address is word aligned and the number of words to
write is greater than zero.
Pseudocode (optional)
Write out each step your assembly language program needs to do. You can skip
this if you find yourself writing assembly code.
Assembly Code
Translate the pseudocode from above if necessary into assembly code.
Machine Code
Translate the assembly code into machine code using this chart:
Operation | Opcode | Meaning of other bytes |
ADD | 0x20 | Dest. reg. | Reg. 1 | Reg. 2 |
IMM | 0x60 | Dest. reg. | Unused | Value |
BNE | 0x11 | Dest. address | Reg. 1 | Reg. 2 |
LOAD | 0xA4 | Dest. reg. | Reg. with address | Unused |
STORE | 0x08 | Unused | Reg. with dest. address | Source reg. |
CSE 378 Spring 2002 - Section 2