diff options
author | Damien George <damien.p.george@gmail.com> | 2015-02-16 17:46:49 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-02-16 17:46:49 +0000 |
commit | 42495392daa5efd3cb706d396f244ab7c9049b29 (patch) | |
tree | 24e37efdca622ea6033f0ecf48a09de13399c13a /py/asmthumb.h | |
parent | 3d7bf5d4b1f389fa0a47a330e52c8ddaefafa9ef (diff) | |
download | micropython-42495392daa5efd3cb706d396f244ab7c9049b29.tar.gz micropython-42495392daa5efd3cb706d396f244ab7c9049b29.zip |
py: Implement "it" instruction for inline Thumb assembler.
Diffstat (limited to 'py/asmthumb.h')
-rw-r--r-- | py/asmthumb.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/py/asmthumb.h b/py/asmthumb.h index 93cad09e78..a44d50dc4e 100644 --- a/py/asmthumb.h +++ b/py/asmthumb.h @@ -84,6 +84,7 @@ void asm_thumb_data(asm_thumb_t* as, uint bytesize, uint val); // argument order follows ARM, in general dest is first // note there is a difference between movw and mov.w, and many others! +#define ASM_THUMB_OP_IT (0xbf00) #define ASM_THUMB_OP_ITE_EQ (0xbf0c) #define ASM_THUMB_OP_ITE_CS (0xbf2c) #define ASM_THUMB_OP_ITE_MI (0xbf4c) @@ -100,6 +101,9 @@ void asm_thumb_data(asm_thumb_t* as, uint bytesize, uint val); void asm_thumb_op16(asm_thumb_t *as, uint op); void asm_thumb_op32(asm_thumb_t *as, uint op1, uint op2); +static inline void asm_thumb_it_cc(asm_thumb_t *as, uint cc, uint mask) + { asm_thumb_op16(as, ASM_THUMB_OP_IT | (cc << 4) | mask); } + // FORMAT 2: add/subtract #define ASM_THUMB_FORMAT_2_ADD (0x1800) |