📄 tim_com2.asm
字号:
out SPDR , r20
ldi r17,0b00001000 ; display byte PC.3
out PORTC,r17
rcall delay
rcall turn_off
;-------------------display PC.3 second byte of time value
rcall b4_d0
ret
;-------------------- ; PC.4 display "0"
time_210: cpi r26,3
brne time_240
;----------------------
ldi r20,$5b
out SPDR , r20
ldi r17,0b0000100 ; display byte PC.2
out PORTC,r17
rcall delay
rcall turn_off
; ---------------------display PC.2 first byte of time value
ldi r20 ,$06
out SPDR , r20
ldi r17,0b00001000 ; display byte PC.3
out PORTC,r17
rcall delay
rcall turn_off
;-------------------display PC.3 second byte of time value
rcall b4_d0
ret
;-------------------- ; PC.4 display "0"
time_240: cpi r26,4
brne time_270
;----------------------
ldi r20,$5b
out SPDR , r20
ldi r17,0b0000100 ; display byte PC.2
out PORTC,r17
rcall delay
rcall turn_off
; ---------------------display PC.2 first byte of time value
ldi r20 ,$66
out SPDR , r20
ldi r17,0b00001000 ; display byte PC.3
out PORTC,r17
rcall delay
rcall turn_off
;-------------------display PC.3 second byte of time value
rcall b4_d0
ret
;-------------------- ; PC.4 display "0"
time_270: cpi r26,5
brne time_300
;----------------------
ldi r20,$5b
out SPDR , r20
ldi r17,0b0000100 ; display byte PC.2
out PORTC,r17
rcall delay
rcall turn_off
; --------------------display PC.2 first byte of time value
ldi r20 ,$07
out SPDR , r20
ldi r17,0b00001000 ; display byte PC.3
out PORTC,r17
rcall delay
rcall turn_off
;-------------------display PC.3 second byte of time value
rcall b4_d0
ret
;-------------------- ; PC.4 display "0"
time_300: cpi r26,6
brne time_330
;----------------------
ldi r20,$4f
out SPDR , r20
ldi r17,0b0000100 ; display byte PC.2
out PORTC,r17
rcall delay
rcall turn_off
; --------------------display PC.2 first byte of time value
ldi r20 ,$3f
out SPDR , r20
ldi r17,0b00001000 ; display byte PC.3
out PORTC,r17
rcall delay
rcall turn_off
;-------------------display PC.3 second byte of time value
rcall b4_d0
ret
;-------------------- ; PC.4 display "0"
time_330: cpi r26,7
brne time_360
;----------------------
ldi r20,$4f
out SPDR , r20
ldi r17,0b0000100 ; display byte PC.2
out PORTC,r17
rcall delay
rcall turn_off
; --------------------display PC.2 first byte of time value
ldi r20 ,$7d
out SPDR , r20
ldi r17,0b00001000 ; display byte PC.3
out PORTC,r17
rcall delay
rcall turn_off
;-------------------display PC.3 second byte of time value
rcall b4_d0
ret
;-------------------- ; PC.4 display "0
time_360: cpi r26,8
brne time_390
;----------------------
ldi r20,$4f
out SPDR , r20
ldi r17,0b0000100 ; display byte PC.2
out PORTC,r17
rcall delay
rcall turn_off
; --------------------display PC.2 first byte of time value
ldi r20 ,$7d
out SPDR , r20
ldi r17,0b00001000 ; display byte PC.3
out PORTC,r17
rcall delay
rcall turn_off
;-------------------display PC.3 second byte of time value
rcall b4_d0
ret
;-------------------- ; PC.4 display "0
time_390: cpi r26,9
brne time_420
;----------------------
ldi r20,$4f
out SPDR , r20
ldi r17,0b0000100 ; display byte PC.2
out PORTC,r17
rcall delay
rcall turn_off
; --------------------display PC.2 first byte of time value
ldi r20 ,$6f
out SPDR , r20
ldi r17,0b00001000 ; display byte PC.3
out PORTC,r17
rcall delay
rcall turn_off
;-------------------display PC.3 second byte of time value
rcall b4_d0
ret
;-------------------- ; PC.4 display "0
time_420: cpi r26,10
brne time_450
;----------------------
ldi r20,$66
out SPDR , r20
ldi r17,0b0000100 ; display byte PC.2
out PORTC,r17
rcall delay
rcall turn_off
; --------------------display PC.2 first byte of time value
ldi r20 ,$5b
out SPDR , r20
ldi r17,0b00001000 ; display byte PC.3
out PORTC,r17
rcall delay
rcall turn_off
;-------------------display PC.3 second byte of time value
rcall b4_d0
ret
;-------------------- ; PC.4 display "0
time_450: cpi r26,11
brne time_480
;----------------------
ldi r20,$66
out SPDR , r20
ldi r17,0b0000100 ; display byte PC.2
out PORTC,r17
rcall delay
rcall turn_off
; --------------------display PC.2 first byte of time value
ldi r20 ,$6d
out SPDR , r20
ldi r17,0b00001000 ; display byte PC.3
out PORTC,r17
rcall delay
rcall turn_off
;-------------------display PC.3 second byte of time value
rcall b4_d0
ret
;-------------------- ; PC.4 display "0
time_480: nop
;----------------------
ldi r20,$66
out SPDR , r20
ldi r17,0b0000100 ; display byte PC.2
out PORTC,r17
rcall delay
rcall turn_off
; --------------------display PC.2 first byte of time value
ldi r20 ,$7f
out SPDR , r20
ldi r17,0b00001000 ; display byte PC.3
out PORTC,r17
rcall delay
rcall turn_off
;-------------------display PC.3 second byte of time value
rcall b4_d0
ret
;-------------------- ; PC.4 display "0
b4_d0: ldi r20,$3f
out SPDR , r20
ldi r17,0b00010000
out PORTC,r17
rcall delay
rcall turn_off
ret
turn_off: ser r16
out DDRC,r16
ldi r17,0b0000000
out PORTC,r17
ret
change_disp: ret
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -