data segment
isend db 0
n0 db 0
n1 db 0
n2 db 0
keykind db 0
oldkey db 0
kind db 0
isstop db 0
numbers db 3fh,6,5bh,0,0,0,0,0,0,0
data ends
code segment
assume cs:code,ds:data
main:
cli
mov ax,cs
mov ds,ax
mov kind,0
mov keykind,0ah
mov oldkey,0ah
mov kind,06
mov isstop,0
mov isend,0
mov n0,0
mov n1,0
mov n2,0
call initnumbers
call init8255
call init8259
call init8253
call modifyint
mov dx,212h
mov al,0
out dx,al
call cleardevice
call display
mov al,0
mov dx,22ah
out dx,al
mov al,30h
out dx,al
mov al,6ah
sti
dowhat:
push ax
dowait:
mov dx,210h
in al,dx
test al,1
jz dowait
pop ax
call readakey
cmp keykind,0ah
jnz a1
mov kind,2
call gotonext
jmp aa
a1: