Professional Documents
Culture Documents
MDS4 Lec4
MDS4 Lec4
2424-bit Instruction OP CODE p TBLPAG Register TBLPAG<7:0> TBLPAG<7:0> 8-bits from TBLPAG Register Source & Dest Regs 1616-bit Source/Dest. Pointer w wwwwwwwwwwwwww w
Byte Select
Effective 24-bit PM Address 24 2005 Microchip Technology Incorporated. All Rights Reserved.
Slide
82
103ASPRev G
TBLRDH Instructions
Instruction
Tcy = 2
TBLRDH [W1], W3
TBLPAG = 0x01
Program Mem. Space Addr. 24 bits 0x0 0x00 0x0000 0x10 0x1000 0x2
EA = 01|1002 = 0x11002
0x00 0x0000 0xABCD 0x11000 0x11002
[0x11002]<23:16>
8bits
TBLRDH/TBLWTH
W3
0xFE
16-bits
TBLRDL/TBLWTL
W13 0x0000 0x101E W14 0x0000 W15 0x2400 0x00 0x00 0x0000 0x0000 0x12000 0x12002
TBLRDH.B/TBLWTH.B
TBLRDL.B/TBLWTL.B
TBLRDL.B/TBLWTL.B
0x00 0x00
0x0000 0x0000
0x1FFFC 0x1FFFE
103ASPRev G
Slide
84
103ASPRev G
Slide
85
TBLRDH Instructions
W Registers W0 0x0000 W1 0x1003 0x1002 W2 0x0003 W3 0x12FE 0x1234 TBLPAG = 0x01
TBLRDL Instructions
W Registers W0 0x0000 W1 0x1002 W2 0x0003 0xABCD W3 0x1234 TBLPAG = 0x01
Instruction
Tcy = 2
TBLRDH.B [W1++], W3
Program Mem. Space Addr. 24 bits 0x0000 0x00 0x0000 0x10 0x1000 0x0002
Instruction
Tcy = 2
TBLRDL [W1], W3
Program Mem. Space Addr. 24 bits 0x0 0x00 0x0000 0x10 0x1000 0x2
EA = 01|1002 = 0x11002
0x00 0x0000 0xABCD 0x11000 0x11002
EA = 01|1002 = 0x11002
0x00 0x0000 0xABCD 0x11000 0x11002
[0x11002]<23:16>
W13 0x0000 0x101E W14 0x0000 W15 0x2400
W3(low)
0xFE
[0x11002]<15:0>
W13 0x0000 0x101E W14 0x0000 W15 0x2400
W3
0xFE
0x00 0x00
0x0000 0x0000
0x12000 0x12002
0x00 0x00
0x0000 0x0000
0x12000 0x12002
Address = 0 to 0xFFFFFF
0x00 0x0000 0x1FFFC
0x00
0x0000
0x1FFFC
Instruction
Tcy = 2
TBLRDL.B [W1++], W3
TBLPAG = 0x01
Program Mem. Space Addr. 24 bits 0x0000 0x00 0x0000 0x10 0x1000 0x0002
? Program Space Visibility Enabled when CORCON<PSV> = 1 ? PSVPAG register maps 32Kb program memory segment into data memory
15
SFR Space
0x0000 0x0000
23
15
0x1234 0x1234
0 0x000000 0x001000
EA = 01|1002 = 0x11002
0x00 0x0000 0xABCD 0x11000 0x11002
Data Memory
PSVPAG=0 0x008000
0x5678 0x5678
[0x11002]<7:0>
W13 0x0000 0x101E W14 0x0000 W15 0x2400
W3(low)
0xFE
0x009000
0x8000
PSVPAG=1 0x010000
0xABCD
0x00 0x00
0x0000 0x0000
0x12000 0x12002
32KBytes Program Space Visibility (PSV) 0xFFFE 0x9000
0x011000
Address = 0 to 0xFFFFFF
0x00 0x00 0x0000 0x0000 0x1FFFC 0x1FFFE
PSVPAG=2 0x018000
Data Memory
2006 Microchip Technology Incorporated. All Rights Reserved. 103ASPRev G
Program Memory
103ASPRev G
Slide
88
Slide
89
0
PC<22:1> Reset Vector 0
User Space
32KB
15
Data Space EA<15:0>
1 0
CORCON<PSV> CORCON<PSV> = 1 PSVPAG = 0x20 ProgEA = 0x101000 DataEA = 0x9000
90
2006 Microchip Technology Incorporated. All Rights Reserved.
Effective 23-bit PM Address 23 2006 Microchip Technology Incorporated. All Rights Reserved. 103ASPRev G
Slide
103ASPRev G
Instruction
Tcy = 2
MOV [W1], W3
PSVPAG = 0x02
Program Mem. Space Addr. 24 bits 0x0 0x00 0x0000 0x10 0x1000 0x2
EA = 01|1002 = 0x11002
0x00 0x0000 0xABCD 0x11000 0x11002
0x00 or 0xFF
[0x11002]<15:0>
W13 0x0000 0x101E W14 0x0000 W15 0x2400
W3
0xFE
0x00 0x00
0x0000 0x0000
0x12000 0x12002
0x00
0x0000
0x1FFFC
Instruction
Constants
Tcy = 2 Program Mem. Space Addr. 24 bits 0x0 0x00 0x0000 0x10 0x1000 0x2
MOV.B [W1++], W3
PSVPAG = 0x02
EA = 01|1002 = 0x11002
0x00 0x0000 0xABCD 0x11000 0x11002
[0x11002]<15:8>
W13 0x0000 0x101E W14 0x0000 W15 0x2400
W3
0xFE
0x00 0x00
0x0000 0x0000
0x12000 0x12002
Address = 0 to 0x7FFFFF
0x00 0x0000 0x0000 0x1FFFC 0x1FFFE
0x00
Slide
94
103ASPRev G
Slide
95
Usefulness of PSV
?
PSV allows very large tables of data to be stored and accessed quickly & efficiently PSV provides a bridge to a common data/program address space (Von Neumann) but only when needed Example:
? ? Large constant data for display Sine Table
103ASPRev G
Slide
96