From 84de029e74859d98c82047b04b62d87a35d12a27 Mon Sep 17 00:00:00 2001 From: jaseg Date: Sat, 10 Jun 2017 19:14:18 +0200 Subject: fw working commit --- fw/semihosting.c | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 fw/semihosting.c (limited to 'fw/semihosting.c') diff --git a/fw/semihosting.c b/fw/semihosting.c new file mode 100644 index 0000000..96ebc7a --- /dev/null +++ b/fw/semihosting.c @@ -0,0 +1,10 @@ + +#define SYS_WRITE0 0x04 + +void write0(const char *c) __attribute__((naked)); +void write0(const char *c) { + __asm__("mov r1, %0" : : "r" (c)); + __asm__("mov r0, %0" : : "I" (SYS_WRITE0)); + __asm__("bkpt 0xab"); + __asm__("bx lr"); +} -- cgit