Assembly Language Instructions

RISC Philosophy: fixed instruction lengths (have more than one size instructions), load-store instruction sets, limited number of addressing models, small number of simple operations (except matrix multiplications), easier for pipelined implementation
Instruction sets are measured by how well compilers use them as opposed to how well assembly language programmers use them.
Key trade-off:
RISC Design Principles

KISS is not a design principle.
The new, open standard, license/royalty-free ISA
Variants:

E 从RV32I的32个通用寄存器减少到16个,但是保持32位的数据宽度和地址空间。
C is Compressed extension, with 16b instructions
The target architecture of this course is RV32I
When we say RV32I, 32 means 1) The general register width is 32 bit; 2) The addressability is 32 bit. 可寻址性是 32 位: 这意味着处理器可以使用 32 位的地址来访问内存中的数据。 因此,RV32I 可以寻址 2^32 字节 (4GB) 的内存空间。
在RV64I中,instruction length也是32bits。

注意:PC也是32位的,里面存放的是下一条指令在内存中的地址,告诉处理器接下来要执行哪条指令。
cycle(记录时钟周期数)和instret(记录执行的指令数)。这些都是只读的,程序只能看,不能改。hartid(硬件线程ID,用于多核处理器),以及mepc和mcause(用于处理错误和中断)。mtohost(用于向外部输出数据)。Hart就是RISC-V处理器中的一个执行单元,它可以独立地执行指令。 在多核处理器中,每个核就是一个Hart。
The abbreviation letters following RV must follow the defined order
Base Implementation (I or E), Standard extensions, more Standard ext., Non-standard ext.
X0 is always zero. Why?

用于比较和跳转
内存提示 (高级用法)
load to x0 作为内存提示,比如预取数据到缓存。 这种操作不会真正修改X0的值,只是告诉处理器提前加载一些数据,提高程序运行速度。
Based on FORMAT: