Lecture 2 Flashcards
Programming models
What is the instruction cycle?
The procedure of processing an instruction by the microprocessor
What does a programming model define?
- What instructions are avaılable
- How instructions access their operands
- How instructions are described in the processors assembly language
N.B. Processors with different programming models can offer similar sets of operations but may require VERY different approaches to programming
What is a data transfer instruction?
Operations that move data from one place to another. They DON’T modify data, just copies it to destination
What is a data operation instruction?
Instructions that modify the data values and store the result
What is a program control instruction?
Jump or branch instructions used to go into another part of the program. Jumps can be absolute or conditional (If else)
What are the different data transfer instructions?
Load data
Store data
Move data
Input data
Output data
What does Input data do?
Instructions that input data from the input device into the microprocessor (e.g. what key was pressed)
What does output data do?
Microprocessor copies data from one of its internal registers to and output device (e.g. show what key has been pressed)
What does load data do?
Copy data from memory intro microprocessors registers
What does store data do?
Similar to load data but data is copied in to opposite direction. Data is saved from internal microprocessor registers into the memory
What does move data do?
Move data from one microprocessor register to another
Explain how instructions use the stack
Instructions get their operands from the stack and write their results back to the stack
What are some advantages of stack based architecture?
Program code takes little memory
- No need to specify the address of the operands in memory or registers
- Push is one exception because it needs to specify the operand
What are stack based processors better suited for? Postfix or infix?
Postfix, writing programs for stack-based architectures is not easy
What is infix notation
a+b