start:
mov a,04h ; setup size of block
mov block,a
mov a,offset adres1 ; Accumulator loaded with first RAM address
mov mp,a ; setup memory pointer with first RAM address
loop:
clr IAR ; clear the data at address defined by MP
inc mp ; 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 spe
-
cific RAM addresses.
Bank Pointer - BP
As both the Data Memory and Program Memory are divided into several banks for the
HT48RU80/HT48CU80 devices, the Bank Pointer only exists in these devices. As the Data Mem
-
ory for these devices is subdivided into three banks, selecting the correct Data Memory area is
achieved by using the Bank Pointer. If data in either Bank 1 or Bank 2 is to be accessed, the lowest
two bits of the BP must be set to the binary values 01 or 10 respectively, however, it must be noted
that data in these two banks can only be addressed indirectly using the MP1 memory pointer and
the IAR1 indirect addressing register. Any direct addressing or any indirect addressing using MP0
and IAR0 will always result in data from Bank 0 being accessed. The Data Memory is initialized to
Bank 0 after a reset, except for the WDT time-out reset in the Power Down Mode, in which case,
the Data Memory Bank remains unchanged. It should be noted that the Special Function Data
Memory is not affected by the bank selection, which means that the Special Function Registers
can be accessed from within either Bank 0, Bank 1 or Bank 2. For these devices, whose 16K of
Program Memory is divided into two 8K banks, known as Bank 0 and Bank 1, bit 5 of the Bank
Pointer is used to control which Program Memory Bank is selected. Although only some of the
Bank Pointer register bits are actually used for Data Memory and Program Memory Bank indicat-
ing purposes, note that all 8 bits of the BP register are actually implemented. Any unused bits must
be reset to ²0².
32
I/O Type MCU
B P 5 X X X B P 1 B P 0
B a n k P o i n t e r
b 7 b 0
XX
B P 1
0
0
1
1
B P 0
0
1
0
1
D a t a M e m o r y
B a n k 0
B a n k 1
B a n k 2
u n d e f i n e d
N o t u s e d , m u s t b e r e s e t t o " 0 "
P r o g r a m M e m o r y
0 : B a n k 0
1 : B a n k 1
N o t u s e d , m u s t b e r e s e t t o " 0 "