Question: Assembly Language: This program will cover use of mov (various kinds), direct addressing, negate, and flags. What you need to do: a) declare a variable

Assembly Language:

This program will cover use of mov (various kinds), direct addressing, negate, and flags. What you need to do: a) declare a variable number1 and set to decimal 5 move this number into the ebx register and then negate it. zero out the ecx register move 5 to the lower 8 bits of ecx. negate the lower 8 bits of ecx. move by sign extending the lower 8 bits of cl into ecx. using the techniques described in program 04, write out the string: The contents of ebx is: and move ebx into eax and then write out the signed integer using call WriteInt. write out the string: The contents of ecx is: and move ecx into eax and then write out the signed integer using call WriteInt. You should see that they are equivalent. b) create an unsigned array of 16 bit integers and initialize it to 5,6,7,8 create a signed array of 16 bit integers and initialize it to -1,-2,-3,-4 Then move with zero extend the 4 unsigned integers into eax,ebx,ecx,edx using direct addressing call the Irvine procedure DumpRegs to see the contents of the registers. Then move with sign extend the 4 signed integers into eax,ebx,ecx,edx using direct addressing. call the Irvine procedure DumpRegs to see the contents of the registers. c) move into ax the value 7FF0h add to the lower 8 bits of ax the quantity 10h. call DumpRegs. In a comment indicate why you are seeing the values shown for CF and OF. add 1 to the upper 8 bits of ax. Call DumpRegs. In a comment indicate why you are seeing the values shown for CF and OF. add 2 to ax. Call DumpRegs. In a comment indicate why you are seeing the values shown for CF and OF. Your output should look as follows (where some of the uninteresting output has been omitted): The contents of ebx is: -5 The contents of ecx is: -5 EAX=00000005 EBX=00000006 ECX=00000007 EDX=00000008 . . . EAX=FFFFFFFF EBX=FFFFFFFE ECX=FFFFFFFD EDX=FFFFFFFC . . . . . . . CF=1 SF=0 ZF=1 OF=0 AF=0 PF=1 . . . . . . . CF=0 SF=1 ZF=0 OF=1 AF=1 PF=0 . . . . . . CF=0 SF=1 ZF=0 OF=0 AF=0 PF=0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!