RAM: | Random Access Memory (can read and write) |
ROM: | Read Only Memory (programmed at factory) |
PROM: | Programmable Read Only Memory |
(Program once at site) | |
EPROM: | Erasable Programmable Read Only Memory |
(Program at site, can erase using UV light and reprogram) | |
EEPROM: | Electrically Erasable Programmable Read Only Memory |
(Program and erase using voltage rather than UV light) |
68HC12 has: | 1 K RAM |
768 bytes EEPROM | |
Can erase and reprogram any byte using normal 5V power supply | |
32 KB Flash EEPROM | |
Can erase using external 12V power supply |
When the control unit sees the sixteen-bit number 0x1806, it tells the ALU to add B to A, and store the result into A.
LDAA address | Put the number contained in memory at address into A |
STAA address | Put the number contained in A into memory at address |
CLRA | Clear A (0 -> A) |
INCA | Add 1 to A ((A) + 1 -> A) |
ABA | Add B to A, store the result in A |
ASRA | Shift A right by one bit (keep the MSB the same) |
This divides a signed number by 2 | |
LSRA | Shift A right by one bit (put 0 into MSB) |
This divides an unsigned number by 2 | |
NEGA | Negate A (-(A) -> A) |
TAB | Transfer A to B ((A) -> B) |
SWI | Software Interrupt (Used to end all our HC12 programs) |
ldaa $0913 ; Put contents of memory at 0x0913 into A inca ; Add one to A staa $0914 ; Store the result into memory at 0x0914 swi ; End program
Address | Value |
0x0800 | B6 |
0x0801 | 09 |
0x0802 | 13 |
0x0803 | 42 |
0x0804 | 7A |
0x0805 | 09 |
0x0806 | 14 |
0x0807 | 3F |
prog equ $0800 ; Start program at 0x0800 data equ $0913 ; Data value at 0x0913 result equ $0914 ; Result at 0x0914 org prog CODE: section .text ldaa data inca staa result swi
# Link file for test program +seg .text -b 0x0800 -n .text # program start address +seg .data -b 0x0800 -n .data # data start address test.o # application program
ca6812 -a -l -xx -pl test.s clnk -o test.h12 -m test.map test.lkf chex -o test.s19 test.h12