1/137
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
What does RISC-V stand for?
Reduced Instruction Set Computer - Five.
What are the four types of contents in assembly source code?
Comment, Directive, Label, CPU Instruction.
What symbol indicates a comment in assembly code?
A pound sign '#'.
What is the purpose of the .data directive?
It indicates the section for global, initialized variables.
What is the meaning of BSS in an executable?
Block Started by Symbol - it contains uninitialized variables.
What is a key characteristic of RISC-V architecture?
It is a load/store architecture.
What are the register names in RISC-V?
Registers can be referred by position (e.g., x0-x31) or function (e.g., a0 for argument) .
What does the 'add' instruction do in RISC-V assembly?
It adds two registers and stores the result in a destination register.
What does the 'li' pseudo-instruction do?
Loads an immediate value into a register.
What section of an executable contains CPU instructions?
The text section.
How is a global label made visible to the linker?
.global directive.
What is the result of the 'sub' instruction in RISC-V?
It subtracts the second source register from the first and stores the result in the destination register.
What instruction type is 'addi'?
I-type instruction.
What does the 'jal' instruction do?
It performs a jump and link; saving the return address.
What registers are considered saved registers (callee-saved)?
Registers x8, x9, x18 - x27.
What information does 'beq' instruction check?
It checks if two registers are equal and performs a jump if they are.
What type of instruction is 'lw'?
Load word instruction.
In RISC-V, how is floating point addition performed?
Using instructions like 'fadd.s' or 'fadd.d'.
What does the 'fsw' instruction do?
It stores a float from a register to memory.
What does the 'slt' instruction accomplish?
Sets the destination register to 1 if rs1 is less than rs2.
What is the purpose of using 'ecall' in RISC-V?
To invoke a service.
Which registers are used for function arguments?
Registers a0 to a7.
What does the .asciz directive do?
Creates a null-terminated ASCII string.
How are branch instructions like 'bne' structured in RISC-V?
They check conditions and jump to a label based on the comparison.
What is the result of the 'or' instruction?
Performs a bitwise OR operation between two registers.
How many bits wide are RISC-V registers?
64 bits.
What does 'fneg.s' do?
Negates a single-precision floating-point value.
What kind of notation does the 'mul' instruction use?
R-type notation.
What instruction type is used to load a byte?
Load byte instruction (lb).
What service number needs to be stored in which register for making an ecall?
Service number in register a7.
What is the assembly code directive to create a byte value?
.byte directive.
What does the instruction 'jalr' do?
Jumps to an address held in a register.
What does .bss stand for in assembly?
Block Started by Symbol; it contains uninitialized variables.
What is one benefit of using RISC instruction set?
It simplifies the design of the CPU.
Which register is hardwired to zero in RISC-V?
Register x0.
How is the instruction 'div' categorized?
R-type instruction.
What does the 'ret' instruction accomplish in RISC-V?
Returns from a subroutine.
What function do the 'a' registers (a0-a7) serve in function calls?
They are used for passing function arguments.
What does 'srl' instruction perform?
Performs a logical right shift.
What registers are considered temporary registers (caller-saved)?
Registers t0 - t6.
Give an example of an immediate value instruction.
addi rd, rs, imm.
What does the 'srai' instruction do?
Performs an arithmetic right shift.
What is the outcome of the 'rem' instruction?
Calculates the remainder of the division of two registers.
What do floating-point instructions use in their operation?
They operate on float values stored in registers.
What does 'li' do when used with an immediate large number?
Loads a large constant directly into a register.
What kind of instruction is 'xori'?
I-type logical immediate instruction.
What method do the jump and link instructions use?
PC-relative addressing.
What purpose do assembler directives serve?
They provide instructions to the assembler.
For which architecture is RISC-V designed?
It is designed for reduced instruction set computing.
How does the instruction 'lbu' differ from 'lb'?
'lbu' loads an unsigned byte.
What is the instruction to load a double-precision float from memory?
fld instruction.
Name two types of floating point data types in RISC-V.
Single (S) and Double (D).
What is the distinction between 'blt' and 'bge'?
'blt' jumps if less than, 'bge' jumps if greater than or equal.
What does 'sltu' indicate in its operation?
It performs a set less than unsigned.
What registers are affected by ‘ecall’ when making a system call?
The registers 'a7' and possibly others - like 'a0', 'a1', etc. for arguments.
What is the difference in addressing between 'la' (non-PIC) and 'la' (PIC)?
Non-PIC uses absolute addresses, PIC uses position-independent addressing.
What does 'nop' stand for?
No operation instruction.
How are logical shifts structured in RISC-V instructions?
Using shifter instructions like 'sll' or 'srl'.
Which type of registers are used for return addresses?
Return address register (ra - x1).
Explain what 'fmul.s' does.
Multiplies two single-precision floating point numbers.
What is the general format for RISC-V assembly instructions?
What is meant by 'ecall' in system programming?
It is a way to request services from the operating system.
How does RISC-V handle immediate values larger than the 12-bit limit?
It uses load immediate (li) and instructions like 'auipc' to get around the limit.
What does 'jalr ra, offset(rs1)' accomplish specifically?
It jumps to address in rs1 plus an offset and saves the return address in 'ra'.
How does RISC-V treat data alignment in memory?
Data must be aligned according to its size (e.g., 4 bytes for words).
What does the 'snez' instruction do?
Sets the destination register to 1 if the source register is not zero.
What is the instruction for storing a word in memory?
sw instruction.
What represents a 4-byte value in assembly?
The '.word' directive.
What is a stack pointer used for?
It points to the top of the stack in memory.
Define the term 'global pointer' in RISC-V context.
It is a pointer (gp - x3) used for accessing global variables.
How are comparisons performed using branch instructions?
They evaluate conditions between registers and determine control flow.
Give an example of a logic operation in RISC-V.
and, or, xor.
What is the data section of executable used for?
To store initialized static variables.
What does the instruction ‘cmd’ refer to in RISC-V?
Ensure to replace it with the correct system call or command using ecall or similar.
Differentiate 'signed' and 'unsigned' operations in RISC-V assembly.
Signed operations consider negative values, while unsigned do not.
What addresses does the 'auipc' instruction deal with?
It computes PC-relative addresses.
How does 'sw' differ from 'sd' in terms of data type?
'sw' stores a word (4 bytes), 'sd' stores a double word (8 bytes).
Summarize how services are invoked in RISC-V assembly code.
Service numbers are placed in a specified register, then 'ecall' is executed.
What prefix denotes a global label in an assembly file?
.global.
Identify the role of the stack in RISC-V programs.
It stores local variables and function call information.
Describe the two types of conditional branches in RISC-V assemblies.
Equal (beq) and Not Equal (bne) branches.
Explain the significance of the zero register (x0).
It is always zero, cannot be modified, used for instruction purposes.
Why is register x1 important in RISC-V?
It is used for storing the return addresses.
Mention one reason why RISC-V is gaining popularity.
Its open standard and support for custom extensions.
Summarize what the instruction ‘addi’ does in simple terms.
Adds an immediate value to a register.
How are multi-purpose registers denoted in RISC-V?
They are often referred by m* naming (example: a0-a7).
What role do labels play in assembly code?
They provide named locations in the code for jumps and branches.
Explain how floating points are identified in instructions.
By suffixing instruction with '.s' for single and '.d' for double.
What instruction do you use to perform a logical AND in RISC-V?
The AND instruction.
Highlight a feature of RISC-V relating to its assembly language simplicity.
Limited instruction set with straightforward syntax.
What does 'lhu' signify in memory operations?
Load unsigned halfword.
How does 'bge' differ from 'blt'?
'bge' checks if greater than or equal, while 'blt' checks for less than.
What instruction format do RISC-V use for loading integers?
I-type instruction.
How is the result of a floating-point multiplication structured?
Using the fmul.s or fmul.d instruction.
Explain the purpose of immediate values in RISC-V assembly.
They provide constants directly usable in instructions.
How is conditional logic structured in assembly compared to high-level programming?
More explicit with branch instructions.
Mention a difference in how RISC-V handles function calls compared to other architectures.
It uses a caller/callee convention with specific register usage.
What does the abbreviation 'FP' signify in context of RISC-V savings?
Floating Point.
List a reason for why the RISC-V architecture allows extensibility.
It is open-source and designed for custom applications.
Mention the role of the Global Pointer (gp) in assembly programming.
It provides access to global data.