Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .data
- Input: .space 60
- Prompt: .asciiz "Please enter a string up to 60 characters: "
- endl: .asciiz "\n"
- .text
- .globl main
- main:
- li $v0, 4
- la $a0, Prompt
- syscall
- ##### Take Input
- li $v0, 8
- la $a0, Input
- syscall
- #### Let's load some values
- la $s0, Input
- add $s1, $s0, 59
- li $t0, 0
- #### And Now for the loop
- print_string:
- li $v0, 11
- lb $a0, ($s1)
- syscall
- sub $s1, $s1, 1
- #### Conditions
- add $t0, $t0, 1
- blt $t0, 59, print_string
- li $v0, 10
- syscall
Add Comment
Please, Sign In to add comment