32 bit intel assembly questions registers/flags 2. Fill in the contents of the r
ID: 643053 • Letter: 3
Question
32 bit intel assembly questions registers/flags
2. Fill in the contents of the registers/flags after the execution of the corresponding instructions. (24 points) 3. Write the assembly language instruction(s) to do the following. (5 points each) Example Question: Clear Bit I in AX without changes any other bit. Answer: and ax 0FFFDh a) Set all the odd number bits in AH to I without changing the even bits. b) Toggle Bit 5 in DX without changing any other bit. c) Reverse all the bits in CX. d). Z flag is the indicator of the sign of a signed numberExplanation / Answer
a.)
mov ax,085h => ax = 0000 1000 0101 in binary
bt ax,1 => Carry flag = 0 and ax = 085h(unchanged)
b.)
mov ax,8A85h => ax = 1000 1010 1000 0101 binary
btc ax,15 => Carry flag = 1(15th bit from right) and ax = 0000 1010 1000 0101 = 0A85h (15th bit from right complemented)
c.)
mov ax,8000h => ax = 1000 0000 0000 0000 binary
bts ax,13 => carry flag = 0(13th bit from right) and ax = 1010 0000 0000 0000 = A000h (13th bit from right set)
d.)
mov ax, 0FFFFh => ax =1111 1111 1111 1111 binary
btr ax,4 => carry flag = 1(4th bit from right) and ax = 1111 1111 1110 1111 = 0FFEFh (4th bit from right reset)
3.)
a.) or ah,0AAh => or with 1010 1010 will set the odd numbered bits
b.) xor dx,40h => xor with 1 toggles the bit
c.)not cx => negates all the bits
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.