    ; TAB?
  bne @not_tab
  lda $d3     ; crsr col
  and #$f8    ; (col DIV 8) * 8
  clc         ; col + 8
  adc #$08
  cmp #$28    ; col=40?
  bne @not_last_col     ; no -> skip
  lda #$27    ; yes -> col=39
@not_last_col:
  tay         ; col to y
  ldx $d6     ; line to x
  jsr cursor_plot   ; set crsr
  rts

@not_tab:
  rts        

down_one_line:
  cpx #$18    ; end of screen?
  bne @not_end_of_screen     ;  no -> go on
  rts         ;  yes -> do nothing
@not_end_of_screen:
  inx 