Assembly Language Flashcards

1
Q

What is assembly language?

A

A low-level programming language that uses simple symbols to make writing computer instructions easier

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the two main CPU architectures discussed?

A

Von Neumann Architecture and Harvard Architecture.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the key features of the Von Neumann Architecture?

A

It uses the same memory for both data and instructions, with one system (bus) to handle both.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How does the Harvard Architecture differ from the Von Neumann Architecture?

A

It has separate memory for instructions and data, so both can be fetched at once for faster speed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is MIPS and why is it significant?

A

MIPS is a simple and efficient RISC architecture that uses pipelining to make processing faster.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is pipelining in MIPS?

A

A way to do many instructions at once to make processing faster and better

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the eight stages of the MIPS R4000 pipeline?

A

IF, IS, RF, EX, DF, DS, TC, WB.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the key design principles of MIPS architecture?

A

Keep it simple, make common tasks quick, smaller is faster, and good design means smart trade-offs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the three main types of MIPS instructions?

A

R (Register) Type, I (Immediate) Type, J (Jump) Type.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does an R-type instruction in MIPS include?

A

Opcode, source registers, destination register, shift amount, and function code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What components make up an I-type instruction?

A

Opcode, source register, destination register, and an immediate value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What does a J-type instruction specify?

A

Opcode and the target address for jumping.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How many registers does the MIPS architecture have?

A

32 registers that store data, and each one is 32 bits wide

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the purpose of the $0 and $ra registers in MIPS?

A

$0 always has 0, and $ra holds the return address after a function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What MIPS instructions are used for memory access?

A

lw (load word) and sw (store word).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are common arithmetic instructions in MIPS?

A

add, sub, mul, div.

17
Q

What is the purpose of branching instructions like beq and bne?

A

They are used to jump to different parts of the program depending on conditions

18
Q

What are jump instructions used for in MIPS?

A

They jump directly to a specified address (using j or jal) without conditions.

19
Q

What are the differences between lw and sw instructions?

A

lw loads data from memory to a register, while sw stores data from a register to memory.

20
Q

What is an example of an immediate instruction?

A

addi $t0, $t1, 10 - Adds 10 to the value in $t1 and stores the result in $t0.

21
Q

What is the purpose of $t0-$t9 and $s0-$s7 registers?

A

$t0–$t9 are temporary and can change. $s0–$s7 are saved and keep their values between functions

22
Q

What are assembler directives, and give an example?

A

Instructions for the assembler that don’t run during the program. For example, .data is used to set up the data part of the program.

23
Q

How are labels used in MIPS assembly?

A

Labels mark spots in the code for jumps and branches (e.g., Loop:).

24
Q

How do you write a MIPS program to add two numbers?

A

Load operands using lw
Perform addition using add
Store the result using sw

25
Q

How is a loop implemented in MIPS assembly?

A

Loops are made using branch instructions like bne and jump instructions like j

26
Q

What is the main advantage of Harvard architecture over Von Neumann?

A

Getting instructions and data at the same time to run things faster.

27
Q

How does pipelining improve CPU performance?

A

By running multiple instructions at the same time to increase speed.

28
Q

What is instruction pipelining?

A

Different parts of several instructions run at the same time

29
Q

What is ISA, and why is it important?

A

ISA is the set of instructions a CPU understands, linking software and hardware.

30
Q

How is high-level code converted to MIPS assembly?

A

Code is turned into assembly instructions through compilation