5.5 Các ví dụ xử lý chuỗi, xử lý mảng
Các lệnh đã biết cho đến giờ:
Thiết lập các tham số trong menu Simulator -> Settings:
Bare Machine ON, Allow Pseudo Instructions OFF, Load Trap File OFF, Delayed
Branches ON, Delayed Loads ON, Mapped IO OFF, Quiet OFF
loop: beq $8,$0,exit # done when pattern == 00
sll $0,$0,0 #
delay or nop after a branch
#
or jump instruction
srl $8,$8,1 #
shift right one bit
addu $7,$7,1 # increment shift count
j loop # repeat
sll $0,$0,0
exit: j exit # sponge for extra cycles
sll $0,$0,0
## End of file
add
div
mflo
slt, slti
addi
divu
mult
sltu, sltiu
addiu
j
multu
sra
addu
lb
nor
srl
and
lbu
or
sub
andi
lh
ori
subu
beq
lhu
sb
sw
bgez
lui
sh
xor
bltz
lw
sll
xori
bne
mfhi
##
To Lower Case
##
##
## Write a program that converts the string to all lower case
## characters. Do this by adding 0x20 to each character in the string.
## Register Use:
##
## $8 --- current character
## $10 --- character pointer