data. str:. .space 40. fstr:. .space 150. prompt:. .asc

Added on - Sep 2019

Trusted by 2+ million users,
1000+ happy students everyday
Showing pages 1 to 2 of 5 pages
.datastr: .space 40fstr: .space 150prompt: .asciiz "Input a string:"output: .asciiz "Output string:"newline: .asciiz"\n".text.globl mainmain:# display promptli $v0, 4la $a0, promptsyscall# accept input stringli $v0, 8la $a0, strli $a1, 64syscallli $t1, 0 # initiate indexli $t7, 0 # output indexloop:li $t6 , 0lb $t0 str($t1)beqz $t0 exit# check if "#"li $t2, '#'beq $t0, $t2, hash_to_anop# check if "%"li $t2, '%'beq $t0, $t2, percent_to_gnop# check if "$"
Desklib Logo
You are reading a preview
Upload your documents to download or

Become a Desklib member to get access