Question

b) 4 bits c) 12 bits ) 16 bits 12) mov al, 0101b; mov bl, 1100b; and al, bl; What will AL be equal to after this code runs? b) 0xF3 c) 0x3F d) 0xF5 13) mov al, 0110b; mov bl, 1011b; or al, bl, xchg al, bl; neg al, What will AL and BL be equal to after this code runs? c) AL = 0xF3, BL = 0x1B 14) mov edx, 5 cmp edx, 10 ige L1, je L2 ile L3 LI : L2: L3: What tag (macro) will this code jump into? Some code Some code Some code a) L1 b) L2 c) L3 d) None of the above 15).data var1 word 200 code

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Ques 12: Given mov al, 0101b [means move 0101 binary data to al, also here by "b" at the end of 0101 means it is given in binary form]

mov bl, 1100b [means move 1100 binary data to bl]

and al, bl [means apply "and" operation on the contents of al and bl , store the result in al]

To find : The contents of al after the given commands are executed

Answer : The truth table of "and" operation is as below where A, B are inputs and C is the ouput

A (Input) 0 0 1 1
B (Input) 0 1 0 1
C (Output) 0 0 0 1

after "mov al, 0101b " : the contents of al is 0101

after "mov bl, 1100b " : the contents of bl is 1100

AND operation on al and bl contents is as below:

al 0 1 0 1
bl 1 1 0 0
Result (to be stored in al) 0 1 0 0

Now , since the and operation is done on the contents of al and bl which are in the binary form, result stored in al is also in the binary form that is: "0100b"

Conversion of 0100b to decimal is as follows:

0 * 23  + 1 *22 + 0* 21 +0 * 20 = 0+4+0+0 =4

(Method used for this conversion is : Multiply the rightmost bit by 20 and so on to left, every time incrementing the power of 2 by one and then add them.)

It can seen the options are given in the form of "0x...." which means it is a hexadecimal form.
It is very easy to convert hexadecimal to binary.

Convert every hexadecimal digit into 4 binary bits.
Option a: 0x04 means 04 (hex)
04 (hex) can be written as 0000 0100 (in binary form) which is equal to 4 in decimal , equal to the contents of al
and hence option A is the answer

We can also check the other options
Option b: 0xF3 means F3(hex) = 1111 0011 (in binary form) which is equal to

(1* 27+1*26 +1*25+1*24+0*23+0*22+ 1*21+1*20) = 243 in decimal and hence not equal to the contents of al

Option c: 0x3F means 3F(hex) = 0011 1111 (in binary form) which is equal to 63 in decimal and hence not the answer

Option d : 0xF5 means F5 (hex) = 1111 0101 (in binary form) = 245 in decimal and hence not the answer.

Ques 14 : mov edx, 5 [means edx=5]

cmp edx, 10 [compare the contents of edx and 10]

jge L1 [ means jump to L1 code if edx is greater than or equal to 10]

je L2 [means jump to L2 if edx is equal to 10 ]

jle L3 [means jump to L3 if edx is less than equal to 10] : since edx=5 is less than 10, the code will jump into L3.

hence option C is an answer.

Add a comment
Know the answer?
Add Answer to:
b) 4 bits c) 12 bits ) 16 bits 12) mov al, 0101b; mov bl, 1100b;...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT