 set esc mode $f0
  sta escape_mode
  rts


; -------------------------------------
; [ esc mode
;
; escape_mode = $ff
; -------------------------------------
  
long_escape_mode:
  tya         ; restore char
  ldy escape_buffer_length
  sta escape_buffer,y  ; store char
  iny
  sty escape_buffer_length   ; inc esc buffer  
  jsr test_if_letter   ; test letter
  bcs :+     ; process command
  rts

; --- process esc command ---
; A = last char
; Y = escape_buffer_length
; X counts pro