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:

OperationOpcodeMeaning of other bytes
ADD0x20Dest. reg.Reg. 1Reg. 2
IMM0x60Dest. reg.UnusedValue
BNE0x11Dest. addressReg. 1Reg. 2
LOAD0xA4Dest. reg.Reg. with addressUnused
STORE0x08UnusedReg. with dest. addressSource reg.














CSE 378 Spring 2002 - Section 2
First Previous Page 1 Next Last