har in A
; returns carry = 1 for A = digit
; -------------------------------------

test_if_digit:
  cmp #$30    ; smaller then 0?
  bcs :+     ; no -> go on
  rts         ; return no digit
:
  cmp #$3a    ; smaller then 9+1?
  bcs :+     ; no -> go on
  sec         ; return digit
  rts
:
  clc         ; return no digit
  rts


; -------------------------------------
; get decimal number from esc sequence
;
; esc sequence in escape_buffer
; first index to process in X
; returns: numbe