Find out the errors, if any, in the following 5m Dec2005

By | November 10, 2014

Find out the errors, if any, in the following, and               5m Dec2005

(i)                 CMP AX, BX

No error

since two register operand are allowed for comparison in the permutations shown below.

cmp01

(ii)               IDlV AX, CH

IDIV works or allows one parameter only and it can either be register or memory only as shown below.

corrected instruction will be IDIV CH

Errors shown while compiling:-

(1) illegal instruction: IDlV AX, CH or wrong parameters.

(0) not enough instructions…

(0) should be at least 1 instruction outside macro or before the ‘END’ directive

idiv

(iii)             DEC AL

No error

since one register operand are allowed for decremented value in the permutations shown below.

dec

(iv)             AAA AX, BX

AAA works or allows no parameters as shown below.

corrected instruction will be AAA

Errors shown while compiling:-

(1)   illegal instruction: AAA AX, BX or wrong parameters.

(0)   not enough instructions…

(0) should be at least 0 instruction outside macro or before the ‘END’ directive

aaa

(v)               XCHG WORD1, WORD2

XCHG works with three permutations shown below in the table. The above permutation memory memory is not allowed.

corrected instruction will be MOV AX, WORD1

XCHG AX, WORD2

Errors shown while compiling:-

(1) wrong parameters: XCHG  WORD1, WORD2

XCHG01