문제

I've run across an example my professor made which made me question my understanding of the bset and bclr assembly commands.

If I do this:

bset BITS,80

am I performing an AND or an OR operation between the two? My reference guide says that bset does this:

M <= M + mask

Is + an OR or an AND operator? bclr is the same command but performs the operation with the complement of the mask.

도움이 되었습니까?

해결책

Bit setting and clearing implies ORing and ANDing, bitwise, respectively. BSET should be doing OR, and BCLR should be doing effectively AND.

It may be that BCLR simply does AND with the bit vector you give it, or BCLR does AND with the complement of the bit vector (my guess), depending on how nice the designers of the instruction set are.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top