help assembly language code

Thread Starter

lephuduc

Joined Oct 11, 2012
5
I'm writing this code, can anyone help me to find out the mistakes?

slt $t3,$s5,$zero # s5 contains “k”
bne $t3,$zero,Exit
bne $t3,$zero,Exit
slt $t3,$s5,$t2 # t2 contains “4”
beq $t3,$zero,Exit
add $t1,$s5,$s5
add $t1,$t1,$t1 # PC address = 4*k

add $t1,$t1,$t4 # t4 - jump table base address
lw $t0,0($t1)
jr $t0 # new instruction: “jump reg.”
L0: . . . (R-format)|
L1: . . .
L2: . . .
L3: . . .
Exit:
 

kubeek

Joined Sep 20, 2005
5,744
What assembler do you use, and what is the code supposed to do? If you know the mistakes, why ask us to find them?
 

Thread Starter

lephuduc

Joined Oct 11, 2012
5
cause my teacher said that my code is not clear, he asked me to find mistakes and rewrite the code, but I cannot find the mistakes
 

takao21203

Joined Apr 28, 2012
3,695
the question should be: How can I become a programmer.

Above excerpt clearly is not a program.

If you aren't (yet) a programmer, assembler is not the best way to make progress with that.
 
Top