Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please look at the question carefully. This is the 3rd time I post this question

ID: 3889392 • Letter: P

Question

Please look at the question carefully. This is the 3rd time I post this question. In previous 2 versions, people just coppied from old posts and did not even look at the question. Thanks a lot.
..ooo T-Mobile 4:24 PM 796 Expert Q&A; Done Which of the following instructions are invalid? Discuss why they are invalid? If the instruction is valid, state what does happen after it is executed. Let's assume EAX has the value 0x000020F0 (hex 000020F0 0010 0000 1111 000). Also memory locations S20F0, $20F1, S20F2 and $20F3 have the values 1,2,3 and 4 a) MOVB %AL, %BL b) MOVL 0x300, %EBX c) MOVW %ECX, 0x30 d) MOVB 0x3400, %AL

Explanation / Answer

EAX has the value stored at 0x20FO address which happens to be 1.

If we are given EAX value then the value of AX, AH and AL can be derived as below

%eax = [x x x x] - this is 32 bit, each x here is 8 bit.

%ax = [x x - -] - this is 16 bit

%al = [x - - -] - this is 8 bit

%ah = [- x - -] - this is 8 bit

Given %EAX = 00000000 00000000 00000000 00000001

%AX = 00000000 00000000

%AL = 00000000

%AH = 00000000

Similarly, %EAB = 00000000 00000000 00000000 00000010

%BX = 00000000 00000000

%BL = 00000000

%BH = 00000000

1) MOVB %AL,%BL

This is valid instruction. It says move byte from register AL to register BL.

Since AL and BL contents are same.. this instruction does not change the contents of BL

2) MOVL 0x300, %EBX

This is valid instruction. It will move 32 bit integer from 0x300 location to EBX.

memory location 0x300 contents not given

3) MOVW %ECX,0x30

This is invalid because ECX is 32 bit wide and the MOVW instruction explictly works

on 16 bit word.

4) MOVB 0x3400, %AL

This is valid instruction. It moves byte contents in 0x3400 to register AL.

memory contents 0x3400 contents not given.

5) MOVW %AX, %AL

This is invalid. because the instruction MOVW is trying to move a 16 bit word from AX.

Though AX is 16 bit wide, the desination AL is 8 bit and it fails.