📄 main.asm
字号:
;*****************************************************
;
; This programme is for study Ver2.0.0 beta
; The main control programe
;This programme must be run in 12MHz standard settings
; Designer: Mr.Koii
; Copyright 2002 koiistudio
; 2003.03.31 at Changsha. H.N. P.R.China
;
;*****************************************************
;*****************************************************
;参数定义
;*****************************************************
beep bit p1.5 ;蜂鸣器引脚
digital_bit equ 08h ;显示位
keys_byte equ 09h ;按键字节
digital_flash_time equ 0ah ;闪烁计时
digital_flash_bit equ 0bh ;闪烁位
aleart_data equ 0ch ;时间报警字节(连续两字节)
aleart_byte equ 0eh ;报警设置字节
digital_byte equ 10h ;显存首址,连续8字节为显存
date_data equ 20h ;时钟数据首地址
;*****************************************************
;主程序
;*****************************************************
org 0000h
jmp start
org 000bh
jmp time_int
org 0013h
jmp keys_int
org 0030h
start: mov p0,#0
mov p1,#0fh
mov p2,#0
mov p3,#0ffh
mov sp,#60h ;堆栈地址
mov r0,#7fh ;Clear the ram
clr a
main_clear0: mov @r0,a
djnz r0,main_clear0
mov digital_bit,#1
mov r0,#aleart_data ;默认的报警时间
mov @r0,#00h ;分
inc r0
mov @r0,#07h ;时
call timer_set
call iicread
setb ex0
setb ex1
setb ea
call beep1
main_wait: call digital
mov a,keys_byte
cjne a,#0,keysmanagement
jmp main_wait
keysmanagement: call keys_management
mov keys_byte,#0
jmp main_wait
;*****************************************************
;子程序文件载入
;*****************************************************
include "iic.asm"
include "beep.asm"
include "keysmanagement.asm"
include "timer.asm"
include "display.asm"
include "time_int.asm"
include "aleart_check.asm"
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -