UMBC Computer Organization and Assembly Language

CMSC313 Array Homework -- 10 Mar

Assignment

Assuming that the .data section starts at address 8049448h, list the address in memory (in hex) for all the variables. Use the following format:

Name       Address
----       -------
N
CArray
WArray
DArray
myAry
  

Then evaluate the following instructions and show the contents of the specified register, after the instruction has executed.

Pay attention and make no assumptions.

Answers

;;
;; Record all values as eight hexadecimal digits.
;; Turn the text file in use the Blackboard Digital Dropbox.
;;
;;
;; Name:  ______________________
;; 
;; Email: ______________________
;;
;; 1.  _____________________
;; 
;; 2.  _____________________
;;
;; 3.  _____________________
;;
;; 4.  _____________________
;;	
;; 5.  _____________________
;; 
;; 6.  _____________________
;;
;; 7.  _____________________
;;
;; 8.  _____________________
;;	
;; 9.  _____________________
;;
;; 10. _____________________
;;
;; 11. _____________________
;;	
;; 12. _____________________
;; 
;; 13. _____________________
;;
;; 14. _____________________
;;
;; 15. _____________________
;;	
;; 16. _____________________
;; 
;; 17. _____________________
;;
;; 18. _____________________
;;
;; 19. _____________________
;;
;; 20. _____________________
;;
;; 21. _____________________
;;
;; 22. _____________________
;;
;; 23. _____________________
;;
;; 24. _____________________
;;
;; 25. _____________________
;;

Data

Given that the .data section is set up in the following manner:

section .data
N	      DD          5
CArray	      DB          'Intel 80X86'
WArray	      DW          4, -15, 15, 33, 87, 2, -118
DArray        DD          4, -15, 15, 33, 32787, 100000, 0xFFFFFF00
myAry         db          10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22
              db          23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35
              db          36, 37, 38, 39, 40, 50, 51, 52, 53, 54, 55, 56, 57
              db          58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70
              db          71
              db          72
              db          73
              db          74
              db          75
              db          76
              db          77
              db          78
              db          79
              db          80


Instructions

              mov         eax, 0
;
              mov         ebx, 3
              mov         al, byte [ CArray + ebx ]  ; 1.  eax = ____________
;
              mov         ebx, [ N ]
              mov         al, [ CArray + ebx ]       ; 2.  eax = ____________
              mov         al, [ CArray + 2 + ebx ]   ; 3.  eax = ____________
;
              mov         ebx, [ N ]
              shl         ebx, 1
              mov         ax, [ WArray + ebx ]       ; 4.  eax = ____________
              mov         ax, [ WArray - 2 + ebx ]   ; 5.  eax = ____________
;
              mov         ebx, CArray
              mov         al, [ ebx ]                ; 6.  eax = ____________
              mov         al, [ 3 + ebx ]            ; 7.  eax = ____________
;
              mov         ebx, WArray
              mov         ax, [ ebx ]                ; 8.  eax = ____________
              mov         ax, [ 8 + ebx ]            ; 9.  eax = ____________
;
              mov         ebx, CArray
              mov         esi, 3
              mov         al, [ ebx + esi ]          ; 10. eax = ____________
              mov         al, [ 3 + ebx + esi ]      ; 11. eax = ____________
;
              mov         ebx, WArray
              mov         esi, 6
              mov         ax, [ebx + esi]            ; 12. eax = ____________
              mov         ax, [4 + ebx + esi]        ; 13. eax = ____________
;
              mov         ebx, DArray
              mov         esi, 12
              mov         eax, [ ebx + esi ]         ; 14. eax = ____________
              mov         eax, [ 8 + ebx + esi ]     ; 15. eax = ____________
;
              mov         ebx, 10h
              mov         eax, dword [ myAry + ebx ] ; 16. eax = ____________
              mov         ax,  word [ myAry + ebx ]  ; 17. eax = ____________
              mov         ah,  byte [ myAry + ebx ]  ; 18. eax = ____________
;
              mov         ebx, 10       
              mov         ax,  [ myAry + 2 * ebx ]   ; 19. eax = ____________
;
              xor         eax, eax
              mov         ebx, 1011b                 ; 20. ebx = ____________ 
              mov         eax, [ myAry + ebx ]       ; 21. eax = ____________         
              add         ebx, myAry                 ; 22. ebx = ____________
              mov         eax, [ ebx ]               ; 23. eax = ____________
;
              mov         eax, 0
              inc         ebx
              mov         ax, [ ebx ]                ; 24. eax = ____________
;
              mov         eax, 0
              inc         ebx
              mov         ah, [ ebx ]                ; 25. eax = ____________
;