P. 1
HT66FU30

HT66FU30

|Views: 117|Likes:
Published by Duc Vu

More info:

Published by: Duc Vu on Mar 22, 2012
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

03/22/2012

pdf

text

original

TwoMemoryPointers,knownasMP0andMP1arepro-

vided. These Memory Pointers are physically imple-

mented in the Data Memory and can be manipulated in

the same way as normal registers providing a conve-

nient way with which to address and track data. When

any operation to the relevant Indirect Addressing Regis-

ters is carried out, the actual address that the

microcontrollerisdirectedto,istheaddressspecifiedby

the related Memory Pointer. MP0, together with Indirect

Addressing Register, IAR0, are used to access data

from Bank 0, while MP1 and IAR1 are used to access

data from all banks according to BP register. Direct Ad-

dressing can only be used with Bank 0, all other Banks

mustbeaddressedindirectlyusingMP1andIAR1.Note

that for the HT66F20 and HT66F30 devices, bit 7 of the

Memory Pointers is not required to address the full

memory space. When bit 7 of the Memory Pointers for

HT66F20 and HT66F30 devices is read, a value of ²1²

will be returned.

The following example shows how to clear a section of

four Data Memory locations already defined as loca-

tions adres1 to adres4.

· Indirect Addressing Program Example

data .section ¢data¢
adres1 db ?
adres2 db ?
adres3 db ?
adres4 db ?
block db ?
code .section at 0
¢code¢
org 00h

start:

mov a,04h

; setup size of block

mov block,a
mov a,offset adres1 ; Accumulator loaded with first RAM address
mov mp0,a

; setup memory pointer with first RAM address

loop:

clr IAR0

; clear the data at address defined by MP0

inc mp0

; increment memory pointer

sdz block

; check if last memory location has been cleared

jmp loop

continue:

Theimportantpointtonotehereisthatintheexampleshownabove,noreferenceismadetospecificRAMaddresses.

HT66F20/HT66F30/HT66F40/HT66F50/HT66F60
HT66FU30/HT66FU40/HT66FU50/HT66FU60

Rev. 1.30

27

October 4, 2010

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->