Simple Computer Tool
Send feedback to
Jean-Philippe Ouellet
<jpo@vt.edu>
Code (assembly or bytecode)
// Comments start with // or # // Comments may appear on the same line as instructions // // Assembly instructions are specified like so: // MNEMONIC OP[, OP[, OP]] // // Bytecode instructions are specified as 4 hex digits // // Assembly and bytecode may be mixed at will // (useful when implementing new instructions) // // Values are given in C-style syntax: // 0xBEEF for base 16 // 1984 for base 10 // \007 for base 8 // with an optional - before the radix specifier // prefix to denote a negative value. // // Additional whitespace is allowed anywhere. // // To keep backwards compatibility, values may be prefixed with 'r', // and opcodes may be lower case. // Starter source code program for ECE 2504 Spring 2013 // Project 4 // // Add your header comments (name, date, etc.) here. // // Do not change the following segment of code from here // to the comment "CHANGE HERE" below. ldi r0, 7 adi r0, r0, 6 jmp r0 // The following set of load instructions // read the final values of the variables in // memory locations 2-5 into r1-r5 so that we // can see them on the LEDs // Your code must jump to this point after it has // stored the results in data memory. You should jump // to location 3. ldi r1, 2 ld r2, r1 inc r1, r1 ld r3, r1 inc r1, r1 ld r4, r1 inc r1, r1 ld r5, r1 // Now loop forever ldi r0, 0 // The address of this brz is the one used in validation: Address C. brz r0, 0 // You are permitted to add code after this point // CHANGE HERE and beyond // Your last instruction should be a jump to location 3 // in order to read the variables into registers r2-r5. ldi r0, 3 jmp r0
Load
(dis)assembler output
Offset Radix
Decimal
Hexadecimal
Comment Source
Source code
Assembly
Assembly Format
Prefix registers
Align operands
Simulation
Run