Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Assembly Language Programming (ALP) Forum (http://www.go4expert.com/forums/assembly-language-programming-forum/)
-   -   Intel Processor Register (http://www.go4expert.com/forums/intel-processor-register-t23886/)

eblack10 17Nov2010 02:10

Intel Processor Register
 
What are the contents of register al on and intel processor after these instructions?

mov al, 01010101b
and al, 00001111b
or al, 11110000b

xpi0t0s 17Nov2010 12:50

Re: Intel Processor Register
 
This isn't difficult. Where are you stuck? Do you understand what AND and OR do? (Presumably not, otherwise finding the answer would be trivial.)
Truth tables for AND and OR:
AND:
a b x
0 0 0
0 1 0
1 0 0
1 1 1

OR:
a b x
0 0 0
0 1 1
1 0 1
1 1 1

and these operations are performed on every bit. So, taking them right to left, 1 and 1 is 1, 0 and 1 is 0 etc, so the result is xxxxxx01; we then OR that with 11110000 which gives us xxxxxx01. You can fill in the x's now you know what to do.


All times are GMT +5.5. The time now is 21:53.