From 257b5d233a475c7785b73943a356ba877e408fb8 Mon Sep 17 00:00:00 2001 From: Albom Date: Tue, 26 Jul 2011 03:28:25 +0000 Subject: [PATCH] keys handling in bcdclk git-svn-id: svn://kolibrios.org@2025 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/demos/bcdclk/trunk/bcdclk.asm | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/programs/demos/bcdclk/trunk/bcdclk.asm b/programs/demos/bcdclk/trunk/bcdclk.asm index 60936eaa4..d14032297 100644 --- a/programs/demos/bcdclk/trunk/bcdclk.asm +++ b/programs/demos/bcdclk/trunk/bcdclk.asm @@ -35,20 +35,28 @@ still: cmp eax,1 ; redraw ? je red + cmp eax, 2 ; key + je key + cmp eax,3 ; button in buffer ? je button call drawclock jmp still - + +key: + mov eax, 2 + int 0x40 + jmp still + button: - mov al,17 ; get id + mov al,17 ; get id mcall cmp ah,1 ; button id=1 ? jne noclose - or eax,-1 ; close this program + or eax,-1 ; close this program mcall noclose: @@ -133,6 +141,6 @@ call drawclock ret -title db 'BCD Clock',0 +title db 'BCD Clock',0 I_END: dg1: db ? \ No newline at end of file