Assembler for the 6-Instruction Processor
from Chapter 8 of "Digital Design" (DD) by Frank Vahid, John Wiley and Sons, First Edition, 2006, www.ddvahid.com.
Copyright (c) 2007 Frank Vahid. Permission for educational use granted to instructors who require DD for a course, and to all students (whether using DD or not). Any other use requires explicit author permission.
Write/modify/paste assembly code (to be safe, keep a copy elsewhere).
Press "Assemble" button to generate machine code.
Press "Step" to execute one instruction, press step again to
execute next instruction.
Press "Reset" to reset the instruction simulator
MOV Ra, d
Load data from memory location d into register a.
MOV d, Ra
Store data from register a into memory location d.
ADD Ra, Rb, Rc
Add register b and register c and store the result in register a.
MOV Ra, #c
Load the constant c into register a.
SUB Ra, Rb, Rc
Subtract register c from register b (RF[b] - R[c]) and store the result in register a.
Jump if zero
JMPZ Ra, offset
Set the program counter (PC) to PC + offset if register a is 0.
Assembly code notes: Each instruction should end with ";".
Any instruction may begin with a label-- "label:".
Constants must be decimal numbers.