Data_Page1 - Data Page Register& Direct Addressing Dr K...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Data Page Register & Direct Addressing Dr. K. Gugel & Amanda Reilly See spru430e, section 2.2.4 (page 39) and section 5.4 (page 131) You can access the lower 4M of words with the data page. When you load a value into a data page you can access a range of 0 to 63 words from that address (6 bits). Example code: .data ;data is placed in memory at 0xA000 N1 .word 0x1234 N2 .word 0x0 N3 .word 0xAA55 .text ;program is placed in memory at 0x9000 MOV DP,#N1>>6 ;the address for label N1 is right-shifted 6 bits and stored in the data page ;DP = 0x0280 (0xA000 shifted down 6 bits) MOV AH,@N1 ;AH = 0x1234 MOV AL,@N2 ;AL = 0x0 . ;you can quick load up to 2^6 (64) values from a table using direct addressing . Why was 0xA000 shifted to the right by 6 bits? When you use direct addressing with the data page, the DSP determines the address as follows: A31:22 = 0, A21:6 = DP15:0, A(5:0) = 6 bits supplied by the direct addressing instruction. See below. A31:22 A21:6 A5:0 0 Data Page Register 15:0 6 bits from instruction Note that in the case of the instruction "MOV AL,@N2", the effective address is: 0xA001 where A31:22 = all zeros by default, A21:6 are 00 0000 1010 0000 00 from the DP reg and A5:0 = 00 0001 which is obtained from the actual instruction (direct addressing mode) ...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online