48 lines
678 B
ArmAsm
48 lines
678 B
ArmAsm
// See LICENSE for license details.
|
|
#include "encoding.h"
|
|
|
|
.section .func1
|
|
.globl _func1
|
|
//addr 4字节对齐 4字节指令
|
|
_func1:
|
|
lui a0,0x42
|
|
ret
|
|
|
|
.section .func2
|
|
.globl _func2
|
|
//addr 4字节对齐指令2字节长
|
|
_func2:
|
|
li a0, 15
|
|
nop
|
|
ret
|
|
|
|
|
|
.section .func3
|
|
.type _func3,@function
|
|
.globl _func3
|
|
//addr 2字节对齐 4字节指令
|
|
_func3:
|
|
/*
|
|
addi sp,sp,-32
|
|
sw s0,28(sp)
|
|
addi s0,sp,32
|
|
sw a0,-20(s0)
|
|
li a5,3
|
|
mv a0,a5
|
|
lw s0,28(sp)
|
|
addi sp,sp,32
|
|
// ret
|
|
*/
|
|
lui a0,0x43
|
|
//nop
|
|
ret
|
|
|
|
|
|
.section .func4
|
|
.globl _func4
|
|
//addr 2字节对齐指令2字节长
|
|
_func4:
|
|
li a0, 16
|
|
ret
|
|
|