1 year ago

#282863

test-img

Mazen S.Alghamdi

Does someone know what's wrong with this assembly language code?

I'm trying to run this assembly code it supposed to prints out all the multiples of A from A to A*B but the output is null, nothing is showing on the screen

.data
   space: .asciiz " "
   newline: .asciiz "\n"

.text
.globl main
main:
  li $v0, 5       
  syscall
  move $t0, $v0    
  li $v0, 5     
  syscall
  move $t1, $v0   
  blez $t1, exit       
  mul $t2, $t0, $t1  
  move $t3, $t0    
loop:
  move $a0, $t3   
  li $v0,1            
  syscall             
  beq $t2, $t3, endloop        
  add $t3, $t3, $t0               
  la $a0, space                    
  li $v0, 4                            
  syscall
   j loop 

 endloop:
   la $a0, newline 
   li $v0, 4 
   syscall

exit: 
   li $v0, 10 
   syscall 

assembly

qtspim

0 Answers

Your Answer

Accepted video resources