小编You*_*med的帖子

使用 mips 组件检查回文

.data

org_str: .space 256
rev_str: .space 256
str: .asciiz "Enter the Line: "
pal: .asciiz "palindrome"
not_pali: .asciiz "Not palindrome"

.text 
.globl main
main:
    
    
    li $v0, 4
    la $a0, str
    syscall
    
    # Taking String from the user
    li $v0, 8
    la $a0, org_str
    li $a1, 256
    syscall
    
    # Initilize $t0 and $t2
    li  $t0, 0
    li  $t1, 0
    
loop_len:
    add $t1, $a0, $t0
    lb  $t2, 0($t1) # Load the data in the byte in $t2
    beqz    $t2, len_exit   # Loop …
Run Code Online (Sandbox Code Playgroud)

assembly mips mips32

0
推荐指数
1
解决办法
123
查看次数

标签 统计

assembly ×1

mips ×1

mips32 ×1