UMBC CMSC 313 Debugger Homework
UMBC |
Computer Organization and Assembly Language |
CMSC313 Debugger Homework -- Due 28 Feb
Assignment
Assembly and run the following program using the debugger. Get the
contents from the specified register. Pay attention and make
no assumptions.
Program
;;
;; Using the debugger, what is the value of the indicated register after the
;; instruction on that line of code is executed?
;;
;; Record all values as eight hexadecimal digits.
;; Cut and paste your answers and store it in a text file.
;; 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. _____________________
;;
section .data
aByte DB 44h
aWord DW 4455h
aDWord DD 99887766h
section .bss
section .text
global main ;must be declared for linker (ld)
main: ;tell linker entry point
;; put your code here
mov bl, [aByte] ; 1. eax = ______________________
shr ebx, 1 ; 2. eax = ______________________
mov bx, word [aWord] ; 3. eax = ______________________
shl ebx, 1 ; 4. eax = ______________________
mov eax, [aDWord] ; 5. eax = ______________________
mov ah, [aByte] ; 6. eax = ______________________
mov ebx, eax ; 7. ebx = ______________________
mov bh, 0FFh ; 8. ebx = ______________________
mov ax, bx ; 9. eax = ______________________
mov bl, ah ; 10. eax = ______________________
mov ebx, 0 ; 11. ebx = ______________________
mov eax, [aDWord] ; 12. eax = ______________________
not eax ; 13. eax = ______________________
mov eax, dword [aDWord] ; 14. eax = ______________________
neg eax ; 15. eax = ______________________
mov ax, [aWord] ; 16. eax = ______________________
rol ax, 1 ; 17. eax = ______________________
mov cl, 3
shl ax, cl ; 18. eax = ______________________
mov ebx,0 ;successful termination of program
mov eax,1 ;system call number (sys_exit)
int 0x80 ;call kernel