參數(shù)資料
型號(hào): AN1218
廠商: 飛思卡爾半導(dǎo)體(中國(guó))有限公司
英文描述: HC05 to HC08 Optimization
中文描述: 以HC08的優(yōu)化HC05
文件頁(yè)數(shù): 40/56頁(yè)
文件大小: 417K
代理商: AN1218
Application Note
AN1218 Rev. 2
40
***** Load up stack before entering the subroutine
* Stack is given the 8-bit number to be cubed, X_IN
* Next, 3 bytes must be made available to the stack
* for the 24 bit output of the routine
* 3 pushes are made to illustrate this point
START LDA X_IN ;A
(X_IN)
PSHA ;push parameter X_IN onto stack
CLRA ;zero must be pushed on stack
; allocation for return answer
PSHA ;push Y_Low byte onto stack
PSHA ;push Y_Med byte onto stack
PSHA ;push Y_High byte onto stack
***** Jump to the cube subroutine
JSR CUBE ;jump sub to CUBE, Y = X_IN^3
*****
* location. Pull the answers off the stack when needed.
When subroutine is over, reset stack pointer to original
AIS #$04 ;SP
(SP) + $04
BRA DONE ;branch to the end of this
;example
***** CUBE subroutine
***** Given X_IN, find Y = X^3
* Save X,H, and A on stack
* Decrement stack for 2 bytes
CUBE PSHX ;push X onto stack
PSHH ;push H onto stack
PSHA ;push A onto stack
AIS #-2 ;decrement stack for local var
* Run the math routine
* Square X_IN, answer is X:A
LDA 11T,SP ;A = X_IN
LDX 11T,SP ;X = X_IN
MUL ;X:A = (X)*(A)
* Store away the high byte answer, X, to var1
STX 1,SP ;store high answ to var1
* Multiply 16 bit result by X_IN
* Multiply X_IN by low byte of 16-bit square
LDX 11T,SP ;X = X_IN
MUL ;X:A = (X)*(A)
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 功能描述: