📄 degreec2f.asm
字号:
;==================================================================================
; The information contained herein is the exclusive property of
; Sunplus Technology Co. And shall not be distributed, reproduced,
; or disclosed in whole in part without prior written permission.
; (C) COPYRIGHT 2004 SUNPLUS TECHNOLOGY CO.
; ALL RIGHTS RESERVED
; The entire notice above must be reproduced on all authorized copies.
;==================================================================================
;==================================================================================
; Program Name : DegreeC2F.asm
; Description : This program presents an example that get the temperature(F)
; with the method of looking up table.
; Reference : SPMC65P2404A/2408A Data Sheet
; Revision history :
;----------------------------------------------------------------------------------
; Version Date Description
; 1.0.0 2004-8-13 First Edition
;==================================================================================
.SYNTAX 6502 ;process standard 6502 addressing syntax
.LINKLIST ;generate linklist information
.SYMBOLS ;generate symbolic debug information
;************************************************************************************
;**********************************************************************************
.PAGE0
.DATA ;define data storage section
;**********************************************************************************
.CODE
;==================================================================================
; Function: F_DegreeC2F
; Description: Converting C to F
; Input: X------------temperature(C)
; Output: A------------temperature(F)
; Destroy: A,X
; Stacks: 1
;==================================================================================
F_DegreeC2F:
lda TB_C2F,x
rts
;************************************************************************************
;* *
;* The Table of Converting C to F : F=(9/5)*C+32 *
;* *
;************************************************************************************
TB_C2F:
.DB #032
.DB #034,#036,#037,#039,#041
.DB #043,#045,#046,#048,#050
.DB #052,#054,#055,#057,#059
.DB #061,#063,#064,#066,#068
.DB #070,#072,#073,#075,#077
.DB #079,#081,#082,#084,#086
.DB #088,#090,#091,#093,#095
.DB #097,#099,#100,#102,#104
.DB #106,#108,#109,#111,#113
.DB #115,#117,#118,#120,#122
.DB #124,#126,#127,#129,#131
.DB #133,#135,#136,#138,#140
.DB #142,#144,#145,#147,#149
.DB #151,#153,#154,#156,#158
.DB #160,#162,#163,#165,#167
.DB #169,#171,#172,#174,#176
.DB #178,#180,#181,#183,#185
.DB #187,#189,#190,#192,#194
.DB #196,#198,#199,#201,#203
.DB #205,#207,#208,#210,#212
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -