Inst.SB(_memBase, _tmp, 0x6), Inst.ADDI(_tmp, 0, 0b1110_0000), # 7 Inst.SB(_memBase, _tmp, 0x7), Inst.ADDI(_tmp, 0, 0b1111_1110), # 8 Inst.SB(_memBase, _tmp, 0x8), Inst.ADDI(_tmp, 0, 0b1111_0110), # 9 Inst.SB(_memBase, _tmp, 0x9), Inst.ADDI(_tmp, 0, 0xF2), # 7seg: 0 Inst.ADDI(_count, _num0, 64), Inst.ADDI(_tmp2, _addrBase, 0), Inst.SB(_tmp2, _tmp, 0), Inst.ADDI(_tmp2, _tmp2, 1), Inst.SUB(_count, _count, _num1), Inst.BEQ(_count, _num0, 4), Inst.JAL(0, -4 * 5), Inst.ADDI(_tmp, 0, 0xDA), # 7seg: 0 Inst.ADDI(_count, _num0, 64), Inst.ADDI(_tmp2, _addrBase, 0), Inst.SB(_tmp2, _tmp, 0), Inst.ADDI(_tmp2, _tmp2, 1), Inst.SUB(_count, _count, _num1), Inst.BEQ(_count, _num0, 4), Inst.JAL(0, -4 * 5), Inst.ADDI(_tmp, 0, 0x60), # 7seg: 0 Inst.ADDI(_count, _num0, 64), Inst.ADDI(_tmp2, _addrBase, 0), Inst.SB(_tmp2, _tmp, 0),
from inst import Inst, asm, print_asm, print_ihex program = [ Inst.LUI(5, 0x04000000), Inst.ADDI(6, 0, 0xFF), Inst.LW(10, 5, 0x48), Inst.ANDI(11, 10, 0x01), Inst.BEQ(11, 0, 0x08), Inst.SB(5, 6, 0x000), Inst.JAL(0, 4), Inst.SB(5, 0, 0x000), Inst.JAL(0, -28) ] r = asm(program) print_asm(r) print() print_ihex(r)