Prev | Home | Next |
Suggestion Box |
LADDx 0x1000, NULL, R3 ; R3 = i (loop count) LOOP_D: ADD R11, R3, R12 ; R12 = &B[i] DLOAD 0(R12), R13 ; R13 = M[R12] !!Thanks to Dominic for pointing this out.ADD R14, R3, R15 ; R15 = &C[i] DLOAD 0(R15), R16 ; R16 = M[R15] !! NOP MULx R13, R16, R10 ; R10 = B[i] * C[i] ADD R8, R3, R9 ; R9 = &A[i] DSTORE R10, 0(R9) ; M[R9] = R10 (result) !! LSUBc R3, 1, R3 ; i = i - 1 JUMPGTE LOOP_D NOP
NOTE: the syntax is inst src1 src2 dest
NOTE: with displacement addressing mode, if the displacement
field is 0, you don't need to write it
Prev | Home | Next |
Suggestion Box |