riscv汇编对应C语言,RISC-V汇编指南

本文档详细介绍了RISC-V汇编程序员手册,包括版权信息、命令行参数、寄存器、地址格式、指令集、指令别名、伪指令、汇编重定位和标签的使用方法。此外,还展示了如何通过汇编加载绝对和相对地址,以及如何使用浮点数、控制和状态寄存器。
摘要由CSDN通过智能技术生成

RISC-V Assembly Programmer’s Manual

Copyright and License Information

The RISC-V Assembly Programmer’s Manual is

© 2017 Palmer Dabbelt palmer@dabbelt.com

© 2017 Michael Clark michaeljclark@mac.com

© 2017 Alex Bradbury asb@lowrisc.org

It is licensed under the Creative Commons Attribution 4.0 International License (CC-BY 4.0). The full license text is available at https://creativecommons.org/licenses/by/4.0/.

Command-Line Arguments

I think it’s probably better to beef up the binutils documentation rather than duplicating it here.

Registers

ISA and ABI register names for X, F, and CSRs.

Addressing

Addressing formats like %pcrel_lo(). We can just link to the RISC-V PS ABI document to describe what the relocations actually do.

Instruction Set

Links to the various RISC-V ISA manuals that are supported.

Instructions

Here we can just link to the RISC-V ISA manual.

Instruction Aliases

ALIAS line from opcodes/riscv-opc.c

Pseudo Ops

Both the RISC-V-specific and GNU .-prefixed options.

The following table lists assembler directives:

Directive

Arguments

Description

.align

integer

align to power of 2 (alias for .p2align)

.file

“filename”

emit filename FILE LOCAL symbol table

.globl

symbol_name

emit symbol_name to symbol table (scope GLOBAL)

.local

symbol_name

emit symbol_name to symbol table (scope LOCAL)

.comm

symbol_name,size,align

emit common object to .bss section

.common

symbol_name,size,align

emit common object to .bss section

.ident

“string”

accepted for source compatibility

.section

[{.text,.data,.rodata,.bss}]

emit section (if not present, default .text) and make current

.size

symbol, symbol

accepted for source compatibility

.text

emit

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值