Professional Documents
Culture Documents
L3 AssemblyLanguage
L3 AssemblyLanguage
2
Levels of Representation/Interpretation
3
Assembly Language
4
5
Mainstream ISA
6
Variables in Hardware
7
Registers vs. Memory
8
RISCV Registers
11
RISCV Instruction Syntax
• 1 operator, 3 operands
• Keep hardware simple via regularity.
12
RISCV Addition and Subtraction
13
RISCV Arithmetic: Example1
14
RISCV Arithmetic: Example2
15
Zero Register
16
Constant or Immediate Operands
18
Memory Operands – Data Transfer
• Load
• Store
19
Memory is Byte-Addressed
20
Big Endian vs. Little Endian
21
Data Transfer Instructions - Examples
22
Data Transfer Instructions - Examples
23
Alignment Restriction
24
RISC-V Logical Instructions
25
RISC-V Logical Instructions
26
Logical NOT Operation in RISCV
27
Logical Shifting
28
Arithmetic Shifting
29
Decision Making Instructions
30
Types of Branches
31
Example if Statement
32
Example if-else Statement
33
Other Conditional Branch Instructions
34
Loops in C/Assembly
35
C Loop Mapped to RISCV Assembly
36