;
;
;          "boduns.txt" 
;     
;      
;     :    
;
;---------------------------------------------------------------
;
;      1
;
 ubodun1:
      ldwi acch,accl,ubodun1_fsb
		 movw fsbl,accl
    ldwi acch,accl,ubodun1
   movw retterl,accl
  prints str14,frame0 ;   frame0+refram   str14
                  ; '  1 = '
      ldi accl,mabod1
      mov nbud,accl
      ldwi yh,yl,bodun1
     rjmp pobud
;---------------------------------------------------------------
;
;      2
;
 ubodun2:
      ldwi acch,accl,ubodun2_fsb
		 movw fsbl,accl
    ldwi acch,accl,ubodun2
   movw retterl,accl
  prints str15,frame0 ;   frame0+refram   str15
                  ; '  2 = '                  
      ldi accl,mabod2
      mov nbud,accl
      ldwi yh,yl,bodun2
 pobud:
     ld accl,y+
     ld acch,y+
     ld tmpl,y+
     ldwi yh,yl,b_asks0
     rcall simkod ;    
     mov accl,acch
     rcall simkod ;    
     mov accl,tmpl
     rcall simkod ;    
    lo_sbuf sp_buf3 ;     
      ld accl,-y
      sts bufos_5,accl
      ld accl,-y
      sts bufos_6,accl
      ld accl,-y
      sts bufos_8,accl
      ld accl,-y
      sts bufos_9,accl
      ldi accl,0x30
      sts bufos_f,accl
 ;     - ""   1
 ;     
 ;      ""   0 ( "?")
 ;     - "     
 ;     "
 ;      
 ;     ""     
     lds flags,bodunf ;  -  flags
     ldi tmph,0x0F
     and tmph,flags ;    
     and tmph,nbud ;     
     brbs SREG_Z,out_uri1
      ldi accl,0xED ;  ""  
      sts bufos_1,accl
  out_uri1:
 ;       0  1  
 ;   
     ldi tmph,0xF0
     and tmph,flags ;     
     swap tmph
     and tmph,nbud ;    = 0 ,  Z=1 (..=1>>Z=0)
     brbs SREG_Z,open_cor1 ; bufos_f=0x30
     ldi accl,0x31
     sts bufos_f,accl ; bufos_f=0x31
  open_cor1:
      rcall pzet1  ;    frame1+refram,    kursadr
        ;          !!!
        ;      :
        ; kursadr-(frameN+refram)
     sbr accl,(1<<7) ;     "?"
     rcall wr_wus ; /  /
     rcall wait_wrt ; =  0   
     ldi accl,0b00001111
     rcall wr_wus
     rcall wait_wrt ;   =    
                   ;  
     printb frame1
     cbr vars,(1<<warom) ;      << & >>
     rjmp step4 ;       (tolloff)
             ;        ""
;---------------------------------------------------------------
;
;                     
;                   
;                 
;
;        
 re_nbud:
     lds acch,bufos_5
     lds accl,bufos_6
     andi acch,0x0F
     andi accl,0x0F
     swap acch
     or accl,acch
     rcall decobin
     mov tmph,accl ;      tmph
     lds acch,bufos_8
     lds accl,bufos_9
     andi acch,0x0F
     andi accl,0x0F
     swap acch
     or accl,acch
     rcall decobin
     mov tmpl,accl ;      tmpl
  ;--------------------------------------------------------
      sbrc nbud,0
      rjmp lodreg1
      sbrc nbud,1
      rjmp lodreg2
      nop ;     (   2 )
      rjmp re_baksp ;      
            ;     
  ;--------------------------------------------------------
 lodreg1:
      sts bodun1+1,tmpl ;   
      sts bodun1+2,tmph ;   
			     ;   ,   "hard_t7d.txt"
			lds accl,bufos_f ;    (0x30  0x31)
			bst accl,0
			bld flags,outlev1 ;     outlev1
			sbr flags,(1<<enbud1) ;   " 1 "
			sts bodunf,flags ;    bodunf
    rjmp re_baksp ;      
            ;     
  ;--------------------------------------------------------
 lodreg2:
      sts bodun2+1,tmpl ;   
      sts bodun2+2,tmph ;   
           ;   ,   "hard_t7d.txt"
      lds accl,bufos_f ;    (0x30  0x31)
			bst accl,0
			bld flags,outlev2 ;     outlev
			sbr flags,(1<<enbud2) ;   " 1 "
			sts bodunf,flags ;    bodunf
		rjmp re_baksp ;      
            ;     
;---------------------------------------------------------------------
;
;                     
;                  
;              
 re_bakbud:
      com nbud
      and flags,nbud
      sts bodunf,flags ;     
      rjmp re_baksp ;      
            ;     
;---------------------------------------------------------------------
  simkod:
     rcall binodec
     mov tmph,accl
     andi accl,0x0F
     ori accl,0x30
     swap tmph
     andi tmph,0x0F
     ori tmph,0x30
     st y+,accl
     st y+,tmph
   ret
;---------------------------------------------------------------------
; ;         ""
;            ; (   )
 outres:
     sbrs vars,bodsf ;      
     rjmp step4 ;     
     cbr vars,(1<<bodsf) ; bodsf=0
     ldi accl,(frame1 | 0x80) ;     40
     rcall wr_wus
     rcall wait_wrt
     ldi accl,0x20 ;   ""
     rcall wr_dat
     rcall wait_wrt
     sbi PORTB,outline ;      
     rjmp step4 ;     
;---------------------------------------------------------------------