shlu's note

前言

在伪代码没问题的情况下,尽量还是用伪代码,方便快捷

LDR

image -参考:https://www.jianshu.com/p/66d801c85ee9

LDUR

image

STR

image

存储时是按q0的类型存储的,q0是16字节,就要存储16字节

EXTR

image

NEG

image

BIC

image

条件代码

image

BCC

image

S

image

NZCV

image

REV

32bits下等效代码

uint32_t bswap32(uint32_t s) {
    return ((s << 24) & 0xff000000) |
           ((s << 8) & 0x00ff0000) |
           ((s >> 8) & 0x0000ff00) |
           ((s >> 24) & 0x000000ff);
}

ROR

32bits下等效代码

//_DWORD __ROR4__(_DWORD a,char b);
//循环右移count位
inline uint32_t __ROR4__(uint32_t value, int count) {
    int offset = count % 32;
    if (offset < 0)offset = 32 + offset;
    if (offset >= 1 && offset <= 31) {
        return (value >> offset) | (value << (32 - offset));
    } else if (offset == 0 || offset == 32) {
        return value;
    }
    exit(100);
}

未解决问题

参考

声明:转载请注明出处,原文地址:shlu's note