tags:
- notes
- lecture
- bsu
- spring-2025
- ece-330
- microprocessors
- school
source: https://boisestatecanvas.instructure.com/courses/36351/files/folder/Lectures?preview=17499370
created: 2025-02-19
...
...
...
Where do computers store integers?
Computers store integers in memory.
What are the names for the different numbers of bytes?
The names for the different numbers of bytes are:
What are integers stored as in memory?
Integers are stored in memory as binary values.
What are the two types of integers?
The two types of integers are:
What did early computers use to represent negative numbers?
To represent negative numbers, early computers used One's Complement.
What do computers use to represent negative numbers now?
Now, to represent negative numbers computers use Two's Complement.
What are the two steps to finding the Two's Complement of a number?
The two steps to findings the Two's Complement of a number are:
...
Is the carry out that's generated by finding a Two's Complement ignored?
Yes, the carry out that's generated by finding a Two's Complement is ignored.
...
What is the benefit of using Two's Complement?
The benefit of using Two's Complement is that it simplifies arithmetic logic in CPUs.
What is the range of values for unsigned bytes?
The range of values for unsigned bytes is 0x00
(0) to 0xFF
(255).
What is the range of values for signed bytes?
The range of values for signed bytes is 0x80
(-128) to 0x7F
(127).
...
...
What is an
An n-bit register is a group of
Are there multiple registers in a microprocessor?
Yes, there are multiple registers in a microprocessor.
What are the three types of registers?
The three types of registers are:
What does the Program Counter (PC) store?
The PC stores the address of the instruction which will be executed next.
What is the stack?
The stack is a reserved block of main memory used to save/restore data.
What uses the stack implicitly?
The stack is used implicitly by procedure call instructions, including interrupt service calls.What does the stack typically store?
The stack typically stores the contents of CPU registers that needed to be restored after returning from a call instruction.
What does the Stack Pointer (SP) store?
The SP stores the last location in memory where data was placed onto the stack.
When does a stack overflow occur?
A stack overflow occurs when the stack pointer runs off of the end of the allocated stack memory.
What does the Instruction Register (IR) store?
The IR stores the current instruction being processed by the microprocessor.
Is the Instruction Register (IR) visible to the programmer?
No, the IR is invisible to the programmer.
What are the registers in an ARM Cortex-M series microprocessor?
The registers in an ARM Cortex-M series microprocessor include:
...
...
What is a microcontroller?
A microcontroller is a computer SoC.
What does a microcontroller contain?
A microcontroller contains:
- A CPU.
- RAM.
- Flash memory.
- Configurable I/O devices.
- A clock generator.
- Timers.
What do microcontrollers do?
Microcontrollers run dedicated applications specific for the device which they're contained in.Can microcontrollers include an operating system?
Yes, microcontrollers can include an operating system.
...
...
What are the four sections of memory and what they store?
The four sections of memory and what they store include:
.text
- Read-only program code..rodata
- Read-only constants and strings..data
- Initialized global and static variables..bss
- Uninitialized global and static variables.What does
.bss
stand for?
.bss
stands for Block Started by Symbol.
What does the linker do?
The linker combines multiple object files.
How does the linker combine multiple object files?
The linker combine multiple object files by resolving their external symbol references and relocating their data sections.What two things does the linker take as input?
The two things which the linker takes as input are:
.o
object files..ld
linker scripts.What does the linker output?
The linker outputs.out
executable files.
...
...
...
...
...
What does the MOV
instruction do?
The MOV
instruction moves the value of a register or an immediate value into another register.
...
...
What is the diagram for the assignment of the APSR, IPSR , and EPSR bits?
The diagram for the assignment of the APSR, IPSR, and EPSR bits is:
What does APSR stand for?
APSR stands for Application Program Status Register.
What does IPSR stand for?
IPSR stands for Interrupt Program Status Register.
What does EPSR stand for?
EPSR stands for Exception Program Status Register.
What do the status registers contain?
The status registers contain flags that are set by hardware to indicate specific conditions that occur during program execution, such as from the ALU.
What bits are used for
SEL
(select byte) instruction comparison?
The bits used forSEL
instruction comparison are Greater than or Equal to (GE[3:0]) bits.
What are the most important flags?
The most important flags are:
N
- Negative at bit-31.Z
- Zero at bit-30.C
- Carry at bit-29.O
- Overflow at bit-28.What is the
Q
bit used for?
TheQ
bit is used for overflow and saturation status.
What are the different condition flags set to?
The different condition flags are set to:
N
- The sign bit of the ALU result.Z
- If the result of the instruction is zero.C
- If an unsigned operation exceeded the 32-bit range with a carry for ADD
or a borrow for SUB
.V
- The same as the C
condition flag but for signed operations.Q
- For Digital Signal Processor operations....
ADD r3, r2, r1
- Adds the values of r2
and r1
and puts the result in r3
without affecting the status register flag.ADC r3, r2, r1
- Adds the values of r2
, r1
, and the value of the carry flag and puts the result in r3
without affecting the status register flag.ADD r3, r0, #7
.ADDS r3, r2, r1
- The same as ADD
except it affects the status register flags.ADCS r3, r2, r1
- The same as ADC
except it affects the status register flags.SUB r0, r0, r4
- Subtracts r4
from r0
and puts the result in r0
without affecting the status register flags.RSB r0, r0, r4
- Subtracts r0
from r4
and puts the result in r0
without affecting the status register flags.SBC r0, r0, r4
- Subtracts r4
from r0
with a carry and puts the result in r0
without affecting the status register flags.SUBS r0, r0, r4
- The same as SUB
except it affects the status register flags.RSBS r0, r0, r4
- The same as RSB
except it affects the status register flags.SBCS r0, r0, r4
- The same as SBC
except it affects the status register flags.MUL r0, r1, r4
.MULS r0, r1, r4
.MLA r0, r1, r2, r3
.MLS r0, r1, r2, r3
.UMULL r0, r1, r2, r3
.SMULL r0, r1, r2, r3
.UMLAL r0, r1, r2, r3
.AND r0, r1, r4
- Performs logical AND between r1
and r4
and puts the result in r0
.ORR r0, r1, r4
- Performs logical OR between r1
and r4
and puts the result in r0
.EOR r0, r1, r4
- Performs logical XOR between r1
and r4
and puts the result in r0
.BIC r0, r1, r4
- Performs bitwise clear between r1
and r4
and stores the result in r0
.ANDS r0, r1, r4
.ORRS r0, r1, r4
.EORS r0, r1, r4
.What instructions are used for shifting or rotating a binary value?
The instructions used for shifting or rotating a binary value are:
LSL
- Logical shift left.LSR
- Logical shift right.ASL
- Arithmetic shift left.ASR
- Arithmetic shift right.ROL
- Rotate left.ROR
- Rotate right.RLX
- Rotate left extended.RRX
- Rotate right extended....
BFC r4, #8, #12
- Clears bits from bit-8 to bit-19 (12 bits) of r5
to 0.BFI r9, r2, #8, #12
- Replaces bits from bit-8 to bit-19 (12 bits) of r9
with bit-0 to bit-11 from r2
.RBIT r0, r1
- Reverses the bit order of a 32-bit value in r1
and puts the result in r0
.REV r0, r1
- Reverses the byte order of a 32-bit word in r1
and puts the result in r0
. It's used for converting between little endian and big endian.REV16 r0, r1
- Reverses the byte order of each 16-bit half word in a 32-bit word in r1
and puts the result in r0
.ADR r0, b
- Determines the memory address of label b
and puts it in r0
. It's used for finding the memory address that the assembler assigned to a label....
...
What are the four data comparison instructions?
The four data comparison instructions are:
CMP Rn, Op2
- Sets the NZCV
flags based on the operation Rn - Op2
.CMN Rn, Op2
- Sets the NZCV
flags based on the operation Rn + Op2
.TST Rn, Op2
- Sets the NZCV
flags based on the operation Rn AND Op2
.TEQ Rn, Op2
- Sets the NZCV
flags based on the operation Rn EOR Op2
....
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...