UMBC CMSC 313 -- Assembly Homework 1 Previous | Next


Assembly Langauge Homework 1 -- Due Feb 19

;;
;; 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
aByte	DB	11h
aWord	DW	2222h
aDWord	DD	33333333h

section .bss

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

main:                                 ;tell linker entry point

;; put your code here
	
	nop

	mov	eax, [aDWord]		; eax = ______________________

	mov	ax, [aWord]		; eax = ______________________

	mov	ah, [aByte]		; eax = ______________________

	mov	ebx, eax		; ebx = ______________________
	
	mov	bh, 0FFh		; ebx = ______________________

	mov	ax, bx			; eax = ______________________

    	mov	bl, ah			; eax = ______________________

	mov	ebx, 0			; ebx = ______________________







;; The final part of the program must be a call to the operating system to exit
;;; the program.
        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