UMBC CMSC 313 -- Assembly Homework 1 Previous | Next


Assembly Langauge Homework 2 -- Due 8 Mar

;;
;; Using the debugger, what is the value of the indicated register
;; after the instruction on that line of code is executed?  
;; Record all values in hexadecimal, modify your source code file
;; with the values and submit the source code file using 
;; Blackboard.
;;	


section .data
N	      DD	  5
CArray	      DB	  'Intel 80X86'
WArray	      DW	  4, -15, 33, 87, 2, -11

section .bss

section .text
    global main                       ;must be declared for linker (ld)

main:                                 ;tell linker entry point
 
	      mov	  ebx, 3
	      mov	  al, byte [ CArray + ebx ]	 ; al = ____________

	      mov	  ebx, [ N ]
	      mov	  al, [CArray + ebx ]	     ; al = ____________
	      mov	  al, [CArray + 2 + ebx]     ; al = ____________

	      mov	  ebx, [ N ]
	      shl	  ebx, 1
	      mov	  ax, [WArray + ebx]	     ; ax = ____________
	      mov	  ax, [WArray - 2 + ebx]     ; ax = ____________

	      mov	  ebx, CArray
	      mov	  al, [ebx]		             ; al = ____________
	      mov	  al, [3 + ebx]		         ; al = ____________

	      mov	  ebx, WArray
	      mov	  ax, [ebx]		            ; ax = ____________
	      mov	  ax, [8 + ebx]		        ; ax = ____________

	      mov	  ebx, CArray
	      mov	  esi, 3
	      mov	  al, [ebx + esi] 	        ; al = ____________
;	      mov	  al, [3 + ebx + esi]	    ; al = ____________

	      mov	  ebx, WArray
	      mov	  esi, 6
	      mov	  ax, [ebx + esi] 	        ; ax = ____________
	      mov	  ax, [4 + ebx + esi]	    ; ax = ____________


        mov     ebx,0   ;successful termination of program
        mov     eax,1   ;system call number (sys_exit)
        int     0x80    ;call kernel
;

;; Notice the file just ends.


Previous | Next

©2004, Gary L. Burt