Difference between revisions of "CSC231 Homework 11 2012"

From dftwiki3
Jump to: navigation, search
(Problem #1)
(Requirements)
Line 22: Line 22:
  
 
==Requirements==
 
==Requirements==
 +
* You need to store your dumpRegs function and all its accompanying functions in a separate file called '''dumpRegs.ing'''
 +
* Your main program, called '''hw11a.asm''' will be exactly as follows:
 +
 +
<br />
 +
<source lang="asm">
 +
;;; your header
 +
 +
%include "dumpRegs.inc"
 +
 +
section .data
 +
;;; your data
 +
 +
section .text
 +
global _start
 +
 +
_start:
 +
 +
;;; Initialize the registers
 +
mov eax, 0x12345678
 +
mov ebx, 0x55FF55FF
 +
mov ecx, 0xFEDCBA98
 +
mov edx, 0x00000000
 +
mov esi, 0xFFFFFFFF
 +
mov edi, 0xFFFFFFF0
 +
 +
;;; dump them twice to verify that no registers gets modified...
 +
        call    dumpRegs
 +
call dumpRegs
 +
 +
 +
;;; exit back to OS
 +
mov ebx, 0
 +
mov eax, 1
 +
int 0x80
 +
</source>
 +
<br />
  
 
==Optional and Extra-Credits==
 
==Optional and Extra-Credits==

Revision as of 13:21, 28 November 2012

--D. Thiebaut 13:14, 28 November 2012 (EST)


Page under construction!
UnderConstruction.jpg

Problem #1

This is a continuation of the Problem #1 of Homework 8. Here you need to complete the output of the dumpRegs function so that it outputs all the registers in decimal, both in unsigned and in signed format.

Here's an example of the output of your program.

-------------------------------------
eax = 00000004  4 4
ebx = 00000001  1 1
ecx = FFFFFFFF  4294966272 -1
edx = 000012FC  4860 4860
edi = FFFFFFFE  4294966271 -2 
esi = 12235557  304305495 304305495
-------------------------------------

Requirements

  • You need to store your dumpRegs function and all its accompanying functions in a separate file called dumpRegs.ing
  • Your main program, called hw11a.asm will be exactly as follows:


;;; your header

%include "dumpRegs.inc"

		section	.data
;;; your data

		section	.text
		global	_start
 
_start:
 
;;; Initialize the registers
		mov	eax, 0x12345678
		mov	ebx, 0x55FF55FF
		mov	ecx, 0xFEDCBA98
		mov	edx, 0x00000000
		mov	esi, 0xFFFFFFFF
		mov	edi, 0xFFFFFFF0
 
;;; dump them twice to verify that no registers gets modified...
	        call    dumpRegs
		call	dumpRegs
 
 
;;; exit back to OS
		mov	ebx, 0
		mov	eax, 1
		int	0x80


Optional and Extra-Credits

Problem #2