Download ST9 user guide - STMicroelectronics
Transcript
ST9 USER GUIDE inc R19 ; increment the same register again The following table summarizes the use of the srp instruction and its effect in terms of group selection. Table 1. Register Page Number Summary Hexadecimal register number F0-FF E0-EF D0-DF C0-CF B0-BF A0-AF 90-9F 80-8F 70-7F 60-6F 50-5F 40-4F 30-3F 20-2F 10-1F 00-0F Notes: Decimal register number 240-255 224-239 208-223 192-207 176-191 160-175 144-159 128-143 112-127 96-111 80-95 64-79 48-63 32-47 16-31 00-15 Function Paged registers System registers General purpose registers Register group decimal (hexadecimal) 15 (F) 14 (E) 13 (D) 12 (C) 11 (B) 10 (A) 9 8 7 6 5 4 3 2 1 0 srp #n instruction to select a group to provide r0-r15 srp #30 srp #28 srp #26 srp #24 srp #22 srp #20 srp #18 srp #16 srp #14 srp #12 srp #10 srp #8 srp #6 srp #4 srp #2 srp #0 Though it is possible, it normally makes no sense to set the working register group either to group E (14) or F (15), since the registers in these groups have pre-defined meanings. You cannot use them to store intermediate values of calculations without greatly affecting the behavior of the microcontroller in an unpredictable way. However, bit-level instructions are only available using working register addressing, so when you need to do bit manipulations in these groups, setting the register pointer to either 28 or 30 is an efficient way of programming when accessing these two groups. The srp instruction is the only one you have to use to switch register groups, and is the way working registers are used in most programs. However, the working register scheme includes a subtlety that is seldom used, but that could give you even more flexibility in some cases. This is what is described in the next paragraph. The same register group number can be selected by an odd or even number. In fact, the formula is: srp 2*n+1 ; for group n srp 2*n ; for group n or 19/146