;
;         "mac_ios_mb.txt" ;    ()
;
;
;----------------------------------------------
;
  SEL_RB macro num ;;    
   if num = 0
    clr RS0
    clr RS1
   elseif num = 1
    setb RS0
    clr RS1
   elseif num = 2
    clr RS0
    setb RS1
   elseif num = 3
    setb RS0
    setb RS1
  endif
 endm
;
;----------------------------------------------
;
;     
;  
; adtrs -      
;   250  +   0x00
;
;  LLPRINT    "" 
;   bios (b52b bios_2 )
;      
; ( - WAIT_TOF)
;
 LLPRINT macro adtrs
  local ptt
   mov strg_ptr,#low adtrs
   mov strg_ptr+1,#high adtrs
   lcall proc_txd_init
 ptt:
   jnb eof_txd,ptt
 endm
;
;----------------------------------------------
;
;     
;    
 PRETEX macro adt
  local rips
    clr REN ;;  
  rips:
    jnb TI,rips
    clr TI ;;   
    mov strg_ptr,#low adt
   mov strg_ptr+1,#high adt
 endm
;
;
;----------------------------------------------
;
 ELL_ON macro
   clr P3.LED_EL
 endm
;
;----------------------------------------------
;
 ELL_OFF macro
   setb P3.LED_EL
 endm
;
;----------------------------------------------
;
; 1 tm = 0,01S  1    255!
;
 WAITT macro tm
  local llp
   mov wtm1,#tm
   setb en_wtm1
 llp:
   jnb wtm1_tic,llp
   clr en_wtm1
   clr wtm1_tic
 endm
;
;----------------------------------------------
;
 WAIT_TOF macro
  local ptt
 ptt:
   jnb eof_txd,ptt
 endm
;
;----------------------------------------------
;
 TEST_STOP macro
  sjmp $
 endm
;
;----------------------------------------------
;
;      
;     
;        
;      (data_t)
;         ACC
;
 Tx_BYTE_pol macro data_t
   local wttx
   clr ES
   mov sbuf,data_t
 wttx:
   jnb TI, wttx
   clr TI
   setb ES
 endm
;
;----------------------------------------------
;
;      
;     
; (   TI)
;        
;      (data_t)
;         ACC
;
 Tx_BYTE_irq macro data_t
   setb eof_txd
   mov sbuf,data_t
 endm
;
;----------------------------------------------
;
;    
;     
;
 Rx_BYTE macro addr
    mov step_ptr,#low addr
    mov step_ptr+1,#high addr
    setb eof_txd
    mov a,SBUF ;  
    clr RI ;    ""
    setb REN
 endm
;
;----------------------------------------------
;
;     b52m 
;  kotios    
;     adrret
;
;   adr_dest  :
;
;         start_user
;
;        -    
;   
;   "expect boot the command file"
; ("   ")
;     
;   com_string+1:com_string+2
;
;          res_user
;
;        -    
;   
;   "expect boot the command file"
; ("   ")
;     
;   start_user =   
;  kotios1
;
;          echo_rst
;
;        -     
;  hex 
;    
;   , 
;   com_string+1:com_string+2
;
;
;
;
;
;
 PCALL_LDFile macro adr_dest
 local adrret
  mov dptr,#com_string+1
  mov a,#high adrret
  movx @dptr,a
  inc dptr
  mov a,#low adrret
  movx @dptr,a
  ljmp adr_dest
 adrret:
  nop
 endm
;
;----------------------------------------------
;   -
 STA_cmd macro cmd
  mov a,#cmd
  setb data_key
  acall bspi_txd
  acall smart_qt_master
 endm
;
;----------------------------------------------
;  -
;    
 STA_dat macro cmd, dat
  mov a,#cmd
  setb data_key
  acall bspi_txd
  mov a,#dat
  clr data_key
  acall bspi_txd
  acall smart_qt_master
 endm
;
;----------------------------------------------
;  -
;   ,    
 STA_buf macro cmd, buf
  mov a,#cmd
  setb data_key
  acall bspi_txd
  mov a,buf
  clr data_key
  acall bspi_txd
  acall smart_qt_master
 endm
;
;----------------------------------------------
;      x " "
;     
; -  
 LDA_Pxfb macro cmd
  mov a,#cmd
  setb data_key
  acall bspi_txd
  clr data_key
  acall bspi_rxd
 endm
;
;----------------------------------------------
;     
; -  
 LDA_String macro cmd
  mov a,#cmd
  setb data_key
  acall bspi_txd
 endm
;
;----------------------------------------------
;