Comp 3350 HW # 4:  Theme: Debugging, Flags, Data Declarations solution

$25.00

Original Work ?
Category: You will Instantly receive a download link for .ZIP solution file upon Payment

Description

5/5 - (4 votes)

  1. Single step through the program created in the previous assignment (HW3)—the AddSub Program. Submit a trace of screenshots single stepping through each line of the program.

 

  1. Declare whether each flag is set (‘1’ for set, ‘0’ for not set) following each instruction. Show the function of the instructions by hand.

 

Instruction # Instruction CF SF ZF OF
0 mov ax, 7F00h
1 add ax, 100h        
2 add al, 0h        
3 add al, 0FFh        
4 sub ah, 080h        

 

  1. Given the following data declarations:

 

.data

Alpha  BYTE 2Bh, 23h, 4Ah

Beta   DWORD 222h

Delta  DWORD 312h

Iota   DWORD 434h

Zeta   WORD 124h

 

  1. Write an instruction that moves Beta into EAX and adds Iota to the same register

 

  1. Write a set of instructions that adds all the elements of the array Alpha into AL

 

  1. Write a set of instructions that moves Delta into EAX, adds the value stored in Zeta to the same register

 

  1. Write an instruction that moves the last two bytes in ALPHA into CX.

 

  1. What are the contents of CX subsequent to part D of this question?

 

 

  1. Fill in the requested register values after executions of the instructions:

Show the memory map.

.data

myBytes       BYTE       24h, 25h, 26h, 27h

myWords       WORD       2233h, 3355h, 3456h, AACCh, BCCBh

myDoubles     DWORD       BB00h, 2345h, 3456h, AB71h, 44h

myPointer     DWORD       myDoubles

 

 

 

 

.code

mov esi, OFFSET myBytes

mov ax, WORD PTR [esi+2]                          ; A.         AX =

mov eax, DWORD PTR myWords                          ; B.          EAX =

mov esi, myPointer

mov ax, WORD PTR [esi+8]                          ; C.          AX =

mov ax, WORD PTR [esi+1]                    ; D.         AX =

mov ax, WORD PTR [esi-6]                       ; E.             AX =

 

 

  1. What is returned by the following operations in connection to the given array:

 

.data

myArray DWORD 12 DUP(23), 3, 34, 467 , 2365, 47899

 

  1. TYPE myArray

 

 

  1. LENGTHOF myArray

 

 

  1. SIZEOF myArray

 

 

  1. Fill in the requested register values after executions of the instructions (Do not let your eyes deceive you. There are some movSx instructions and some movZx instructions.):

 

.code

mov bx, 0ACD8h

movzx eax, bx                    ; A.       EAX =

movzx edx, bl                    ; B.       EDX =

movzx cx, bh                     ; C.       CX =

 

mov bx, 0DD34h

movsx eax, bx                    ; D.       EAX =

movsx edx, bl                    ; E.       EDX =

movsx cx, bh                     ; F.       CX =