aboutsummaryrefslogtreecommitdiff
path: root/fw/semihosting.c
blob: 96ebc7a3ac6c0c5b1816f18184be3f33997cf2d4 (plain)
1
2
3
4
5
6
7
8
9
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");
}