1
2
3
4
5
6
7
    unsigned int spsr;

    asm volatile ("mrs %[SPSR], spsr    \n"
                  : [SPSR] "=r" (spsr)
                 );

    lcd_putsf(0, line++, "val: 0x%08x mode: %s", *(uint32_t *)pc, (spsr & (1<<5)) ? "T" : "A");