參數資料
型號: AN1218
廠商: 飛思卡爾半導體(中國)有限公司
英文描述: HC05 to HC08 Optimization
中文描述: 以HC08的優(yōu)化HC05
文件頁數: 18/56頁
文件大?。?/td> 417K
代理商: AN1218
Application Note
AN1218 Rev. 2
18
* Subroutine XX for CPU05 *
START
STX
STA
$50
$51
;4 store X away to RAM
;4 store A away to RAM
XX
XX
XX
XX
;actual subroutine code
LDX
LDA
$50
$51
;3 load X from RAM
;3 load A from RAM
Figure 4. CPU05 Subroutine Code
TheCPU05codewilluse14cyclestostoreandloadregisters. Also,two
bytes of global RAM space are allocated for this subroutine. If we were
to use the CPU08, the code could utilize the stack. Global RAM space
and six cycles would be saved. Refer to
Figure 5
.
* Subroutine XX for CPU08 *
START
PSHX
PSHH
PSHA
;2 push X onto stack
;2 push H onto stack
;2 push A onto stack
XX
XX
XX
XX
;actual subroutine code
PULA
PULH
PULX
;2 pull A off of stack
;2 pull H off of stack
;2 pull X off of stack
Figure 5. CPU08 Subroutine Code
The stack helps in efficiently utilizing parameters, local variables, and
subroutine return values. Parameters are variables that are passed to
the subroutine. Local variables are variables that are only used within
the scope of the subroutine. A subroutine return value is the output of
the subroutine. An example of a subroutine and its variables are given
below in equation form:
Y = (X)3
If we were to write a subroutine that calculates the cube of the value X,
X would be the parameter passed to the subroutine. Y would be the
subroutine return value, and any variable used to calculate Y would be
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
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
相關代理商/技術參數
參數描述
AN122677 制造商:AN# - MILITARY 功能描述:
AN122683 制造商:AN# - MILITARY 功能描述:
AN122694 制造商:AN# - MILITARY 功能描述:
AN122717 制造商:AN# - MILITARY 功能描述:
AN122718 制造商:AN# - MILITARY 功能描述: