EasyManua.ls Logo

Holtek HT66F002 - Special Function Register Description; Indirect Addressing Registers - IAR0, IAR1; Memory Pointers - MP0, MP1

Default Icon
144 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Rev. 1.71 28 April 11, 2017 Rev. 1.71 29 April 11, 2017
HT66F002/HT66F0025/HT66F003/HT66F004
Cost-Effective A/D Flash MCU with EEPROM
HT66F002/HT66F0025/HT66F003/HT66F004
Cost-Effective A/D Flash MCU with EEPROM
Special Function Register Description
MostoftheSpecialFunctionRegisterdetailswillbedescribedintherelevantfunctionalsection,
howeverseveralregistersrequireaseparatedescriptioninthissection.
Indirect Addressing Registers – IAR0, IAR1
TheIndirectAddressingRegisters,IAR0andIAR1,althoughhavingtheirlocationsinnormalRAM
registerspace,donotactuallyphysicallyexistasnormalregisters.Themethodofindirectaddressing
forRAMdatamanipulationusestheseIndirectAddressingRegistersandMemoryPointers,in
contrasttodirectmemoryaddressing,wheretheactualmemoryaddressisspecied.Actionsonthe
IAR0andIAR1registerswillresultinnoactualreadorwriteoperationtotheseregistersbutrather
tothememorylocationspeciedbytheircorrespondingMemoryPointers,MP0orMP1.Actingasa
pair,IAR0andMP0cantogetheraccessdatafromBank0whiletheIAR1andMP1registerpaircan
accessdatafromanybank.AstheIndirectAddressingRegistersarenotphysicallyimplemented,
readingtheIndirectAddressingRegistersindirectlywillreturnaresultof“00H”andwritingtothe
registersindirectlywillresultinnooperation.
Memory Pointers – MP0, MP1
TwoMemoryPointers,knownasMP0andMP1areprovided.TheseMemoryPointersare
physicallyimplementedintheDataMemoryandcanbemanipulatedinthesamewayasnormal
registersprovidingaconvenientwaywithwhichtoaddressandtrackdata.Whenanyoperationto
therelevantIndirectAddressingRegistersiscarriedout,theactualaddressthatthemicrocontroller
isdirectedtoistheaddressspeciedby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AddressingcanonlybeusedwithBank0,
allotherBanksmustbeaddressedindirectlyusingMP1andIAR1.
ThefollowingexampleshowshowtoclearasectionoffourDataMemorylocationsalreadydened
aslocations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´
org00h
start:
mov a,04h ; setup size of block
mov block,a
mov a,offset adres1 ; Accumulator loaded with rst RAM address
mov mp0,a ; setup memory pointer with rst RAM address
loop:
clr IAR0 ; clear the data at address dened by mp0
inc mp0 ; increment memory pointer
sdz block ; check if last memory location has been cleared
jmp loop
continue:
Theimportantpointtonotehereisthatintheexampleshownabove,noreferenceismadetospecic
DataMemoryaddresses.

Table of Contents

Related product manuals