 include '16f88.inc'
 fuses _intrc_io
 fuses _wdt_off
 fuses _pwrte_on
 fuses _mclr_off
 fuses _boden_off
 fuses _cp_off
 fuses _cpd_off
 fuses _ieso_off
 fuses _fcmen_off
 fuses _lvp_off
 fuses _wrt_enable_off
 fuses _debug_off
 fuses _ccp1_rb2
 id '0001'
mCOUNT_0 = 20h
mCOUNT_1 = 21h
mNUMBER = 22h
mFLAG = 23h.0
BUTTON = ra.0
LED7S = rb
 clr mNUMBER
 clr mFLAG
 clr ra
 mov rb,#11111111b
 setb rp0
 mov trisa,#00000001b
 mov trisb,#00000000b
 mov osccon,#01100000b
 mov ansel,#00000000b
 clrb rp0
rDIGIT
 mov w,mNUMBER
 call sGETPATTERN
 mov LED7S,w
 jnb mFLAG,rUPLOOP
 jb BUTTON,rDIGIT
 inc mNUMBER
 cjne mNUMBER,#10,rCLEAR
 clr mNUMBER
rCLEAR
 clr mFLAG
 jmp rDIGIT
rUPLOOP
 clr mCOUNT_0
 mov mCOUNT_1,#8
rLOOP
 jnb BUTTON,rDIGIT
 djnz mCOUNT_0,rLOOP
 djnz mCOUNT_1,rLOOP
 setb mFLAG
 jmp rDIGIT
sGETPATTERN
 jmp pc+w
 retw 00010001b,01111101b,00100011b
 retw 00101001b,01001101b,10001001b
 retw 10000001b,00111101b,00000001b
 retw 00001001b
