Vra

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?

Was dit nuttig?

Oplossing 2

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

Ander wenke

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
Gelisensieer onder: CC-BY-SA met toeskrywing
Nie verbonde aan StackOverflow
scroll top