80 lines
1.2 KiB
ArmAsm
80 lines
1.2 KiB
ArmAsm
.file "3.sy"
|
|
.option nopic
|
|
.attribute arch, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
|
|
.attribute unaligned_access, 0
|
|
.attribute stack_align, 16
|
|
.text
|
|
.globl A
|
|
.bss
|
|
.align 3
|
|
.type A, @object
|
|
.size A, 36
|
|
A:
|
|
.zero 36
|
|
.globl B
|
|
.align 3
|
|
.type B, @object
|
|
.size B, 36
|
|
B:
|
|
.zero 36
|
|
.text
|
|
.align 1
|
|
.globl main
|
|
.type main, @function
|
|
main:
|
|
.LFB6:
|
|
.cfi_startproc
|
|
addi sp,sp,-32
|
|
.cfi_def_cfa_offset 32
|
|
sd ra,24(sp)
|
|
sd s0,16(sp)
|
|
.cfi_offset 1, -8
|
|
.cfi_offset 8, -16
|
|
addi s0,sp,32
|
|
.cfi_def_cfa 8, 0
|
|
sw zero,-20(s0)
|
|
lui a5,%hi(A)
|
|
addi a0,a5,%lo(A)
|
|
call getarray
|
|
j .L2
|
|
.L3:
|
|
lw a5,-20(s0)
|
|
addiw a5,a5,1
|
|
sw a5,-20(s0)
|
|
lui a5,%hi(A)
|
|
addi a4,a5,%lo(A)
|
|
lw a5,-20(s0)
|
|
slli a5,a5,2
|
|
add a5,a4,a5
|
|
lw a4,0(a5)
|
|
lui a5,%hi(B)
|
|
addi a3,a5,%lo(B)
|
|
lw a5,-20(s0)
|
|
slli a5,a5,2
|
|
add a5,a3,a5
|
|
sw a4,0(a5)
|
|
.L2:
|
|
lw a5,-20(s0)
|
|
sext.w a4,a5
|
|
li a5,7
|
|
ble a4,a5,.L3
|
|
lui a5,%hi(B)
|
|
addi a1,a5,%lo(B)
|
|
li a0,8
|
|
call putarray
|
|
li a5,0
|
|
mv a0,a5
|
|
ld ra,24(sp)
|
|
.cfi_restore 1
|
|
ld s0,16(sp)
|
|
.cfi_restore 8
|
|
.cfi_def_cfa 2, 32
|
|
addi sp,sp,32
|
|
.cfi_def_cfa_offset 0
|
|
jr ra
|
|
.cfi_endproc
|
|
.LFE6:
|
|
.size main, .-main
|
|
.ident "GCC: (GNU) 13.3.0"
|
|
.section .note.GNU-stack,"",@progbits
|