Академический Документы
Профессиональный Документы
Культура Документы
Chapter 6
Introduction
The CPU has several addressing modes; way of accessing the data in registers or memory. 4 distinct addressing modes:
Immediate Direct Register Indirect Indexed-ROM
Direct Addressing
MOVWF MOVFF 0X56 0X40
Study!
Workout Example 6-2, 6-3, 6-4, 6-5, 6-6, 6-7
Table Processing
TBLPTR is a 21-bit register used as table pointer. TBLPTR is divided into:
TBLPTRL (low) TBLPTRH (high) TBLPTRU (upper)
TABLAT (TABle LATch) register is used for keeping the byte fetched or to be written.
There are two operations that allow the processor to move bytes between the program memory space and the data RAM:
Table Read (TBLRD) Table Write (TBLWT)
Example 6-9
ORG CLRF MOVLW MOVWF MOVLW MOVWF TBLRD* MOVFF INCF TBLRD* MOVFF INCF TBLRD* MOVFF GOTO ORG DB END 0000H TRISB 0x0 TBLPTRL 0x05 TBLPTRH
TABLAT,PORTB TBLPTRL,F
TABLAT,PORTB TBLPTRL,F TABLAT,PORTB HERE 500H "USA"
HERE
MYDATA
Study!!!
Example 6-10, 6-11, 6-12 Example 6-17 to 6-24
When a is 0 however, the instruction is forced to use the Access Bank address map.
Study!
Example 6-25 to 6-28
Checksum
Checksum: to detect any corruption of the contents of ROM Workout Example 6-29