What is assembly language, and why is it architecture-specific?
Assembly language is a human-readable notation for a processor’s instruction set. It is architecture-specific, so instruction names and syntax vary between processors.
Study 5 Assembly Concepts with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.
What is assembly language, and why is it architecture-specific?
Assembly language is a human-readable notation for a processor’s instruction set. It is architecture-specific, so instruction names and syntax vary between processors.
What does an assembler do?
An assembler translates assembly instructions into machine-code instructions.
What is a register?
A register is a small, fast storage location inside the CPU.
What common roles do RISC-V ABI register names describe?
In RISC-V, `zero` always reads as 0, `ra` holds a return address, `sp` points to the stack, `t0`–`t6` are temporary registers, and `a0`–`a7` are commonly used for arguments.
What are a mnemonic and operands in an assembly instruction?
A mnemonic names the operation, and its operands specify the values or locations it uses.
How do `add` and `addi` differ?
`add` combines register values, while `addi` adds a constant to a register value.
What is a pseudoinstruction?
A pseudoinstruction is assembler-provided shorthand translated into real instructions; examples include `li`, `mv`, and `ret`.
What purpose does a label serve in assembly?
A label names a location in a program, giving a branch or jump a readable destination.
When does `beq t0, t1, equal` branch to `equal`?
`beq t0, t1, equal` transfers control to `equal` if the two registers are equal; otherwise, execution continues with the next instruction.
How can branches express an `if` statement or a loop?
A conditional branch can express an `if` statement. A label paired with a backward branch can form a loop.
How does a taken branch affect the normal instruction sequence?
The program counter normally advances through instructions. When a branch is taken, execution moves to the branch’s destination instead.
What is a procedure in assembly?
A procedure is a named block of instructions that performs a task. A caller transfers control to it, and it returns control to the instruction after the call.