;
;         "ts_ext_disp.txt"    
;
;------------------------------------------------------------------------------
;
dp_test:
    ldi ts_cntss,ts_ssl
 ts_tp0:
     sbrs dp_flags,dp_s_end
     rjmp ts_tp0 ;   dp_s_end=1
    ser r16
    cbr r16,(1<<dp_s_end)
    and dp_flags,r16 ; dp_s_end=0
    dec ts_cntss
   brne ts_tp0 ;    
  ldi ts_cntss,ts_ssl ;   
 dn_atr:
     lds bfr0,dp_rabf
     lds bfr1,(dp_rabf+1) ;    
     subi bfr0,10
     sbci bfr1,0 ;  =  - 10
     tst bfr1
     breq ts_tp1 ;    =0     
    rjmp ts_tp2 ;      ts_tp2
 ts_tp1:
     cpi bfr0,(dp_minj-10)
     brne ts_tp2 ;     ts_tp2
   ldi bfr0,low(dp_maxj)
   ldi bfr1,high(dp_maxj) ;     
 ts_tp2:
   movw r22,bfr0 ;    r23:r22
  rcall bin_dec ;   - (in lb_ext_disp.txt)
  rcall bin_seg ;     (in lb_ext_disp.txt)
   ldwi x,dp_rabf
   ldi r16,(dp_lenbuf)
 ts_tp3:
  st x+,r22
  st x+,r23
  dec r16
  brne ts_tp3 ;      
   sbr r16,(1<<dp_exch)
   or dp_flags,r16 ; dp_exch=1
  rjmp ts_tp0 ;     
;