;
;         "hard_uim.txt" ;   
;
;
MAIN_PROG       CODE

; these first 4 instructions are not required if the internal oscillator is not used
start
        call    0x3FF             ; retrieve factory calibration value
        bsf     STATUS,RP0        ; set file register bank to 1 
        movwf   OSCCAL            ; update register with factory cal value
        clrf ANSEL ;     
        bsf PIE1,TMR1IE ;   /1 
        bcf     STATUS,RP0        ; set file register bank to 0
;
     clrf PORTC ;    PORTC " "
     bsf     STATUS,RP0        ; set file register bank to 1
     clrf TRISC ; PORTC   ,      
     bcf     STATUS,RP0        ; set file register bank to 0
     movlw 7
     movwf CMCON ;  
     movlw b'00110100' ;    1:8   
     movwf T1CON ;  /1 
     clrf TMR1L
     clrf TMR1H
     bcf PIR1,TMR1IF ;   
     movlw (1<<GIE)|(1<<PEIE)
     movwf INTCON ;  

; remaining code goes here

;        goto $
; display test
  call tst_strs
  nop
  nop
  nop
  call prepare
  bsf port_ksd,L_INH ;  
  bsf T1CON,TMR1ON ;   -
  movlw .80
  movwf tmp_f
  nop
  nop
  nop
rept_tst
  btfss kd_flags,mark
  goto rept_tst
  bcf kd_flags,mark
rept_tst_1
  btfss kd_flags,mark
  goto rept_tst_1
  bcf kd_flags,mark
  call w_ksda
  nop
  nop
  nop
  call step_tst
  nop
  nop
  nop
  decfsz tmp_f,f
  goto rept_tst
  call tst_strs
  call prepare
  movlw .80
  movwf tmp_f
  goto rept_tst