Add 'press Q to exit' function
This commit is contained in:
+14
-4
@@ -13,10 +13,15 @@ humid_offset equ 09eh
|
||||
bdos equ 0005h
|
||||
conout equ 02h
|
||||
conin equ 01h
|
||||
dconio equ 06h
|
||||
printstr equ 09h
|
||||
|
||||
|
||||
start:
|
||||
ld c,printstr ; tell the operator how to quit
|
||||
ld de,quitmsg
|
||||
call bdos
|
||||
|
||||
call init_lcd
|
||||
call init_siob
|
||||
call lcd_delay
|
||||
@@ -42,11 +47,14 @@ start:
|
||||
main:
|
||||
call read_char_b
|
||||
call parse_char
|
||||
ld c,11
|
||||
ld c,dconio ; direct console i/o, no echo
|
||||
ld e,0ffh ; ff polls, returning zero if no key
|
||||
call bdos
|
||||
or a
|
||||
jr z,main
|
||||
ret
|
||||
cp a,051h ; Q
|
||||
ret z
|
||||
cp a,071h ; q
|
||||
ret z
|
||||
jr main ; no key, or a key we ignore
|
||||
|
||||
init_siob:
|
||||
ld a,018h ; channel reset
|
||||
@@ -240,6 +248,8 @@ clabel: DB 'degree C',0
|
||||
plabel: DB 'hPa',0
|
||||
hlabel: DB '% RH',0
|
||||
|
||||
quitmsg: DB 'Press Q to quit',0dh,0ah,'$'
|
||||
|
||||
char_max equ 15
|
||||
char_cnt DB 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user