aboutsummaryrefslogtreecommitdiff
path: root/assembler/get_char.s
blob: f1f43e7264c2b5b5481a7a6b9b1cd426a41f507d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// R9: end_char
get_char:
  PUSH {LR}
  BL uart_recv
  MOVS R1, 025 // ^U (NAK)
  CMP R0, R1
  BEQ redo_line
  MOVS R1, 004 // ^D (EOT)
  CMP R0, R1
  BEQ done_for_real
  CMP R0, R9
  POP {PC}

get_line:
  BL get_char
  ...
  B get_line

redo_line:
  ...
  B get_line