I'm currently working on a school assignment using a theoretical CPU with a very limited instruction set. The available instructions are as follows: Code: add // add registers addi // add immediate sub lui // load upper immediate and andi or ori xor xori nor sll // shift left logical srl // shift right logical sra // shift right arithmetic lw // load word lh // load half word lb // load byte sw // store word sh sb beq // branch on equal bne // branch on not equal blt // branch on less than ble // branch on less than or equal j // jump jal // jump and link jr // jump register Registers are named as r0, r1, ..., r31. One part of the assignment is to write a very simple program for this CPU in assembly language, "such as 1+1=2". I'm an extreme beginner at assembly language and would therefore like to ask for some tips. For example, would the below program work to calculate 1+1? (comments ignored): addi r1, r0, 1 // add 1 to zero register, store in r1 addi r2, r0, 1 // add 1 to zero register, store in r2 add r3, r2, r1 // add r1 and r2, store in r3 sb r3 0(r1) // store contents of r3 to memory address 1 (r1 = 1 and dpl = 0) I may be completely off track with this so please tell me if it looks weird. Also, if you have any ideas about slightly more complex programs (that use a branching instruction, for example) I'd greatly appreciate your suggestions.