參數(shù)資料
型號(hào): AN1218
廠商: 飛思卡爾半導(dǎo)體(中國(guó))有限公司
英文描述: HC05 to HC08 Optimization
中文描述: 以HC08的優(yōu)化HC05
文件頁(yè)數(shù): 12/56頁(yè)
文件大小: 417K
代理商: AN1218
Application Note
AN1218 Rev. 2
12
Code Example
We will now illustrate the added benefit of the CPU08 16-bit index
register. The index will be used to address a 512 byte table. In the
CPU05, the table must be broken up into sections of memory consisting
of 256 bytes per section. Our table has 512 bytes, so we will be using
two sections, section 0 and section 1, for the CPU05. The address to
look up on the table will be found in RAM. Notice that the CPU05 code
is longer. If your table was larger, you would require more sections of
memory to handle your table. A subroutine might be written to make the
job more modular. In the HC08 example, the 512 byte table can be
handled directly. A comparison between CPU05 and CPU08 code is
shown in
Appendix B — CPU05 and CPU08 512-Byte Table Indexing
Code
.
Stack Pointer
CPU08 has a full 16-bit stack pointer. To maintain compatibility with the
CPU05, it is initialized to $00FF out of reset.
Stack manipulation is from high to low memory. The SP is decremented
each time data is pushed on the stack and incremented each time data
is pulled from the stack. The SP points to the next available stack
address rather than the latest stack entry address.
Nine new instructions have been added for the user to manipulate the
stack. These instructions allow the direct push and pull of any register
to the stack. The SP can be changed with a transfer of the H:X register
to the SP or the SP can be augmented by the add immediate instruction.
Stack manipulation can be a very powerful programming technique.
With the CPU08, the assembly programmer can pass parameters and
store local or temporary variables when using subroutines and/or
interrupts.
New addressing modes were added to address these variables on the
stack. Using the stack pointer as an index register with 8- or 16-bit
offsets, the user may access variables on the stack. These instructions
greatly cut cycle count by not having to load/store the variable. RAM
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
.
相關(guān)PDF資料
PDF描述
AN1746 Migrating from the MC68HC705K1 to the MC68HC705KJ1
AN2635 On-Chip FLASH Programming Routines
AN4009 ALARM IC SAMPLE APPLICATIONS
ARP2805D/SF 1-OUTPUT 150 W DC-DC REG PWR SUPPLY MODULE
AS1977-T nPower Single Comp. Open-Drain; Package Type: SOT23-5
相關(guān)代理商/技術(shù)參數(shù)
參數(shù)描述
AN122677 制造商:AN# - MILITARY 功能描述:
AN122683 制造商:AN# - MILITARY 功能描述:
AN122694 制造商:AN# - MILITARY 功能描述:
AN122717 制造商:AN# - MILITARY 功能描述:
AN122718 制造商:AN# - MILITARY 功能描述: