NAND logical bitwise operation in ARM

天涯浪子 提交于 2020-11-29 08:33:24

问题


Is there a way to perform a bitwise NAND operation on the bits in two registers in ARM7, either with the existing AND, OR and EOR operations or other instructions?


回答1:


Sure; AND the two registers and then EOR the result with all 1's (for the negation).




回答2:


and then mvn (move not).

From GCC explorer

int nand(int a, int b) {
    return ~(a & b);
}

nand(int, int):
    and r0, r0, r1
    mvn r0, r0
    bx  lr


来源:https://stackoverflow.com/questions/21207561/nand-logical-bitwise-operation-in-arm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!