Microprocessor execution Flashcards

1
Q

Where are instructions stored?

A

ROM - read only memory

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

How is this piece of code written as microprocessor instructions?
int a = 5;
int b = 3;
int c;
c = a + b;

A

MOV A, #5. (Move 5 to ‘A’ register)
ADD A, #3. (Add 3 to ‘A’ contents)
MOV 0x0.09, A.

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

Define a subroutine

A

A written program that is used any number of times by the main program
-it can be called from anywhere in the program

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

What are the two words in the assembler are used to call on a subroutine?

A

ACALL
LCALL

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

What is the difference between ACALL and LCALL?

A

-ACALL only takes 2 bytes of program memory and LCALL takes 3
-LCALL can be used to call subroutines located anywhere within the 64K-byte address space of the 8051

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

Define stack

A

-a special area in the memory used by the CPU to store information

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

Define stack pointer

A

a small register that “points” at an address in the stack
-it points at the top of the stack, where the next item will be stored

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

Define the PUSH instruction of the stack

A

-pushes a register or memory location onto the stack

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

Define the POP instruction of a stack

A

remove the upmost item from the stack

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

Define MOVC

A

Loads the accumulator with a value from memory

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

Define MOV

A

Moves bytes betwen registers and ports

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

Define INC

A

Increment the value in the accumulator or register

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

Define SJMP/LJMP

A

Short/long jump within code

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

Define XCH

A

Exchange contents of register with accumulator

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

Define DJNZ

A

Decrement register and jump if register is non-zero

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

define RET

A

Return from subroutine

17
Q

What is the purpose of a stack

A

-way to temporarily store register values
-stores current program states before a subroutine is executed

18
Q

Define special register function SFR

A

areas of the memory that control specific functionality of the microcontroller

19
Q

Give an example of an SFR and what it does

A

Stack pointer
-indicates where the next value from the stack will be read from RAM