sem 3 Flashcards
CPU structure
CPU contains CU, ALU and Registers. CU is manager, manages all the data flow, ALU is the worker, problem solver and does the math, Registers is the storage, stores the instruction and data.
CU sends an address to the memory through the address bus, RAM receives info and sends data through the data bus to the CPU
ALU Structure
- Arithmetic and Boolean Logic: mathematician, does the logic
- status flags
- shifter: binary bit shift, for example shift 0001 to left by 1 bit, it is 0010.
- complementor: NOT opertation
9 Types of Registers in the CPU
- General Purpose registers: can be used for anything, multi-purpose
- data registers: to store the data
- address registers: Used to hold Address or employed in the calculation of an operand
address
Used as a Stack Pointer - condition code register: Contains flags or bits set by the processor hardware as the result of operation
- program counter (PC): – Contains the address of an instruction to be fetched
– Automatically points to the next instruction after the current
instruction is fetched - Instruction Register: Contains the instruction most recently fetched
- Memory Address Register (MAR):
– Contains the address of a location in memory - Memory Buffer Register (MBR):
– Contains a word of data to be written to memory or the word most
recently read - Program Status Word (PSW)
– Contains a set of bits that includes condition codes
– E.g. Sign of last result, Zero, Carry-over, Equal, Overflow, Interrupt,
Supervisor (indicates whether processor is executing in supervisor or
user mode)
How does MAR and MBR work?
- CPU issues a command (read or write), through the fetch cycle.
CPU executes instructions and needs to access data stored in the memory (execution cycle)
EASy68K
EASy68K allows us to edit, assemble and run 68000 programs in the Windows PC
E114
has data registers and address registers.
8 data registers, 8 address registers but the first seven is used for address, last is used for stack pointer.
Data registers, D0 -D7 can have a maximum of 32 bits. Data registers can have 8 bit, 16 bit or 32 bit numbers.
Move.B (moves 8 bit = 1byte)
Move.W (moves 16 bit = 1 word)
Move.L (moves 32 bit = 1 long word)
Address registers
A0 to A6-32 bit
A7, stack pointer- 32bit
Program counter - 32 bit
Status register -16 bit
there are 5 status flags, but we are covering 2, Z, zero flag and N, Negative flag
BRA <label> (Branch always)</label>
branch means jumping. specifies which direction u want to jump to.
BSR <label> (Branch subroutine)</label>
another term used as a function.
BNE <label> (Branch not equal)</label>
jump when it is not equal
BMI <label> (Branch on negative)</label>
negative
BPL <label> (Branch on positive)</label>
positive
JMP <label> (Jump always)</label>
RTS <label> (return from subroutine)</label>
only available if u use the BSR