Newbie MIPS help
Hi,
Im a real newbie at mips (only started learning)
im trying to write a program that does the below.
=================================================
Im a real newbie at mips (only started learning)
im trying to write a program that does the below.
=================================================
0
Comments
that should do it.
m
any chance you could elaborate on that?? How do you read the hex value and alter it??
thank you much!!
heres a quick example of what you'd want, bear in mind that my MIPS is terribly rusty, but it seems to work in pcspim alright ...
[PHP]
# vars
.data
ask_for_input: .asciiz "enter a string: "
thestring: .asciiz ""
.text
main:
# prompt
li $v0,4
la $a0, ask_for_input
syscall
# get input
li $v0,8
li $a1,30
la $a0,thestring
syscall
li $v0,4
li $t0,0
# loop and check ...
loop: lb $t1,thestring($t0)
beq $t1,0,finished
bgt $t1,122,continue #if $t1 > "z" (0x7A) skip subtraction
blt $t1,97,continue #if $t1 < "a" (0x61) skip subtraction
sub $t1,$t1,32 #else subtract 32 (0x20)
sb $t1,thestring($t0)
continue:
addi $t0,$t0,1
j loop
finished:
li $v0,4
la $a0,thestring
syscall
li $v0,10
syscall
[/PHP]