📄 self_test.asm
字号:
ld (BLK_CT),0
jp mode_prn_1
mode_prn_10:
cmp ix,slid_position_tbl_end
j ge,mode_prn_ok
jp mode_prn_1
mode_prn_2:
push ix
ld a,(KEY_CT)
j eq,mode_prn_3
call key_get
cmp (KEYIN),K_CEC
j ne,mode_prn_3
pop ix
jp mode_prn_error
mode_prn_3:
pop ix
dec ix
jp mode_prn_1
mode_prn_error:
ld hl,MD_NG
jp mode_prn_exit
mode_prn_ok:
ld hl,MD_OK
jp mode_prn_exit
mode_prn_exit:
call set_1line
call print
call wait_100ms
call wait_100ms
ret
;----------------------------------------------------------
key_test:
call spc_disp
ld (DISP_LSD-1),D_0
ld (DISP_LSD-0),D_F
call disp_to_dbr
ld ix,key_test_tbl
key_test_0:
ld a,(KEY_CT)
j eq,key_test_0
call key_get
ld a,(ix)
cmp a,(KEYIN)
j eq,key_test_1
cmp (KEYIN),K_CEC
j ne,key_test_0
ld hl,KEY_NG
jp key_test_exit
key_test_1:
inc ix
ld a,(ix)
ld (DISP_LSD-0),a
push ix
call disp_to_dbr
pop ix
inc ix
cmp ix,key_test_tbl_end
j lt,key_test_0
ld hl,KEY_OK
key_test_exit:
call set_1line
call print
call wait_100ms
call wait_100ms
ret
key_test_tbl:
db 0x0d,1
db 0x2b,2
db 0x07,3
db 0x05,4
db 0x03,5
db 0x0c,6
db 0x11,7
db 0x17,8
db 0x16,9
key_test_tbl_end:
;--------------------------------------------------------------------------
chara_prn:
ld b,0
chara_prn0:
ld hl,chara
ld a,b
ld w,18
mul w,a
add hl,wa
push b
call set_1line
call print
ld wa,P_RED
clr (P_RED>>4).a
pop b
test b.0
j f,chara_prn1
ld wa,P_RED
set (P_RED>>4).a
chara_prn1:
inc b
cmp b,24
j lt,chara_prn0
ret
chara:
db "1234567890+-x!#$%^" ;1
db "&*()" ;2
db 0x40,0x83,0x84,0x85,0x86
db "ABCDEFGHI"
db "JKLMNOPQRSTUVWXYZa" ;3
db "bcdefghijklmnopqrs" ;4
db "tuvwxyz09876543210" ;5
db "111111111111111111" ;6
db "222222222222222222" ;7
db "333333333333333333" ;8
db "444444444444444444" ;9
db "555555555555555555" ;10
db "666666666666666666" ;11
db "777777777777777777" ;12
db "888888888888888888" ;13
db "999999999999999999" ;14
db "000000000000000000" ;15
db "123456789123456789" ;16
db "12345678 12345678" ;17
db "1234567 1234567" ;18
db "123456 123456" ;19
db "12345 12345" ;20
db "1234 1234" ;21
db "123 123" ;22
db "12 12" ;23
db "1 1" ;24
;--------------------------------------------------------------------------
temp_vprn:
call spc_prnbuf
call print
ld hl,M_TEMP
call set_1line
ld a,(HD_TEMP)
add a,0x0
daa a
push a
swap a
and a,0x0f
or a,0x30
ld (PRN_BUF_MSD+15),a
pop a
and a,0x0f
or a,0x30
ld (PRN_BUF_MSD+16),a
call print
ld hl,M_VPRN
call set_1line
ld a,(VPRN)
cmp a,152
j ge,vprn_ad0
ld a,152
j vprn_ad2
vprn_ad0:
cmp a,212
j lt,vprn_ad2
ld a,212
vprn_ad2:
sub a,152
shlc a
shlc a
ld w,0
ld hl,vprn_tbl
add hl,wa
ld a,(hl)
ld (PRN_BUF_MSD+12),a
ld (PRN_BUF_MSD+13),'.'
ld a,(hl+1)
ld (PRN_BUF_MSD+14),a
ld a,(hl+2)
ld (PRN_BUF_MSD+15),a
ld a,(hl+3)
ld (PRN_BUF_MSD+16),a
call print
ret
vprn_tbl:
db "5938"
db "5977"
db "6016"
db "6055"
db "6094"
db "6133"
db "6172"
db "6211"
db "6250"
db "6289"
db "6328"
db "6367"
db "6406"
db "6445"
db "6484"
db "6523"
db "6563"
db "6602"
db "6641"
db "6680"
db "6719"
db "6758"
db "6797"
db "6836"
db "6875"
db "6914"
db "6953"
db "6992"
db "7031"
db "7070"
db "7109"
db "7148"
db "7188"
db "7227"
db "7266"
db "7305"
db "7344"
db "7383"
db "7422"
db "7461"
db "7500"
db "7539"
db "7578"
db "7617"
db "7656"
db "7695"
db "7734"
db "7773"
db "7813"
db "7852"
db "7891"
db "7930"
db "7969"
db "8008"
db "8047"
db "8086"
db "8125"
db "8164"
db "8203"
db "8242"
db "8281"
;--------------------------------------------------------------------------
;==============================================================================
; EEPROM Data port initial
;==============================================================================
;==============================================================================
; EEPROM Data port release (release P17,P16 for share SIO)
;==============================================================================
ee_test:
ld wa,IO_MT
test (IO_MT>>4).a ;bit -reverse-> jump status
j f,ee_test ;if jump status is 0 -> branch
call eeprom_check
ld wa,EP_FAIL
test (EP_FAIL>>4).a ;bit -reverse-> jump status
j f,ee_error ;if jump status is 0 -> branch
ld hl,M_EEOK
call set_1line
call print
ret
ee_error:
ld hl,M_EENG
call set_1line
call print
ret
vfd_test:
ld a,0x20
vfd_test_1:
push a
call set_disp_test
call disp_to_dbr
call wait_100ms
call wait_100ms
call wait_100ms
pop a
inc a
cmp a,0x28
j le,vfd_test_1
call spc_disp
call disp_to_dbr
call wait_100ms
call wait_100ms
call wait_100ms
ld wa,ICON_M
set (ICON_M>>4).a
call disp_to_dbr
call wait_100ms
call wait_100ms
call wait_100ms
ld wa,ICON_M
clr (ICON_M>>4).a
ld wa,ICON_MIN
set (ICON_MIN>>4).a
call disp_to_dbr
call wait_100ms
call wait_100ms
call wait_100ms
ld wa,ICON_MIN
clr (ICON_MIN>>4).a
ld wa,ICON_E
set (ICON_E>>4).a
call disp_to_dbr
call wait_100ms
call wait_100ms
call wait_100ms
ld wa,ICON_E
clr (ICON_E>>4).a
call spc_disp
ld hl,DISP_LSD
vfd_test_2:
ld (hl),0y11001000
push hl
call disp_to_dbr
call wait_100ms
call wait_100ms
call wait_100ms
call spc_disp
pop hl
dec hl
cmp hl,DISP
j ne,vfd_test_2
ld wa,ICON_M
set (ICON_M>>4).a
ld wa,ICON_MIN
set (ICON_MIN>>4).a
ld wa,ICON_E
set (ICON_E>>4).a
ld a,0y11001000
call set_disp_test
call disp_to_dbr
call wait_100ms
call wait_100ms
call wait_100ms
ld wa,ICON_M
clr (ICON_M>>4).a
ld wa,ICON_MIN
clr (ICON_MIN>>4).a
ld wa,ICON_E
clr (ICON_E>>4).a
call spc_disp
call disp_to_dbr
ld hl,DISP_FINISH
call set_1line
call print
ret
set_disp_test:
ld c,14-2
set_disp_test_1:
ld hl,DISP+2
ld (hl+c),a
dec c
j f,set_disp_test_1
ret
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -