     ; one line up
  ldy $d3     ; get crsr col
  jsr cursor_plot   ; set crsr
  jmp done_escape

@not_M:
; --- E --- next line
  cmp #$45    ; E ?
  bne :+
  jsr do_cr
  jsr do_line_feed
  jmp done_escape
:
; --- 7 --- save crsr
  cmp #$37    ; 7?
  bne :+
  lda font_mode    ; save font
  sta saved_font_mode
  lda $c7     ; save reverse mode
  sta saved_reverse_mode
  ldx $d6     ; save position
  ldy $d3
  stx saved_row
  sty saved_column
  jmp done_escape
:      
; --- 8 --- res