Chapter 2 Flashcards
4 advantages of C programming
Easier and quicker to write in C
Easier to modify and update
Allows use of function libraries
Portable to other microcontrollers
What is a register?
A register is a storage location n-bits wide that can be written to or read from all bits simultaneously
Accumulator
Register to accumulate results - most versatile
R registers
general purpose registers
B registers
similar to accumulators but only for multiplication and division
Data pointer
Points to data, the only 16 bit register
Program counter
Points to next instruction in memory, 2-byte register
Stack pointer
indicates the next value to be removed from the stack
Unsigned char
8-bits, range of 0-255
Signed char
8-bits, MSB denotes sign, range of -128 to +127
Unsigned int
16-bits, range of 0-65535
Signed int
16-bits, MSB denotes sign, range of -32768 to +32767
Bit
1-bit, used for RAM
Sbit
1-bit, used for Special function registers (SFR)
Machine cycle
Fetch
Get an instruction from memory