aboutsummaryrefslogtreecommitdiff
path: root/hexedit/hexedit.s
blob: 0bc03a944da5028bbdeb69188c72ed50fd5b9e19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
.syntax unified
.cpu cortex-m0plus
.thumb

.type hexedit, %function
.global hexedit

hexedit:
  ldr r2, =0x20000100
  movs r1, 0
getchar:
  bl uart_recv
  cmp r0, 'g
  beq stop
  subs r0, '0 // The ASCII char '0'
  bmi next
  lsls r1, 4
  adds r1, r0
  b getchar
next:
  ldr r0, [r2, 0]
  adds r2, 4
  b hexedit
stop:
  b 0x20000100