🔬 Lab
CS 240 HW ISA Assembler
This page allows you to assemble assembly code written in the HW ISA syntax into machine instructions, with output as comma-separated hexadecimal numbers suitable for pasting into CircuitVerse.
Write your assembly code here:
Push this button to see output below:
To run the machine instructions, open the CircuitVerse simulator and load up the full CPU circuit file. Switch to the “Full CPU” tab and select the RAM chip next to the Program Counter that’s labeled “Instruction Memory”. From the Properties pane, select “Load Data” and paste in the data you copied from here (make sure to enable padding values).
Then hit the “CLK” button followed by “Reset” and “Reset PC to 0” to reset everything. If it’s working, you should see your first instruction in the hex digits that show the current instruction.
Note that the JMP instruction is NOT implemented (that’s part of the Arch assignment). If your program uses JMP, try to replace that with BEQ (you can do BEQ R1, R1, n to do a jump that always triggers, although the range is limited which can cause problems).
