Kaleidoscopico

264 days ago 2 views www.linusakesson.net www.linusakesson.net

00: mov pins, null 01: out pc, 4 [2] 02: jmp 01 03: out pc, 12 04: mov pins, isr 05: out pc, 4 [2] 06: mov pins, ::isr 07: out pc, 4 [2] 08: mov pins, y 09: out pc, 4 [2] 0a: mov pins, ::y 0b: out pc, 4 [2] 0c: mov pins, x 0d: out pc, 4 [2] 0e: mov pins, ::x 0f: out pc, 4 [2]

j loop # jump to loop entry-point store: add a0, a0, gp # compute target address sh a1, 0(a0) # and update the register loop: lh a0, 0(s11) # read register offset, or 0 for wait lh a1, 2(s11) # read parameter addi s11, s11, 4 # increment pointer to next instruction bnez a0, store # branch if this was a store instruction

bgeu s10, a1, loop # keep looping if we've reached the line

addi s11, s11, -4 # otherwise done for now; undo last increment

lw a1, FMC_FREQ0(a5) # get frequency of operator 0 lw a4, FMC_PHASE0(a5) # get current phase of operator 0 lhu t1, FMC_MOD0BY1(a5) # get modulation amount (8.8 fixpoint) lhu t2, FMC_MOD0BY2(a5) # get modulation amount (8.8 fixpoint) add a4, a4, a1 # advance the phase... sw a4, FMC_PHASE0(a5) # ...and store it srli a4, a4, 8 # shift right by 8 to adjust range lh a1, FMC_OUTPUT1(a5) # get the modulation input values... lh a2, FMC_OUTPUT2(a5) mul t1, t1, a1